nizhikov commented on code in PR #11633: URL: https://github.com/apache/ignite/pull/11633#discussion_r1836057407
########## modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java: ########## @@ -978,20 +968,26 @@ private void onHistoryAdded( Iterator<HistoryAffinityAssignment> it = affCache.values().iterator(); + AffinityTopologyVersion lastAffChangeTopVer = + ctx.cache().context().exchange().lastAffinityChangedTopologyVersion(head.get().topologyVersion()); + while (it.hasNext()) { HistoryAffinityAssignment aff0 = it.next(); - if (aff0.requiresHistoryCleanup()) { - // We can stop cleanup only on non-shallow item. - // Keeping part of shallow items chain if corresponding real item is missing makes no sense. - if (!shouldContinueCleanup(nonShallowSize, totalSize)) { - nonShallowHistSize.getAndAdd(nonShallowSize - initNonShallowSize); + if (!shouldContinueCleanup(nonShallowSize, totalSize)) { Review Comment: ``` int initNonShallowSize = nonShallowSize; ``` This variable not required and always equals to `nonShallowHistSize.get()`. Can be removed. This line ``` nonShallowHistSize.getAndAdd(nonShallowSize - initNonShallowSize); ``` can be replaced with ``` nonShallowHistSize.set(nonShallowSize); ``` -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org