Skip to content

IGNITE-28727 Create internal API method to lock cache entry with specific version#13264

Merged
vldpyatkov merged 5 commits into
apache:masterfrom
vldpyatkov:ignite-28727
Jun 30, 2026
Merged

IGNITE-28727 Create internal API method to lock cache entry with specific version#13264
vldpyatkov merged 5 commits into
apache:masterfrom
vldpyatkov:ignite-28727

Conversation

@vldpyatkov

@vldpyatkov vldpyatkov commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

@vldpyatkov vldpyatkov force-pushed the ignite-28727 branch 4 times, most recently from 63cf3ce to 7284112 Compare June 25, 2026 14:33
@tkalkirill tkalkirill changed the title IGNITE-28727 IGNITE-28727 Create internal API method to lock cache entry with specific version Jun 26, 2026

@tkalkirill tkalkirill 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.

A few additional general comments:

  1. Please add tests where a lock is acquired via the new API in one transaction and an attempt is made to acquire it via the new API in another; cover both distinct keys and the same key. It would be great to test this with both single-threaded and multi-threaded scenarios.
  2. I didn't see a test checking what happens if the new API is called outside of a pessimistic transaction.
  3. I didn't see a test checking the behavior regarding lock acquisition after the transaction has completed.
    4.waitTimeoutExpiresFirst should be moved to a shared location so there is only one instance of it, accompanied by a clear comment.

@vldpyatkov

vldpyatkov commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

About the text comment above:

  1. Added a test: LockTxEntryOneNodeTest#testLockTxEntryReturnsFalseForLockedKeyAndTrueForOtherKey
  2. It is there: LockTxEntryOneNodeTest#testLockTxEntryAsyncFailsInOptimisticTransaction
  3. It is here: LockTxEntryOneNodeTest#testLockTxEntryFailsWithoutTransaction
  4. Did it.

@github-actions

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/processors/cache/distributed/near/GridNearLockRequest.java
  • modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockResponse.java

@vldpyatkov vldpyatkov merged commit a3d3d8b into apache:master Jun 30, 2026
6 of 7 checks passed
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