kuenishi commented on a change in pull request #2433:
URL: https://github.com/apache/ozone/pull/2433#discussion_r726659789
##########
File path:
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyInfo.java
##########
@@ -286,8 +287,17 @@ public synchronized long addNewVersion(
// it is important that the new version are always at the tail of the
list
OmKeyLocationInfoGroup currentLatestVersion =
keyLocationVersions.get(keyLocationVersions.size() - 1);
+
+ // The new version is created based on the latest version number
+ // and will not include key locations of old versions, until object
+ // versioning is supported and enabled.
OmKeyLocationInfoGroup newVersion =
currentLatestVersion.generateNextVersion(newLocationList);
+ if (!keepOldVersions) {
+ // Even though old versions are cleared here, they will be
+ // moved to delete table at the time of key commit
+ keyLocationVersions.clear();
+ }
keyLocationVersions.add(newVersion);
Review comment:
I'm neutral on the version number on overwrite, from the viewpoint of
algorithm. But I have an instinct on operating complex distributed systems like
Ozone, the version numbers had better be monotonically increasing, especially
when we debug production issues.
I would also want to keep the version number even after the key is deleted,
but that'd be another change of design and IMO it'd be out of the scope of this
work.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]