rakeshadr commented on code in PR #10384:
URL: https://github.com/apache/ozone/pull/10384#discussion_r3374642123
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconStorageContainerSyncHelper.java:
##########
@@ -390,6 +420,39 @@ private boolean syncDeletedContainers() {
} catch (Exception e) {
LOG.error("DELETED sync: unexpected error.", e);
return false;
+ } finally {
+ updateContainerSyncDuration(HddsProtos.LifeCycleState.DELETED,
+ Time.monotonicNow() - startTime);
+ }
+ }
+
+ private void updateDeletedContainerCountDrift() {
+ if (containerSyncMetrics == null) {
+ return;
+ }
+ try {
+ long total = scmServiceProvider.getContainerCount(
+ HddsProtos.LifeCycleState.DELETED);
+ updateContainerCountDrift(HddsProtos.LifeCycleState.DELETED, total);
+ } catch (Exception e) {
+ LOG.warn("DELETED sync: unable to update pre-sync count drift metric.",
e);
Review Comment:
How abt adding negative value representing "SCM count RPC failed". Do we
have any similar code reference in Ozone, Long.MIN_VALUE or -1 represents
failure ?
```
updateContainerCountDrift(HddsProtos.LifeCycleState.DELETED, total);
} catch (Exception e) {
LOG.warn("DELETED sync: unable to update pre-sync count drift
metric.", e);
// Set sentinel so the metric is not misread as "perfectly in sync"
(0).
containerSyncMetrics.setContainerCountDrift(
HddsProtos.LifeCycleState.DELETED, -1L);
}
```
--
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]