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 {
|
func (d *Datastore) reload() error {
|
||||||
log.Debug("Datastore reload")
|
log.Debug("Datastore reload")
|
||||||
d.localLock.Lock()
|
_, err := d.Load()
|
||||||
err := d.kv.LoadConfig(d.meta)
|
return err
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Begin creates a transaction with the KV store.
|
// Begin creates a transaction with the KV store.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue