[
https://issues.apache.org/jira/browse/IGNITE-23584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17894808#comment-17894808
]
Vladimir Steshin commented on IGNITE-23584:
-------------------------------------------
[~zstan], thanks for notifying. Actually, the previous code worked correctly.
But it looked really confusing. We decided to improve the semantics.
> Snapshot. Fix logic of the quick snapshot handler.
> --------------------------------------------------
>
> Key: IGNITE-23584
> URL: https://issues.apache.org/jira/browse/IGNITE-23584
> Project: Ignite
> Issue Type: Improvement
> Affects Versions: 2.14
> Reporter: Vladimir Steshin
> Assignee: Vladimir Steshin
> Priority: Trivial
> Fix For: 2.17
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> _SnapshotPartitionsQuickVerifyHandler_ looks confusing. It continues checking
> partitions even if detects the `no-need-to-work` condition and then skips the
> collected results. We should not do any checks is the streamer warning is
> detected.
> {code:java}
> for (SnapshotHandlerResult<Map<PartitionKeyV2, PartitionHashRecordV2>> result
> : results) {
> if (result.error() != null)
> throw new IgniteCheckedException(result.error());
> if (result.data() == null) {
> noData = true;
> continue;
> }
> Map<PartitionKeyV2, PartitionHashRecordV2> partsData =
> result.data();
> partsData.forEach((part, val) -> {
> PartitionHashRecordV2 other = total.putIfAbsent(part, val);
> if ((other != null && !wrnGrps.contains(part.groupId()))
> && ((!val.hasExpiringEntries() &&
> !other.hasExpiringEntries() && val.size() != other.size())
> || !Objects.equals(val.updateCounter(),
> other.updateCounter())))
> wrnGrps.add(part.groupId());
> });
> }
> if (noData)
> return;
> if (!wrnGrps.isEmpty()) {
> throw new SnapshotWarningException("Cache partitions differ for
> cache groups " +
> S.toStringSortedDistinct(wrnGrps) + ". " + WRN_MSG);
> }
> {code}
> Looks wierd.
> {code:java}
> if (noData)
> return;
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)