add error message if detecting raft.db file
parent
a961ff9ebf
commit
6c6fe87a40
|
@ -90,6 +90,15 @@ func NewClient(config *Config) *Client {
|
|||
func (c *Client) Open() error {
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
|
||||
// Check to see if there is a raft db, if so, error out with a message
|
||||
// to downgrade, export, and then import the meta data
|
||||
|
||||
raftFile := filepath.Join(c.path, "raft.db")
|
||||
if _, err := os.Stat(raftFile); err == nil {
|
||||
return fmt.Errorf("detected %s. either downgrade and export your meta data to import before continuing, or delete the file to start fresh", raftFile)
|
||||
}
|
||||
|
||||
// Try to load from disk
|
||||
if err := c.Load(); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue