ArafatKhan2198 commented on code in PR #4406:
URL: https://github.com/apache/ozone/pull/4406#discussion_r1141464896
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/ClusterStateEndpoint.java:
##########
@@ -127,13 +131,19 @@ public Response getClusterState() {
}
Long totalKeys = 0L;
+ Long deletedKeys = 0L;
+
if (keyRecord != null) {
totalKeys += keyRecord.getValue();
}
if (fileRecord != null) {
totalKeys += fileRecord.getValue();
}
+ if (deletedKeyRecord != null) {
+ deletedKeys += deletedKeyRecord.getValue();
+ }
builder.setKeys(totalKeys);
Review Comment:
> I think this needs to be corrected here. If keys moved to deleted table,
then actual total number of keys should also be updated.
Yes, the client sends a delete key request to the OM. Then, the OM moves the
key from the key table (visible namespace) to the deleted key table (internal).
After that, the OM returns success to the client. Hence, before incrementing
the count of keys for the deleted table, we will first decrement the count of
keys from the total keys. I have manually checked it as well, the total key
count gets decremented automatically.
--
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]