You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Vladislav Pyatkov (Jira)" <ji...@apache.org> on 2025/01/22 20:32:00 UTC
[jira] [Comment Edited] (IGNITE-24267) Heap lock manager behave incorrectly in case of overflow
[ https://issues.apache.org/jira/browse/IGNITE-24267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17916183#comment-17916183 ]
Vladislav Pyatkov edited comment on IGNITE-24267 at 1/22/25 8:31 PM:
---------------------------------------------------------------------
The new lock manager implementation does not influence the performance.
{noformat}
Benchmark (batch) (fsync) (lockSlots) (partitionCount) (useLocks) Mode Cnt Score Error Units
UpsertKvBenchmark.upsert 1 false 1048576 32 OldLockMng thrpt 20 150041.899 ± 13120.569 ops/s
UpsertKvBenchmark.upsert 1 false 1048576 32 NewLockMng thrpt 20 150748.023 ± 19264.800 ops/s
UpsertKvBenchmark.upsert 1 false 131072 32 OldLockMng thrpt 20 155406.419 ± 14196.133 ops/s
UpsertKvBenchmark.upsert 1 false 131072 32 NewLockMng thrpt 20 155054.783 ± 14608.008 ops/s
UpsertKvBenchmark.upsert 1 false 1024 32 OldLockMng thrpt 20 157328.309 ± 14838.297 ops/s
UpsertKvBenchmark.upsert 1 false 1024 32 NewLockMng thrpt 20 155993.345 ± 15001.843 ops/s
{noformat}
was (Author: v.pyatkov):
The new lock manager implementation does not influence the performance.
{noforamt}
Benchmark (batch) (fsync) (lockSlots) (partitionCount) (useLocks) Mode Cnt Score Error Units
UpsertKvBenchmark.upsert 1 false 1048576 32 OldLockMng thrpt 20 150041.899 ± 13120.569 ops/s
UpsertKvBenchmark.upsert 1 false 1048576 32 NewLockMng thrpt 20 150748.023 ± 19264.800 ops/s
UpsertKvBenchmark.upsert 1 false 131072 32 OldLockMng thrpt 20 155406.419 ± 14196.133 ops/s
UpsertKvBenchmark.upsert 1 false 131072 32 NewLockMng thrpt 20 155054.783 ± 14608.008 ops/s
UpsertKvBenchmark.upsert 1 false 1024 32 OldLockMng thrpt 20 157328.309 ± 14838.297 ops/s
UpsertKvBenchmark.upsert 1 false 1024 32 NewLockMng thrpt 20 155993.345 ± 15001.843 ops/s
{noformat}
> Heap lock manager behave incorrectly in case of overflow
> --------------------------------------------------------
>
> Key: IGNITE-24267
> URL: https://issues.apache.org/jira/browse/IGNITE-24267
> Project: Ignite
> Issue Type: Improvement
> Reporter: Vladislav Pyatkov
> Assignee: Vladislav Pyatkov
> Priority: Major
> Labels: ignite-3
> Time Spent: 10m
> Remaining Estimate: 0h
>
> h3. Motivation
> This is a test that demonstrates the misbehavior of current lock manager implementation:
> {code}
> @Test
> public void testCollision() throws Exception {
> int maxSlots = 16;
> HeapLockManager lockManager = new HeapLockManager(maxSlots, maxSlots);
> lockManager.start(new WaitDieDeadlockPreventionPolicy());
> UUID[] txs = new UUID[maxSlots];
> for (int i = 0; i < maxSlots; i++) {
> txs[i] = TestTransactionIds.newTransactionId();
> lockManager.acquire(txs[i], new LockKey(txs[i], txs[i]), LockMode.S).get();
> }
> UUID collisionTx = TestTransactionIds.newTransactionId();
> lockManager.acquire(collisionTx, new LockKey(collisionTx, collisionTx), LockMode.S).get();
> int collisionSlot = -1;
> for (int i = 0; i < maxSlots; i++) {
> if (lockManager.queue(new LockKey(txs[i], txs[i])).size() == 2) {
> collisionSlot = i;
> } else {
> lockManager.releaseAll(txs[i]);
> }
> }
> assertTrue(collisionSlot >= 0, "Collision slot was not found.");
> UUID otherTx = TestTransactionIds.newTransactionId();
> CompletableFuture<Lock> xLockFut = lockManager.acquire(otherTx, new LockKey(collisionTx, collisionTx), LockMode.X);
> assertThrows(ExecutionException.class, xLockFut::get, "Failed to acquire a lock due to a possible deadlock");
> lockManager.releaseAll(txs[collisionSlot]);
> lockManager.releaseAll(collisionTx);
> lockManager.releaseAll(otherTx);
> assertTrue(lockManager.isEmpty());
> }
> {code}
> h3. Definition of done
> We have to forbid using conflicted locks on one key, even if it would lead to throwing an exception on the overflow lock table.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)