VOL-2134 - update voltha-go to use v2.2.5 of voltha-lib-go
Change-Id: I8ec822ad0c4d28118ae6d8d68cf697eef21cfea9
diff --git a/vendor/github.com/opencord/voltha-lib-go/pkg/db/model/persisted_revision.go b/vendor/github.com/opencord/voltha-lib-go/pkg/db/model/persisted_revision.go
index c644e14..8ab182b 100644
--- a/vendor/github.com/opencord/voltha-lib-go/pkg/db/model/persisted_revision.go
+++ b/vendor/github.com/opencord/voltha-lib-go/pkg/db/model/persisted_revision.go
@@ -162,7 +162,14 @@
switch event.EventType {
case kvstore.DELETE:
log.Debugw("delete-from-memory", log.Fields{"key": latestRev.GetHash(), "watch": latestRev.GetName()})
- pr.Revision.Drop("", true)
+
+ // Remove reference from cache
+ GetRevCache().Delete(latestRev.GetName())
+
+ // Remove reference from parent
+ parent := pr.GetBranch().Node.GetRoot()
+ parent.GetBranch(NONE).Latest.ChildDropByName(latestRev.GetName())
+
break StopWatchLoop
case kvstore.PUT:
@@ -382,10 +389,11 @@
// Also check if we are treating a newer revision of the data or not
if childRev.GetData().(proto.Message).String() != data.(proto.Message).String() && childRev.getVersion() < version {
log.Debugw("revision-data-is-different", log.Fields{
- "key": childRev.GetHash(),
- "name": childRev.GetName(),
- "data": childRev.GetData(),
- "version": childRev.getVersion(),
+ "key": childRev.GetHash(),
+ "name": childRev.GetName(),
+ "data": childRev.GetData(),
+ "in-memory-version": childRev.getVersion(),
+ "persisted-version": version,
})
//
@@ -436,9 +444,11 @@
} else {
if childRev != nil {
log.Debugw("keeping-revision-data", log.Fields{
- "key": childRev.GetHash(),
- "name": childRev.GetName(),
- "data": childRev.GetData(),
+ "key": childRev.GetHash(),
+ "name": childRev.GetName(),
+ "data": childRev.GetData(),
+ "in-memory-version": childRev.getVersion(),
+ "persistence-version": version,
})
// Update timestamp to reflect when it was last read and to reset tracked timeout
@@ -455,9 +465,10 @@
// There is no available child with that key value.
// Create a new child and update the parent revision.
log.Debugw("no-such-revision-entry", log.Fields{
- "key": keyValue,
- "name": typeName,
- "data": data,
+ "key": keyValue,
+ "name": typeName,
+ "data": data,
+ "version": version,
})
// BEGIN child lock