szetszwo commented on code in PR #4337:
URL: https://github.com/apache/ozone/pull/4337#discussion_r1148485642
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainerMetadataInspector.java:
##########
@@ -392,6 +412,36 @@ private boolean checkAndRepair(JsonObject parent,
errors.add(usedBytesError);
}
+ // check and repair if db delete count mismatches delete transaction count.
+ final JsonElement pendingDeleteCountDB = dBMetadata.get(
+ OzoneConsts.PENDING_DELETE_BLOCK_COUNT);
+ final long dbDeleteCount = jsonToLong(pendingDeleteCountDB);
+ final JsonElement pendingDeleteCountAggregate
+ = aggregates.get(PendingDelete.COUNT);
+ final long deleteTransactionCount =
jsonToLong(pendingDeleteCountAggregate);
+ if (dbDeleteCount != deleteTransactionCount) {
+ passed = false;
+
+ final BooleanSupplier deleteCountRepairAction = () -> {
+ final String key = containerData.getPendingDeleteBlockCountKey();
+ try {
+ // reset delete block count to 0 in metadata table
+ metadataTable.put(key, 0L);
Review Comment:
Good catch! Just have pushed a commit to fix both problems.
--
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]