GlenGeng commented on a change in pull request #1981:
URL: https://github.com/apache/ozone/pull/1981#discussion_r588213021
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/DeletedBlockLogStateManagerImpl.java
##########
@@ -193,14 +198,19 @@ public void increaseRetryCountOfTransactionInDB(
// analyze those blocks and purge them manually by SCMCli.
DeletedBlocksTransaction.Builder builder =
block.toBuilder().setCount(-1);
transactionBuffer.addToBuffer(deletedTable, txID, builder.build());
- skippingRetryTxIDs.add(txID);
+ if (skippingRetryTxIDs != null) {
+ skippingRetryTxIDs.add(txID);
+ }
}
}
public void onFlush() {
- deletingTxIDs.clear();
- skippingRetryTxIDs.clear();
+ if (deletingTxIDs != null) {
Review comment:
Better to be
```
// onFlush() can be invoked only when ratis is enabled.
Preconditions.checkNotNull(deletingTxIDs);
Preconditions.checkNotNull(skippingRetryTxIDs);
deletingTxIDs.clear();
skippingRetryTxIDs.clear();
```
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/DeletedBlockLogStateManagerImpl.java
##########
@@ -89,8 +92,8 @@ private void findNext() {
throw new IllegalStateException("");
}
- if (!deletingTxIDs.contains(txID) &&
- !skippingRetryTxIDs.contains(txID)) {
+ if (deletingTxIDs != null && !deletingTxIDs.contains(txID) &&
Review comment:
```
(deletingTxIDs == null || !deletingTxIDs.contains(txID)) &&
(skippingRetryTxIDs == null || !skippingRetryTxIDs.contains(txID))
```
----------------------------------------------------------------
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]