Galsza commented on code in PR #6281:
URL: https://github.com/apache/ozone/pull/6281#discussion_r1503940543
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2153,15 +2153,16 @@ public long getObjectIdFromTxId(long trxnId) {
long getLastTrxnIndexForNonRatis() throws IOException {
TransactionInfo transactionInfo =
TransactionInfo.readTransactionInfo(metadataManager);
- // If the OMTransactionInfo does not exist in DB or if the term is not -1
- // (corresponding to non-Ratis cluster), return 0 so that new incoming
+ // If the OMTransactionInfo does not exist in DB, return 0 so that new
incoming
// requests can have transaction index starting from 1.
- if (transactionInfo == null || transactionInfo.getTerm() != -1) {
+ if (transactionInfo == null) {
return 0;
}
- // If there exists a last transaction index in DB, the new incoming
- // requests in non-Ratis cluster must have transaction index
- // incrementally increasing from the stored transaction index onwards.
+ // If there exists a last transaction index in DB, including two cases:
+ // 1. the term is -1 corresponds to an existing non-Ratis cluster
Review Comment:
nitpick: (You can also ignore this comment if you think it's not worth
fixing) Please note that this comment will get confusing after the change, as
the reader won't see the original `transactionInfo.getTerm() != -1` condition
and therefore wouldn't think about the transactionInfo.getTerm().
I'd add this information to the pr description or change the comment so that
it explains it a bit more what the "term" means here.
--
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]