Cyrill commented on code in PR #7846:
URL: https://github.com/apache/ignite-3/pull/7846#discussion_r2980965258
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/SortedIndexLocker.java:
##########
@@ -206,6 +207,39 @@ private LockMode currentKeyLockMode(LockMode
nextKeyLockMode) {
public CompletableFuture<Void> locksForRemove(UUID txId, BinaryRow
tableRow, RowId rowId) {
BinaryTuple key = indexRowResolver.extractColumns(tableRow);
- return lockManager.acquire(txId, new LockKey(indexId,
key.byteBuffer()), LockMode.IX).thenApply(lock -> null);
+ return lockManager.acquire(txId, new LockKey(contextId,
key.byteBuffer()), LockMode.IX).thenApply(lock -> null);
+ }
+
+ /**
+ * Composite context ID for lock keys, that includes partition ID and
index ID.
+ */
+ public static class PartitionIndexId {
+ private final int partitionId;
+ private final int indexId;
+ private final int hash;
+
+ /**
+ * Constructor.
+ */
+ public PartitionIndexId(int partitionId, int indexId) {
+ this.partitionId = partitionId;
+ this.indexId = indexId;
+ this.hash = IgniteUtils.hash(65535 * partitionId + indexId);
+ }
+
+ @Override
+ public boolean equals(Object o) {
Review Comment:
missing this==o check
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]