From 9b5845f1cb82623198b94fd63f798648889efa95 Mon Sep 17 00:00:00 2001 From: Simon Elsbrock Date: Mon, 30 Oct 2017 11:22:04 +0100 Subject: [PATCH] Fix datastore corruption on reload due to shrinking config size --- cluster/datastore.go | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/cluster/datastore.go b/cluster/datastore.go index 47bfd89ba..cae6b8820 100644 --- a/cluster/datastore.go +++ b/cluster/datastore.go @@ -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.