smengcl commented on code in PR #8450:
URL: https://github.com/apache/ozone/pull/8450#discussion_r2103042341
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/KeyDeletingService.java:
##########
@@ -202,326 +296,51 @@ public BackgroundTaskResult call() {
// task.
if (shouldRun()) {
final long run = getRunCount().incrementAndGet();
- LOG.debug("Running KeyDeletingService {}", run);
- isRunningOnAOS.set(true);
- int delCount = 0;
- try {
- // TODO: [SNAPSHOT] HDDS-7968. Reclaim eligible key blocks in
- // snapshot's deletedTable when active DB's deletedTable
- // doesn't have enough entries left.
- // OM would have to keep track of which snapshot the key is coming
- // from if the above would be done inside getPendingDeletionKeys().
- // This is to avoid race condition b/w purge request and snapshot
chain update. For AOS taking the global
- // snapshotId since AOS could process multiple buckets in one
iteration.
- UUID expectedPreviousSnapshotId =
snapshotChainManager.getLatestGlobalSnapshotId();
- PendingKeysDeletion pendingKeysDeletion = manager
- .getPendingDeletionKeys(getKeyLimitPerTask());
- List<BlockGroup> keyBlocksList = pendingKeysDeletion
- .getKeyBlocksList();
- if (keyBlocksList != null && !keyBlocksList.isEmpty()) {
- delCount = processKeyDeletes(keyBlocksList,
- pendingKeysDeletion.getKeysToModify(), null,
expectedPreviousSnapshotId);
- deletedKeyCount.addAndGet(delCount);
- metrics.incrNumKeysProcessed(keyBlocksList.size());
- metrics.incrNumKeysSentForPurge(delCount);
- }
- } catch (IOException e) {
- LOG.error("Error while running delete keys background task. Will " +
- "retry at next run.", e);
+ if (snapshotId == null) {
+ LOG.debug("Running KeyDeletingService for active object store, {}",
run);
+ isRunningOnAOS.set(true);
+ } else {
+ LOG.debug("Running KeyDeletingService for snapshot : {}, {}",
snapshotId, run);
Review Comment:
I feel like changing the message for snapshots to `INFO` would be useful.
```suggestion
if (snapshotId == null) {
LOG.debug("Running KeyDeletingService for active object store,
{}", run);
isRunningOnAOS.set(true);
} else {
LOG.info("Running KeyDeletingService for snapshot : {}, {}",
snapshotId, run);
```
--
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]