VOL-1584: Fix for multi-core cli infinite loop
- Reduced number of calls to kv
- Re-introduced cache logic for in-memory data access
- Misc log updates
Amendments:
- Ensure that we clone the returned cache data
- Give priority to cache but use alternate get methods otherwise
Change-Id: I56ce67f22d9945b7a194f4c6aab0c7fd75dd2f2e
diff --git a/db/model/revision.go b/db/model/revision.go
index 79620e1..74ae3f7 100644
--- a/db/model/revision.go
+++ b/db/model/revision.go
@@ -15,6 +15,10 @@
*/
package model
+import (
+ "github.com/opencord/voltha-go/db/kvstore"
+)
+
type Revision interface {
Finalize(bool)
IsDiscarded() bool
@@ -38,7 +42,7 @@
Get(int) interface{}
GetData() interface{}
GetNode() *node
- LoadFromPersistence(path string, txid string) []Revision
+ LoadFromPersistence(path string, txid string, blobs map[string]*kvstore.KVPair) []Revision
UpdateData(data interface{}, branch *Branch) Revision
UpdateChildren(name string, children []Revision, branch *Branch) Revision
UpdateAllChildren(children map[string][]Revision, branch *Branch) Revision