Apache Ignite Deadlock Error on Continuous Select and Update Operations
- Dominant language
- Java
- Stars
- 5.1k
- Forks
- 1.9k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 46
Description
Hi team,
I am using Apache Ignite version 3.0.0 and have created a table with the following schema:
> CREATE TABLE INSTANT_CDR (
> MSISDN VARCHAR PRIMARY KEY,
> RECHARGE_AMOUNT DOUBLE,
> VOICE_AMOUNT DOUBLE,
> LAST_NAME VARCHAR,
> BALANCE DOUBLE
> );
>
I have a JDBC Java program that performs SELECT and UPDATE operations on the table. The select query is:
> SELECT * FROM INSTANT_CDR WHERE MSISDN='123456789'
And the update query is:
> UPDATE INSTANT_CDR SET RECHARGE_AMOUNT=RECHARGE_AMOUNT+1, VOICE_AMOUNT=VOICE_AMOUNT+1 WHERE MSISDN='123456789'
However, when I perform continuous inserts and updates on rows, I am encountering the following error on the Ignite side:
> Caused by: org.apache.ignite.internal.tx.LockException: IGN-TX-4 TraceId:b5f06ecc-1378-4315-96d9-e25d9ff70e6f Failed to acquire a lock due to a possible deadlock [locker=0195176a-f0ce-000b-e5f1-efe300000001, holder=0195176a-f0ce-000b-e5f1-efe300000001]
> at org.apache.ignite.internal.tx.impl.HeapLockManager.lockException(HeapLockManager.java:424)
> at org.apache.ignite.internal.tx.impl.HeapLockManager$LockState.isWaiterReadyToNotify(HeapLockManager.java:931)
> at org.apache.ignite.internal.tx.impl.HeapLockManager$LockState.tryAcquire(HeapLockManager.java:851)
> at org.apache.ignite.internal.tx.impl.HeapLockManager.acquire(HeapLockManager.java:216)
> ... 20 more
How does Apache Ignite handle concurrent SELECT and UPDATE operations? I am concerned about potential deadlocks due to continuous row updates and queries. Could anyone provide suggestions or configurations to resolve this issue and improve concurrent transaction handling in Ignite?
Thank you in advance
Contributor guide
Research direction
Start by reproducing the JDBC workload using the provided INSTANT_CDR schema and SELECT and UPDATE statements. Then inspect the reported path in org.apache.ignite.internal.tx.impl.HeapLockManager.java and determine whether the concurrent operations produce a reproducible deadlock; done means documenting the cause and a supported configuration or usage resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, sql
- Domain
- databases, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100