Skip to content

IGNITE-28869 Fix IgniteWalRebalanceTest.testRebalanceCancelOnSupplyError#13323

Merged
anton-vinogradov merged 8 commits into
apache:masterfrom
wernerdv:fix_IgniteWalRebalanceTest
Jul 8, 2026
Merged

IGNITE-28869 Fix IgniteWalRebalanceTest.testRebalanceCancelOnSupplyError#13323
anton-vinogradov merged 8 commits into
apache:masterfrom
wernerdv:fix_IgniteWalRebalanceTest

Conversation

@wernerdv

@wernerdv wernerdv commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Thank you for submitting the pull request to the Apache Ignite.

In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:

The Contribution Checklist

  • There is a single JIRA ticket related to the pull request.
  • The web-link to the pull request is attached to the JIRA ticket.
  • The JIRA ticket has the Patch Available state.
  • The pull request body describes changes that have been made.
    The description explains WHAT and WHY was made instead of HOW.
  • The pull request title is treated as the final commit message.
    The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • A reviewer has been mentioned through the JIRA comments
    (see the Maintainers list)
  • The pull request has been checked by the Teamcity Bot and
    the green visa attached to the JIRA ticket (see tab PR Check at TC.Bot - Instance 1 or TC.Bot - Instance 2)

Notes

If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.

@wernerdv wernerdv changed the title Debug IgniteWalRebalanceTest.testRebalanceCancelOnSupplyError IGNITE-28869 Fix IgniteWalRebalanceTest.testRebalanceCancelOnSupplyError Jul 7, 2026

@anton-vinogradov anton-vinogradov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed both the diagnosis and the fix — the root cause and the approach look correct. I traced it end to end:

  • A cache version's topVer field is readyTopologyVersion + offset (GridCacheVersionManager.next(topVer)), where offset = (gridStartTime - TOP_VER_BASE_TIME) / 1000 (seconds), captured in onLocalJoin.
  • GridCacheVersion.compareTo compares topologyVersion() first, so offset dominates the reset readyTopologyVersion.
  • The failing assertion is ATOMIC_VER_COMPARATOR.compare(entry.ver, newVer) <= 0 in GridCacheMapEntry (Invalid version for inner update), i.e. the new write's version must be >= the recovered entry's version.

On a fast full-cluster restart gridStartTime advances by less than the topology-version reset, so the new writes get a strictly lower topVer and trip the assertion. The pause is placed correctly — before startGrid(0), since offset is captured at node-0 join — and makes the new offset exceed the old one by ~5, which comfortably covers the ~2 topology-version gap (3-node+activate vs 1-node+activate). cleanPersistenceDir() runs per test, so the gap is intra-test only and the margin is large; the fix is deterministic (wall clock only moves forward), not a new source of flakiness. LGTM.

One optional nit: the 5s constant is implicitly tied to the topology this test builds. It's fine today, but worth spelling out the rationale so a future change to the started-grid count doesn't silently shrink the margin — inline suggestion below.

Also worth attaching the TC Bot green visa to the ticket before merge.

@anton-vinogradov anton-vinogradov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that the PR carries the deterministic version, two comment-only nits on the newly added comments (no code changes, both optional).

Co-authored-by: Anton Vinogradov <av@apache.org>
@ignitetcbot

Copy link
Copy Markdown
Contributor

TCBot Test Analysis

Possible Blockers (0)

No blockers found.

New Tests (0)

No new tests found.

@anton-vinogradov anton-vinogradov merged commit 1006f74 into apache:master Jul 8, 2026
1 check passed
@wernerdv wernerdv deleted the fix_IgniteWalRebalanceTest branch July 8, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants