VOL-1775 VOL-1779 VOL-1780 : Fix several issues with overall stability
- Apply changes as reported by golang race utility
- Added version attribute in KV object
- Added context object to db/model api
- Carrying timestamp info through context to help in the
decision making when applying a revision change
- Replaced proxy access control mechanism with etcd reservation mechanism
Change-Id: If3d142a73b1da0d64fa6a819530f297dbfada2d3
diff --git a/db/model/revision.go b/db/model/revision.go
index cd4c5df..6f52248 100644
--- a/db/model/revision.go
+++ b/db/model/revision.go
@@ -16,6 +16,7 @@
package model
import (
+ "context"
"github.com/opencord/voltha-go/db/kvstore"
"time"
)
@@ -34,6 +35,7 @@
SetHash(hash string)
GetHash() string
ClearHash()
+ getVersion() int64
SetupWatch(key string)
SetName(name string)
GetName() string
@@ -42,10 +44,10 @@
Get(int) interface{}
GetData() interface{}
GetNode() *node
- LoadFromPersistence(path string, txid string, blobs map[string]*kvstore.KVPair) []Revision
SetLastUpdate(ts ...time.Time)
GetLastUpdate() time.Time
- UpdateData(data interface{}, branch *Branch) Revision
- UpdateChildren(name string, children []Revision, branch *Branch) Revision
+ LoadFromPersistence(ctx context.Context, path string, txid string, blobs map[string]*kvstore.KVPair) []Revision
+ UpdateData(ctx context.Context, data interface{}, branch *Branch) Revision
+ UpdateChildren(ctx context.Context, name string, children []Revision, branch *Branch) Revision
UpdateAllChildren(children map[string][]Revision, branch *Branch) Revision
}