storage: support recovering from backend

We want the KV to support recovering from backend to avoid
additional pointer swap. Or we have to do coordination between
etcdserver and API layer, since API layer might have access to
kv pointer and use a closed kv.
This commit is contained in:
Xiang Li
2016-01-06 16:25:25 -08:00
parent b546f4c2c2
commit 1714290f4e
6 changed files with 51 additions and 37 deletions

View File

@ -867,10 +867,10 @@ func TestConcurrentApplyAndSnapshotV3(t *testing.T) {
be, tmpPath := backend.NewDefaultTmpBackend()
defer func() {
be.Close()
os.RemoveAll(tmpPath)
}()
s.kv = dstorage.New(be, &s.consistIndex)
s.be = be
s.start()
defer s.Stop()