hanishakoneru commented on a change in pull request #1004:
URL: https://github.com/apache/hadoop-ozone/pull/1004#discussion_r437726086
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeyRenameResponse.java
##########
@@ -93,6 +93,15 @@ public void addToDBBatch(OMMetadataManager omMetadataManager,
omMetadataManager.getKeyTable().putWithBatch(batchOperation,
Review comment:
Let me elaborate on the scenario I am talking about:
Trxn n1 : Create Key - key1
Trxn n2 : Commit Key - key1 (adds n1 -> key1 entry to KeyID table)
Trxn n3 : Rename key1 -> key2 (update n1 -> key2 in KeyID table)
Now lets say we replay transactions from n1.
Replay Trxn n1 : Create Key - key1 (key1 does not exist so this
transaction is replayed)
Replay Trxn n2 : Commit Key - key1 (this again updates n1 -> key1 in KeyID
table)
Replay Trxn n3 : Since key2 exists, we figure out this is replay and
execute
deleteFromKeyOnly() logic in addToBatch.
So finally after replay, we have n1 in KeyID table pointing to key1 instead
of key2.
> I also noticed that the sequence of delete and newkey addition was
reversed before this change. Not sure how this worked.
The order does not matter here as they are part of batch operation.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]