Skip to content

IGNITE-26630 Separate the stripe key from the cache partition - #13437

Merged
anton-vinogradov merged 5 commits into
apache:masterfrom
anton-vinogradov:ignite-26630
Aug 6, 2026
Merged

IGNITE-26630 Separate the stripe key from the cache partition#13437
anton-vinogradov merged 5 commits into
apache:masterfrom
anton-vinogradov:ignite-26630

Conversation

@anton-vinogradov

Copy link
Copy Markdown
Contributor

Step 1 of IGNITE-26630. No wire change: only method names move, no message field is touched.

Why

GridCacheMessage#partition() sounds like a data partition, but it is the key that picks a stripe. The name has already misled: the ticket asked to remove the method, and removing it would send every cache message from the striped pool to the plain system pool, because the base class returns -1 while "do not stripe" is Integer.MIN_VALUE. No functional test would notice.

What changed

A new StripedMessage interface, next to ExecutorAwareMessage and shaped like it:

public interface StripedMessage extends Message {
    public static final int ANY_STRIPE = -1;
    public static final int NO_STRIPE = Integer.MIN_VALUE;

    public int stripeIdx();
}

GridIoMessage loses its chain:

-    public int partition() {
-        if (msg instanceof GridCacheMessage)
-            return ((GridCacheMessage)msg).partition();
-        if (msg instanceof DataStreamerRequest)
-            return ((DataStreamerRequest)msg).partition();
-        else
-            return STRIPE_DISABLED_PART;
-    }
+    @Override public int stripeIdx() {
+        return msg instanceof StripedMessage ? ((StripedMessage)msg).stripeIdx() : NO_STRIPE;
+    }

STRIPE_DISABLED_PART moves into the interface as NO_STRIPE and stops being a boxed Integer, and the bare -1 literals become ANY_STRIPE.

Two classes where the name and the meaning did not match are now explicit:

  • GridCacheQueryRequest keeps partition() — that one really is the partition to scan, read in GridCacheDistributedQueryManager — and gets stripeIdx() alongside it.
  • GridNearAtomicCheckUpdateRequest loses partition(). The value it carries is the stripe of the update request, which the primary copies into the stripe of the response; the handler says so itself: "Message is processed in the same stripe".

What is deliberately left alone

The fields are still named part and partId, and so are the constructor parameters they feed. Step 2 of the ticket deletes those fields — six of them travel the wire only to pick a stripe and nothing reads them — so renaming them now would churn the generated serializers and their reference files for nothing.

Checks

  • the set of striped messages is unchanged: StripedMessage is implemented by GridCacheMessage and DataStreamerRequest, exactly the two arms of the old chain;
  • no message class was left with an orphaned partition() that silently stopped overriding anything — the only such method left is the intentional one in GridCacheQueryRequest;
  • IgniteCacheAtomicProtocolTest 26/26 with assertions enabled — this is the stripe-sensitive path, where the deferred response buffer is a ThreadLocal flushed back into its own stripe;
  • DataStreamerImplSelfTest, CacheScanQueryFailoverTest, GridCacheQueryTransformerSelfTest: 61 run, 0 failed;
  • full test-compile of all modules, and checkstyle under -Pcheckstyle.

GridCacheMessage#partition() picks a stripe, it is not a data partition.
Move it to a StripedMessage interface, name it stripeIdx(), and replace
the instanceof chain in GridIoMessage with that interface.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
anton-vinogradov and others added 2 commits August 5, 2026 20:06
Fix the order of a new static import, drop the dead setter left next to
the renamed getter.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@anton-vinogradov

anton-vinogradov commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

/runall


🚀 RunAll queuedbuild 9258046 · live progress & verdict: Ignite PR Checker. The verdict lands here when the run finishes.
🏁 Run finished — the verdict comment has the full story.

@anton-vinogradov

anton-vinogradov commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Ignite PR Checker verdict · RunAll build 9258046 · 147 suites ran, 0 reused

⚠️ This run doesn't cover the PR fully:

  • 1 suite(s) have no reliable result (compilation error, timeout, crash)

⚠️ 1 broken suite(s) (no reliable run):

  • Snapshots 6: JVM crash / out of memory · 1 failed test detected

🔎 No blockers found — but the run above can't prove the PR is clean. 18 pre-existing/flaky tests filtered out. Re-run once the above is sorted out.

♻️ Settled after 2 auto re-run wave(s): #1 — 3 blocker + 2 broken suite(s); #2 — 1 broken suite(s).

Comment thread modules/core/src/main/java/org/apache/ignite/internal/StripedMessage.java Outdated
# Conflicts:
#	modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerRequest.java
@anton-vinogradov

anton-vinogradov commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Ignite PR Checker verdict · RunAll build 9259924 · 147 suites ran, 0 reused

⚠️ This run doesn't cover the PR fully:

  • 1 suite(s) have no reliable result (compilation error, timeout, crash)

⚠️ 1 broken suite(s) (no reliable run):

  • [Check Code Style Ducktests]: non-zero exit code

🔎 No blockers found — but the run above can't prove the PR is clean. 22 pre-existing/flaky tests filtered out. Re-run once the above is sorted out.

♻️ Settled after 2 auto re-run wave(s): #1 — 1 broken suite(s); #2 — 1 broken suite(s).

@anton-vinogradov
anton-vinogradov merged commit 08a835b into apache:master Aug 6, 2026
5 of 7 checks passed
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Possible compatibility issues. Please, check rolling upgrade cases

This PR modifies protected classes (with Order annotation).
Changes to these classes can break rolling upgrade compatibility.

Affected files:

  • modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxFinishResponse.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareResponse.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicNearResponse.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicCheckUpdateRequest.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicFullUpdateRequest.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateRequest.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsAbstractMessage.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearSingleGetRequest.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishRequest.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryRequest.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerRequest.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants