You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "ArafatKhan2198 (via GitHub)" <gi...@apache.org> on 2023/03/19 20:36:49 UTC
[GitHub] [ozone] ArafatKhan2198 commented on a diff in pull request #4406: HDDS-7994. Expose information via the ClusterState endpoint on keys marked for deletion and moved to the DeletedTable.
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org