Fix datastore corruption on reload due to shrinking config size
This commit is contained in:
parent
1b2cb53d4f
commit
9b5845f1cb
1 changed files with 2 additions and 13 deletions
|
@ -119,19 +119,8 @@ func (d *Datastore) watchChanges() error {
|
|||
|
||||
func (d *Datastore) reload() error {
|
||||
log.Debug("Datastore reload")
|
||||
d.localLock.Lock()
|
||||
err := d.kv.LoadConfig(d.meta)
|
||||
if err != nil {
|
||||
d.localLock.Unlock()
|
||||
return err
|
||||
}
|
||||
err = d.meta.unmarshall()
|
||||
if err != nil {
|
||||
d.localLock.Unlock()
|
||||
return err
|
||||
}
|
||||
d.localLock.Unlock()
|
||||
return nil
|
||||
_, err := d.Load()
|
||||
return err
|
||||
}
|
||||
|
||||
// Begin creates a transaction with the KV store.
|
||||
|
|
Loading…
Reference in a new issue