Skip to content

IGNITE-29291 Fix wrong near cache values after an ATOMIC invokeAll with a write-through store leaves a key unchanged - #13829

Draft
rezataroosheh wants to merge 1 commit into
apache:masterfrom
rezataroosheh:IGNITE-29291
Draft

rezataroosheh wants to merge 1 commit into
apache:masterfrom
rezataroosheh:IGNITE-29291

Conversation

@rezataroosheh

Copy link
Copy Markdown
Contributor

JIRA: https://issues.apache.org/jira/browse/IGNITE-29291

Status

Draft. For now this PR only adds a test that reproduces the problem on master. The fix will follow.

Problem

For a request with several keys on a cache with a write-through store, the primary node uses GridDhtAtomicCache.updateWithBatch(). It collects the entries to write in a list and passes firstEntryIdx to updatePartialBatch(), which uses firstEntryIdx + i as the request index of the i-th entry. A key that is skipped without being added to the list (a read-only invoke, a value that fails validation, an update canceled by the interceptor) leaves a gap, so the following keys get the wrong request index. That index is used for the near cache values and skipped indexes sent back to the node that made the request, and for dhtUpdRes.processedEntriesCount().

Test

AtomicNearCacheInvokeAllWithStoreTest (added to IgniteCacheTestSuite10) starts a server and a client with a near cache. The client puts keys 1, 2, and 3, then calls invokeAll on them with an entry processor that sets each value to its key but leaves key 2 unchanged. The test checks the client's near cache.

Result on master: the test fails with
The unchanged key has a wrong value in the near cache expected:<-1> but was:<3>.
Also, the client fails with an AssertionError in GridNearAtomicCache.processNearAtomicUpdateResponse() (assert req.operation() != TRANSFORM), and the failure handler is called with CRITICAL_ERROR.

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)

… an ATOMIC invokeAll with a write-through store leaves a key unchanged
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.

1 participant