Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
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.
func New ¶
New creates a new Migrator given the path to a Consul data-dir. Returns the new Migrator and any error.
func (*Migrator) Migrate ¶
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.