pax_global_header00006660000000000000000000000064125122601140014504gustar00rootroot0000000000000052 comment=4977886fc950a0db1a6f0bbadca56dfabf170f9c consul-migrate-0.1.0/000077500000000000000000000000001251226011400144335ustar00rootroot00000000000000consul-migrate-0.1.0/.gitignore000066400000000000000000000004211251226011400164200ustar00rootroot00000000000000# Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a *.so # Folders _obj _test # Architecture specific extensions/prefixes *.[568vq] [568vq].out *.cgo1.go *.cgo2.c _cgo_defun.c _cgo_gotypes.go _cgo_export.* _testmain.go *.exe *.test *.prof bin/* consul-migrate-0.1.0/LICENSE000066400000000000000000000371511251226011400154470ustar00rootroot00000000000000Mozilla Public License, version 2.0 1. Definitions 1.1. “Contributor” means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. “Contributor Version” means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution. 1.3. “Contribution” means Covered Software of a particular Contributor. 1.4. “Covered Software” means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. “Incompatible With Secondary Licenses” means a. that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or b. that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. “Executable Form” means any form of the work other than Source Code Form. 1.7. “Larger Work” means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. “License” means this document. 1.9. “Licensable” means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. “Modifications” means any of the following: a. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or b. any new file in Source Code Form that contains any Covered Software. 1.11. “Patent Claims” of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. “Secondary License” means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. “Source Code Form” means the form of the work preferred for making modifications. 1.14. “You” (or “Your”) means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: a. under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and b. under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: a. for any code that a Contributor has removed from Covered Software; or b. for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or c. under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: a. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and b. You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. 6. Disclaimer of Warranty Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. 7. Limitation of Liability Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. 8. Litigation Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims. 9. Miscellaneous This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - “Incompatible With Secondary Licenses” Notice This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0. consul-migrate-0.1.0/Makefile000066400000000000000000000000751251226011400160750ustar00rootroot00000000000000test: go test ./... build: go build -o bin/consul-migrate consul-migrate-0.1.0/README.md000066400000000000000000000044261251226011400157200ustar00rootroot00000000000000consul-migrate ============== consul-migrate is a Go package and CLI utility to perform a very specific data migration for Consul servers nodes. Between Consul versions 0.5.0 and 0.5.1, the backend for storing Raft data was changed from LMDB to BoltDB. To support seamless upgrades, this library is embedded in Consul version 0.5.1 to perform the upgrade automatically. Supported Upgrade Paths ======================= Following is a table detailing the supported upgrade paths for Consul. | From Version | To Version | Procedure | |--------------|------------|-----------------------------------| | < 0.5.1 | 0.5.1 | Start Consul v0.5.1 normally. | | < 0.5.1 | 0.6.0+ | Run `consul-migrate` CLI utility. | CLI Usage ========= The consul-migrate CLI is very easy to use. It takes only a single argument: the path to the consul data-dir. Everything else is handled automatically. ``` Usage: consul-migrate ``` What happens to my data? ======================== The following is the high-level overview of what happens when consul-migrate is invoked, either as a function or using the CLI: 1. The provided data-dir is checked for and `mdb` sub-dir. If it exists, the migration procedure continues to 2. If it does not exist, the data-dir is checked for the `raft/raft.db` file. If it exists, this indicates the migration has already completed, and the program exits with success. If it does not exist, the data-dir is not a consul data-dir, and the program exits with an error. 2. A new BoltDB file is created in the data-dir, at `raft/raft.db.temp`. All of the Consul data will be migrated to this new DB file. 3. Both LMDB and the BoltDB stores are opened. Data is copied out of LMDB and into BoltDB. No write operations are performed on LMDB. 4. The `raft/raft.db.temp` file is moved to `raft/raft.db`. This is the location where Consul expects to find the bolt file. 5. The `mdb` directory in the data-dir is renamed to `mdb.backup`. This prevents the migration from re-running. At this point, the data is successfully migrated and ready to use. If any of the above steps encounter errors, the entire process is aborted, and the temporary BoltDB file is removed. The migration can be retried without negative consequences. consul-migrate-0.1.0/main.go000066400000000000000000000033021251226011400157040ustar00rootroot00000000000000package main import ( "fmt" "os" "time" "github.com/hashicorp/consul-migrate/migrator" ) func main() { os.Exit(realMain(os.Args)) } func realMain(args []string) int { if len(args) != 2 { fmt.Println(usage()) return 1 } // Observe the help flags if args[1] == "-h" || args[1] == "--help" { fmt.Println(usage()) return 0 } // Create the migrator m, err := migrator.New(args[1]) if err != nil { fmt.Printf("Error creating migrator: %s\n", err) return 1 } // Perform the migration start := time.Now() migrated, err := m.Migrate() if err != nil { fmt.Printf("Migration failed: %s\n", err) return 1 } // Check the result if migrated { fmt.Printf("Migration completed in %s\n", time.Now().Sub(start)) } else { fmt.Printf("Nothing to do for directory '%s'\n", args[1]) } return 0 } func usage() string { return `Usage: consul-migrate Consul-migrate is a tool for moving Consul server data from LMDB to BoltDB. This is a prerequisite for upgrading to Consul >= 0.5.1. This utility will migrate all of the data Consul needs to pick up right where it left off. The original MDB data folder will *NOT* be modified during the migration process. If any part of the migration fails, it is safe to try again. This command is also idempotent, and will not re-attempt a migration which has already been completed. Upon successful migration, the MDB data directory will be renamed so that it includes the ".backup" extension. Once you have verified Consul is operational after the migration, and contains all of the expected data, it is safe to archive the "mdb.backup" directory and remove it from the Consul server. Returns 0 on successful migration or no-op, 1 for errors. ` } consul-migrate-0.1.0/main_test.go000066400000000000000000000032431251226011400167470ustar00rootroot00000000000000package main import ( "io/ioutil" "os" "strings" "testing" ) func TestMain_fails(t *testing.T) { // Returns 1 on bad args if code := realMain([]string{}); code != 1 { t.Fatalf("bad: %d", code) } if code := realMain([]string{"1", "2", "3"}); code != 1 { t.Fatalf("bad: %d", code) } // Returns 1 on bad data-dir if code := realMain([]string{"consul-migrate", "/unicorns"}); code != 1 { t.Fatalf("bad: %d", code) } } func TestMain_help(t *testing.T) { fh, err := ioutil.TempFile("", "consul-migrate") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(fh.Name()) stdoutOrig := *os.Stdout os.Stdout = fh defer func() { os.Stdout = &stdoutOrig }() if code := realMain([]string{"consul-migrate", "-h"}); code != 0 { t.Fatalf("bad: %d", code) } if _, err := fh.Seek(0, 0); err != nil { t.Fatalf("err: %s", err) } out, err := ioutil.ReadAll(fh) if !strings.HasPrefix(string(out), "Usage:") { t.Fatalf("bad: %s", string(out)) } } func TestMain_noop(t *testing.T) { fh, err := ioutil.TempFile("", "consul-migrate") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(fh.Name()) stdoutOrig := *os.Stdout os.Stdout = fh defer func() { os.Stdout = &stdoutOrig }() dir, err := ioutil.TempDir("", "consul-migrate") if err != nil { t.Fatalf("err: %s", err) } defer os.RemoveAll(dir) if code := realMain([]string{"consul-migrate", dir}); code != 0 { t.Fatalf("bad: %d", code) } if _, err := fh.Seek(0, 0); err != nil { t.Fatalf("err: %s", err) } out, err := ioutil.ReadAll(fh) if err != nil { t.Fatalf("err: %s", err) } if !strings.HasPrefix(string(out), "Nothing to do") { t.Fatalf("bad: %s", string(out)) } } consul-migrate-0.1.0/migrator/000077500000000000000000000000001251226011400162575ustar00rootroot00000000000000consul-migrate-0.1.0/migrator/migrator.go000066400000000000000000000137751251226011400204470ustar00rootroot00000000000000package migrator import ( "fmt" "os" "path/filepath" "runtime" "github.com/hashicorp/raft" "github.com/hashicorp/raft-boltdb" "github.com/hashicorp/raft-mdb" ) const ( // Path to the raft directory raftDir = "raft" // Path to the legacy MDB data and its backup location mdbDir = "mdb" mdbBackupDir = "mdb.backup" // The name of the BoltDB file in the raft path boltFile = "raft.db" boltTempFile = "raft.db.temp" // Maximum log sizes for LMDB. These mirror settings in Consul // and are automatically set based on the runtime. maxLogSize32bit uint64 = 8 * 1024 * 1024 * 1024 maxLogSize64bit uint64 = 64 * 1024 * 1024 * 1024 ) var ( // Common error messages from migrator errFirstIndexZero = fmt.Errorf("No logs found (first index was 0)") errLastIndexZero = fmt.Errorf("No logs found (last index was 0)") // stableStoreKeys are the well-known keys written to the // stable store, and are used internally by Raft. We hard-code // them here so that we can copy them explicitly. stableStoreKeys [][]byte = [][]byte{ []byte("CurrentTerm"), []byte("LastVoteTerm"), []byte("LastVoteCand"), } ) // Migrator is used to migrate the Consul data storage format on // servers with versions <= 0.5.0. Consul versions >= 0.5.1 use // BoltDB internally as the store for the Raft log. During this // transition, it is necessary to copy data out of our LMDB store // and create a new BoltStore with the same data. type Migrator struct { dataDir string // The Consul data-dir mdbStore *raftmdb.MDBStore // The legacy MDB environment boltStore *raftboltdb.BoltStore // Handle for the new store // Calculated paths based on the data dir raftPath string mdbPath string mdbBackupPath string boltPath string boltTempPath string } // New creates a new Migrator given the path to a Consul // data-dir. Returns the new Migrator and any error. func New(dataDir string) (*Migrator, error) { // Check that the directory exists if _, err := os.Stat(dataDir); err != nil { return nil, err } // Create the struct m := &Migrator{ dataDir: dataDir, raftPath: filepath.Join(dataDir, raftDir), mdbPath: filepath.Join(dataDir, raftDir, mdbDir), mdbBackupPath: filepath.Join(dataDir, raftDir, mdbBackupDir), boltPath: filepath.Join(dataDir, raftDir, boltFile), boltTempPath: filepath.Join(dataDir, raftDir, boltTempFile), } return m, nil } // mdbConnect is used to open a handle on our LMDB raft backend. This // is enough to read all of the Consul data we need to migrate. func (m *Migrator) mdbConnect(dir string) error { // Calculate and set the max size size := maxLogSize32bit if runtime.GOARCH == "amd64" { size = maxLogSize64bit } // Open the connection mdb, err := raftmdb.NewMDBStoreWithSize(dir, size) if err != nil { return err } // Return the new environment m.mdbStore = mdb return nil } // boltConnect creates a new BoltStore to copy our data into. We can // use the BoltStore directly because it provides simple setter // methods, provided our keys and values are known. func (m *Migrator) boltConnect(file string) error { // Connect to the new BoltStore store, err := raftboltdb.NewBoltStore(file) if err != nil { return err } m.boltStore = store return nil } // migrateStableStore copies values out of the origin StableStore // and writes them into the destination. There are only a handful // of keys we need, so we copy them explicitly. func (m *Migrator) migrateStableStore() error { for _, key := range stableStoreKeys { val, err := m.mdbStore.Get(key) if err != nil { if err.Error() != "not found" { return fmt.Errorf("Error getting key '%s': %s", string(key), err) } continue } if err := m.boltStore.Set(key, val); err != nil { return fmt.Errorf("Error storing key '%s': %s", string(key), err) } } return nil } // migrateLogStore is like migrateStableStore, but iterates over // all of our Raft logs and copies them into the new BoltStore. func (m *Migrator) migrateLogStore() error { first, err := m.mdbStore.FirstIndex() if err != nil { return err } if first == 0 { return errFirstIndexZero } last, err := m.mdbStore.LastIndex() if err != nil { return err } if last == 0 { return errLastIndexZero } for i := first; i <= last; i++ { log := &raft.Log{} if err := m.mdbStore.GetLog(i, log); err != nil { return err } if err := m.boltStore.StoreLog(log); err != nil { return err } } return nil } // Migrate is the high-level function we call when we want to attempt // to migrate all of our LMDB data into BoltDB. If an error is // encountered, the BoltStore is nuked from disk, since it is useless. // The migration can be attempted again, as the LMDB data should // still be intact. Returns a bool indicating whether a migration // was completed, and any error. func (m *Migrator) Migrate() (bool, error) { // Check if we should attempt a migration if _, err := os.Stat(m.mdbPath); os.IsNotExist(err) { return false, nil } // Connect the stores if err := m.mdbConnect(m.raftPath); err != nil { return false, fmt.Errorf("Failed to connect MDB: %s", err) } defer m.mdbStore.Close() if err := m.boltConnect(m.boltTempPath); err != nil { return false, fmt.Errorf("Failed to connect BoltDB: %s", err) } defer m.boltStore.Close() // Ensure we clean up the temp file during failure cases defer os.Remove(m.boltTempPath) // Migrate the stable store if err := m.migrateStableStore(); err != nil { return false, fmt.Errorf("Failed to migrate stable store: %v", err) } // Migrate the log store if err := m.migrateLogStore(); err != nil { return false, fmt.Errorf("Failed to migrate log store: %v", err) } // Activate the new BoltDB file if err := os.Rename(m.boltTempPath, m.boltPath); err != nil { return false, fmt.Errorf("Failed to move BoltDB file: %s", err) } // Move the old MDB dir to its backup location if err := os.Rename(m.mdbPath, m.mdbBackupPath); err != nil { os.Remove(m.boltPath) return false, fmt.Errorf("Failed to move MDB dir: %v", err) } return true, nil } consul-migrate-0.1.0/migrator/migrator_test.go000066400000000000000000000146361251226011400215030ustar00rootroot00000000000000package migrator import ( "bytes" "io" "io/ioutil" "os" "path/filepath" "reflect" "strings" "testing" "github.com/hashicorp/raft" ) func testRaftDir(t *testing.T) string { dir, err := ioutil.TempDir("", "consul-migrate") if err != nil { t.Fatalf("err: %s", err) } // Make the mdb sub-dir if err := os.MkdirAll(filepath.Join(dir, "raft", "mdb"), 0700); err != nil { t.Fatalf("err: %s", err) } // Copy the MDB files for _, file := range []string{"data.mdb", "lock.mdb"} { src, err := os.Open(filepath.Join("test-fixtures", raftDir, mdbDir, file)) if err != nil { t.Fatalf("err: %s", err) } dest, err := os.Create(filepath.Join(dir, raftDir, mdbDir, file)) if err != nil { t.Fatalf("err: %s", err) } if _, err := io.Copy(dest, src); err != nil { t.Fatalf("err: %s", err) } src.Close() dest.Close() } return dir } // Tests our fixture data to make sure that the other tests in this file // are properly exercising the migrator utility. func TestMigrator_data(t *testing.T) { dir := testRaftDir(t) defer os.RemoveAll(dir) m, err := New(dir) if err != nil { t.Fatalf("err: %s", err) } if err := m.mdbConnect(m.raftPath); err != nil { t.Fatalf("err: %s", err) } defer m.mdbStore.Close() // Ensure we have at least a few logs in the log store first, err := m.mdbStore.FirstIndex() if err != nil { t.Fatalf("err: %s", err) } last, err := m.mdbStore.LastIndex() if err != nil { t.Fatalf("err: %s", err) } if first < 1 || last < 3 { t.Fatalf("bad index: first=%d, last=%d", first, last) } // Ensure we have the stable store keys for _, key := range stableStoreKeys { if _, err := m.mdbStore.Get(key); err != nil { t.Fatalf("missing stable store key: %s", string(key)) } } } func TestMigrator_new(t *testing.T) { // Fails on bad data-dir if _, err := New("/leprechauns"); err == nil { t.Fatalf("should fail") } // Works with an existing directory dir := testRaftDir(t) defer os.RemoveAll(dir) m, err := New(dir) if err != nil { t.Fatalf("err: %s", err) } // Check the paths if m.raftPath != filepath.Join(dir, raftDir) { t.Fatalf("bad: %s", m.raftPath) } if m.mdbPath != filepath.Join(dir, raftDir, mdbDir) { t.Fatalf("bad: %s", m.mdbPath) } if m.mdbBackupPath != filepath.Join(dir, raftDir, mdbBackupDir) { t.Fatalf("bad: %s", m.mdbBackupPath) } if m.boltPath != filepath.Join(dir, raftDir, boltFile) { t.Fatalf("bad: %s", m.boltPath) } if m.boltTempPath != filepath.Join(dir, raftDir, boltTempFile) { t.Fatalf("err: %s", err) } } func TestMigrator_migrate(t *testing.T) { dir := testRaftDir(t) defer os.RemoveAll(dir) // Create the migrator m, err := New(dir) if err != nil { t.Fatalf("err: %s", err) } // Perform the migration if _, err := m.Migrate(); err != nil { t.Fatalf("err: %s %s", err) } // Check that the temp bolt file was removed if _, err := os.Stat(m.boltTempPath); err == nil { t.Fatalf("did not remove temp bolt file") } // Check that the new BoltStore was created if _, err := os.Stat(m.boltPath); err != nil { t.Fatalf("missing bolt file: %s", err) } // Check that the MDB store was backed up if _, err := os.Stat(m.mdbPath); err == nil { t.Fatalf("MDB dir was not moved") } if _, err := os.Stat(m.mdbBackupPath); err != nil { t.Fatalf("Missing MDB backup dir") } // Reconnect the data sources. Requires moving the MDB // store back to its original location. if err := os.Rename(m.mdbBackupPath, m.mdbPath); err != nil { t.Fatalf("err: %s", err) } if err := m.mdbConnect(m.raftPath); err != nil { t.Fatalf("err: %s", err) } defer m.mdbStore.Close() if err := m.boltConnect(m.boltPath); err != nil { t.Fatalf("err: %s", err) } defer m.boltStore.Close() // Check that the BoltStore now has the indexes mFirst, err := m.mdbStore.FirstIndex() if err != nil { t.Fatalf("err: %s", err) } mLast, err := m.mdbStore.LastIndex() if err != nil { t.Fatalf("err: %s", err) } bFirst, err := m.boltStore.FirstIndex() if err != nil { t.Fatalf("err: %s", err) } if bFirst != mFirst { t.Fatalf("bad: %d", bFirst) } bLast, err := m.boltStore.LastIndex() if err != nil { t.Fatalf("err: %s", err) } if bLast != mLast { t.Fatalf("bad: %d", bLast) } // Ensure that the logs were copied properly for i := mFirst; i <= mLast; i++ { mLog := &raft.Log{} if err := m.mdbStore.GetLog(i, mLog); err != nil { t.Fatalf("err: %s", err) } bLog := &raft.Log{} if err := m.boltStore.GetLog(i, bLog); err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(mLog, bLog) { t.Fatalf("bad: %v %v", mLog, bLog) } } // Ensure the stable store values were copied. for _, key := range stableStoreKeys { mVal, err := m.mdbStore.Get(key) if err != nil { t.Fatalf("err: %s", err) } bVal, err := m.boltStore.Get(key) if err != nil { t.Fatalf("err: %s", err) } if !bytes.Equal(mVal, bVal) { t.Fatalf("bad value for key '%s'", key) } } } func TestMigrator_migrate_fails(t *testing.T) { // Create a new temp dir. We will attempt to use this // as the Raft dir to create errors. dir, err := ioutil.TempDir("", "consul-migrate") if err != nil { t.Fatalf("err: %s", err) } defer os.RemoveAll(dir) // Create the migrator m, err := New(dir) if err != nil { t.Fatalf("err: %s", err) } // Create the MDB path so that the migrator will run if err := os.MkdirAll(m.mdbPath, 0700); err != nil { t.Fatalf("err: %s", err) } // Attempt the migration. This will fail. migrated, err := m.Migrate() if !strings.Contains(err.Error(), errFirstIndexZero.Error()) { t.Fatalf("bad: %s", err) } if migrated { t.Fatalf("should not have migrated") } // Ensure that the MDB dir was not moved if _, err := os.Stat(m.mdbPath); err != nil { t.Fatalf("err: %s", err) } if _, err := os.Stat(m.mdbBackupPath); !os.IsNotExist(err) { t.Fatalf("err: %s", err) } // Ensure no BoltDB files were left if _, err := os.Stat(m.boltPath); !os.IsNotExist(err) { t.Fatalf("err: %s", err) } if _, err := os.Stat(m.boltTempPath); !os.IsNotExist(err) { t.Fatalf("err: %s", err) } } func TestMigrator_migrate_noop(t *testing.T) { dir, err := ioutil.TempDir("", "consul-migrate") if err != nil { t.Fatalf("err: %s", err) } defer os.RemoveAll(dir) // Should return no-op if MDB dir doesn't exist m, err := New(dir) if err != nil { t.Fatalf("err: %s", err) } migrated, err := m.Migrate() if err != nil { t.Fatalf("err: %s", err) } if migrated { t.Fatalf("should not have migrated") } } consul-migrate-0.1.0/migrator/test-fixtures/000077500000000000000000000000001251226011400211055ustar00rootroot00000000000000consul-migrate-0.1.0/migrator/test-fixtures/raft/000077500000000000000000000000001251226011400220415ustar00rootroot00000000000000consul-migrate-0.1.0/migrator/test-fixtures/raft/mdb/000077500000000000000000000000001251226011400226035ustar00rootroot00000000000000consul-migrate-0.1.0/migrator/test-fixtures/raft/mdb/data.mdb000077500000000000000000001700001251226011400242010ustar00rootroot00000000000000*  )0conf0logs 0conf0logs x H  j @ J\>9Data127.0.0.2:8300127.0.0.1:8300IndexTermTypeDataIndexTermTypeData}Address127.0.0.1CheckChecksDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeDataAddress127.0.0.2CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode2NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeJData.127.0.0.2:8300127.0.0.3:8300127.0.0.1:8300IndexTermTypeSData7CheckIDDatacenterdc1Nodenode2ServiceIDTokenIndexTermType9Data127.0.0.3:8300127.0.0.1:8300IndexTermTypeDataAddress127.0.0.1CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode1NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeJData.127.0.0.1:8300127.0.0.3:8300127.0.0.2:8300IndexTermTypeSData7CheckIDDatacenterdc1Nodenode1ServiceIDTokenIndexTermTypeDataIndexTermType9 Data127.0.0.3:8300127.0.0.2:8300Index TermType9 Data127.0.0.3:8300127.0.0.2:8300Index TermType DataIndex TermType Data}Address127.0.0.3CheckChecksDatacenterdc1Nodenode3ServiceAddressIDconsulPort lServiceconsulTagsTokenIndex TermType Data}Address127.0.0.2CheckChecksDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndex TermTypeDataAddress127.0.0.3CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode3NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode3ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeJData.127.0.0.3:8300127.0.0.1:8300127.0.0.2:8300IndexTermTypeDataAddress127.0.0.2CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode2NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermType9Data127.0.0.2:8300127.0.0.1:8300IndexTermTypeData}Address127.0.0.1CheckChecksDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeDataAddress127.0.0.1CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode1NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermType LastVoteCand127.0.0.2:8300 LastVoteTerm CurrentTermHl x H  j @ J\>fbJData.127.0.0.3:8300127.0.0.2:8300127.0.0.1:8300IndexTermTypeData}Address127.0.0.2CheckChecksDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeSData7CheckIDDatacenterdc1Nodenode3ServiceIDTokenIndexTermTypeDataIndexTermType9Data127.0.0.2:8300127.0.0.1:8300IndexTermType9Data127.0.0.2:8300127.0.0.1:8300IndexTermTypeDataIndexTermTypeData}Address127.0.0.1CheckChecksDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeDataAddress127.0.0.2CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode2NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeJData.127.0.0.2:8300127.0.0.3:8300127.0.0.1:8300IndexTermTypeSData7CheckIDDatacenterdc1Nodenode2ServiceIDTokenIndexTermType9Data127.0.0.3:8300127.0.0.1:8300IndexTermTypeDataAddress127.0.0.1CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode1NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeJData.127.0.0.1:8300127.0.0.3:8300127.0.0.2:8300IndexTermTypeSData7CheckIDDatacenterdc1Nodenode1ServiceIDTokenIndexTermTypeDataIndexTermType9 Data127.0.0.3:8300127.0.0.2:8300Index TermType9 Data127.0.0.3:8300127.0.0.2:8300Index TermType DataIndex TermType Data}Address127.0.0.3CheckChecksDatacenterdc1Nodenode3ServiceAddressIDconsulPort lServiceconsulTagsTokenIndex TermType Data}Address127.0.0.2CheckChecksDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndex TermTypeDataAddress127.0.0.3CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode3NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode3ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeJData.127.0.0.3:8300127.0.0.1:8300127.0.0.2:8300IndexTermTypeDataAddress127.0.0.2CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode2NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermType9Data127.0.0.2:8300127.0.0.1:8300IndexTermTypeData}Address127.0.0.1CheckChecksDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeDataAddress127.0.0.1CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode1NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeDataIndexTermType*Data127.0.0.1:8300IndexTermTypex H  j @ J\>fbData}Address127.0.0.2CheckChecksDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeSData7CheckIDDatacenterdc1Nodenode3ServiceIDTokenIndexTermTypeDataIndexTermType9Data127.0.0.2:8300127.0.0.1:8300IndexTermType9Data127.0.0.2:8300127.0.0.1:8300IndexTermTypeDataIndexTermTypeData}Address127.0.0.1CheckChecksDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeDataAddress127.0.0.2CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode2NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeJData.127.0.0.2:8300127.0.0.3:8300127.0.0.1:8300IndexTermTypeSData7CheckIDDatacenterdc1Nodenode2ServiceIDTokenIndexTermType9Data127.0.0.3:8300127.0.0.1:8300IndexTermTypeDataAddress127.0.0.1CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode1NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeJData.127.0.0.1:8300127.0.0.3:8300127.0.0.2:8300IndexTermTypeSData7CheckIDDatacenterdc1Nodenode1ServiceIDTokenIndexTermTypeDataIndexTermType9 Data127.0.0.3:8300127.0.0.2:8300Index TermType9 Data127.0.0.3:8300127.0.0.2:8300Index TermType DataIndex TermType Data}Address127.0.0.3CheckChecksDatacenterdc1Nodenode3ServiceAddressIDconsulPort lServiceconsulTagsTokenIndex TermType Data}Address127.0.0.2CheckChecksDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndex TermTypeDataAddress127.0.0.3CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode3NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode3ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeJData.127.0.0.3:8300127.0.0.1:8300127.0.0.2:8300IndexTermTypeDataAddress127.0.0.2CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode2NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermType9Data127.0.0.2:8300127.0.0.1:8300IndexTermTypeData}Address127.0.0.1CheckChecksDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeDataAddress127.0.0.1CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode1NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsToken0conf0logs,v,9Data127.0.0.2:8300127.0.0.3:8300IndexTermTypeDataAddress127.0.0.3CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode3NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode3ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeJData.127.0.0.3:8300127.0.0.2:8300127.0.0.1:8300IndexTermType Jbl x H  j @ J\>fbJData.127.0.0.3:8300127.0.0.2:8300127.0.0.1:8300IndexTermTypeData}Address127.0.0.2CheckChecksDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeSData7CheckIDDatacenterdc1Nodenode3ServiceIDTokenIndexTermTypeDataIndexTermType9Data127.0.0.2:8300127.0.0.1:8300IndexTermType9Data127.0.0.2:8300127.0.0.1:8300IndexTermTypeDataIndexTermTypeData}Address127.0.0.1CheckChecksDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeDataAddress127.0.0.2CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode2NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeJData.127.0.0.2:8300127.0.0.3:8300127.0.0.1:8300IndexTermTypeSData7CheckIDDatacenterdc1Nodenode2ServiceIDTokenIndexTermType9Data127.0.0.3:8300127.0.0.1:8300IndexTermTypeDataAddress127.0.0.1CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode1NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeJData.127.0.0.1:8300127.0.0.3:8300127.0.0.2:8300IndexTermTypeSData7CheckIDDatacenterdc1Nodenode1ServiceIDTokenIndexTermTypeDataIndexTermType9 Data127.0.0.3:8300127.0.0.2:8300Index TermType9 Data127.0.0.3:8300127.0.0.2:8300Index TermType DataIndex TermType Data}Address127.0.0.3CheckChecksDatacenterdc1Nodenode3ServiceAddressIDconsulPort lServiceconsulTagsTokenIndex TermType Data}Address127.0.0.2CheckChecksDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndex TermTypeDataAddress127.0.0.3CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode3NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode3ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeJData.127.0.0.3:8300127.0.0.1:8300127.0.0.2:8300IndexTermTypeDataAddress127.0.0.2CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode2NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermType9Data127.0.0.2:8300127.0.0.1:8300IndexTermTypeData}Address127.0.0.1CheckChecksDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeDataAddress127.0.0.1CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode1NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeDataIndexTermType*Data127.0.0.1:8300IndexTermType 0conf ( '  vvDataAddress127.0.0.3CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode3NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode3ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeJData.127.0.0.3:8300127.0.0.2:8300127.0.0.1:8300IndexTermType   x H  j @ J\>fbData}Address127.0.0.2CheckChecksDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeSData7CheckIDDatacenterdc1Nodenode3ServiceIDTokenIndexTermTypeDataIndexTermType9Data127.0.0.2:8300127.0.0.1:8300IndexTermType9Data127.0.0.2:8300127.0.0.1:8300IndexTermTypeDataIndexTermTypeData}Address127.0.0.1CheckChecksDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeDataAddress127.0.0.2CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode2NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeJData.127.0.0.2:8300127.0.0.3:8300127.0.0.1:8300IndexTermTypeSData7CheckIDDatacenterdc1Nodenode2ServiceIDTokenIndexTermType9Data127.0.0.3:8300127.0.0.1:8300IndexTermTypeDataAddress127.0.0.1CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode1NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeJData.127.0.0.1:8300127.0.0.3:8300127.0.0.2:8300IndexTermTypeSData7CheckIDDatacenterdc1Nodenode1ServiceIDTokenIndexTermTypeDataIndexTermType9 Data127.0.0.3:8300127.0.0.2:8300Index TermType9 Data127.0.0.3:8300127.0.0.2:8300Index TermType DataIndex TermType Data}Address127.0.0.3CheckChecksDatacenterdc1Nodenode3ServiceAddressIDconsulPort lServiceconsulTagsTokenIndex TermType Data}Address127.0.0.2CheckChecksDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndex TermTypeDataAddress127.0.0.3CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode3NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode3ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeJData.127.0.0.3:8300127.0.0.1:8300127.0.0.2:8300IndexTermTypeDataAddress127.0.0.2CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode2NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermType9Data127.0.0.2:8300127.0.0.1:8300IndexTermTypeData}Address127.0.0.1CheckChecksDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeDataAddress127.0.0.1CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode1NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermType )  (x H  j @ J\>fbJData.127.0.0.3:8300127.0.0.2:8300127.0.0.1:8300IndexTermTypeData}Address127.0.0.2CheckChecksDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeSData7CheckIDDatacenterdc1Nodenode3ServiceIDTokenIndexTermTypeDataIndexTermType9Data127.0.0.2:8300127.0.0.1:8300IndexTermType9Data127.0.0.2:8300127.0.0.1:8300IndexTermTypeDataIndexTermTypeData}Address127.0.0.1CheckChecksDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeDataAddress127.0.0.2CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode2NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeJData.127.0.0.2:8300127.0.0.3:8300127.0.0.1:8300IndexTermTypeSData7CheckIDDatacenterdc1Nodenode2ServiceIDTokenIndexTermType9Data127.0.0.3:8300127.0.0.1:8300IndexTermTypeDataAddress127.0.0.1CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode1NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeJData.127.0.0.1:8300127.0.0.3:8300127.0.0.2:8300IndexTermTypeSData7CheckIDDatacenterdc1Nodenode1ServiceIDTokenIndexTermTypeDataIndexTermType9 Data127.0.0.3:8300127.0.0.2:8300Index TermType9 Data127.0.0.3:8300127.0.0.2:8300Index TermType DataIndex TermType Data}Address127.0.0.3CheckChecksDatacenterdc1Nodenode3ServiceAddressIDconsulPort lServiceconsulTagsTokenIndex TermType Data}Address127.0.0.2CheckChecksDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndex TermTypeDataAddress127.0.0.3CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode3NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode3ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeJData.127.0.0.3:8300127.0.0.1:8300127.0.0.2:8300IndexTermTypeDataAddress127.0.0.2CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode2NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode2ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermType9Data127.0.0.2:8300127.0.0.1:8300IndexTermTypeData}Address127.0.0.1CheckChecksDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTypeDataAddress127.0.0.1CheckChecksCheckIDserfHealthNameSerf Health StatusNodenode1NotesOutputAgent alive and reachableServiceIDServiceNameStatuspassingDatacenterdc1Nodenode1ServiceAddressIDconsulPort lServiceconsulTagsTokenIndexTermTy(*  ) consul-migrate-0.1.0/migrator/test-fixtures/raft/mdb/lock.mdb000077500000000000000000000200001251226011400242120ustar00rootroot00000000000000/MDBrK