[infinispan-issues] [JBoss JIRA] (ISPN-11102) Purge on JDBC shared stores can cause deadlocks
Ryan Emerson (Jira)
issues at jboss.org
Wed Dec 18 04:42:14 EST 2019
Ryan Emerson created ISPN-11102:
-----------------------------------
Summary: Purge on JDBC shared stores can cause deadlocks
Key: ISPN-11102
URL: https://issues.redhat.com/browse/ISPN-11102
Project: Infinispan
Issue Type: Bug
Components: Loaders and Stores
Affects Versions: 9.4.17.Final, 10.1.0.CR1
Reporter: Ryan Emerson
Assignee: Ryan Emerson
Fix For: 10.1.0.Final, 9.4.18.Final
ISPN-10337 ensured that the JdbcStringBasedStore correctly acquired the locks of expired rows during the purging of store entries, however it has exposed an issue with shared stores. When the jdbc store is shared, the coordinator locks the rows of the affected entries and releases them once they have all been removed as part of the purge transaction. However, the call to {{ExpirationManager::handleInStoreExpiration}} also sends a {{RemoveExpiredCommand}} to ensure that entries are removed from memory. This results in a {{java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction}} being thrown by the store's delete method when the purge process is still in progress, because the expired rows are still locked and the purge process cannot complete until the {{RemoveExpiredCommand}} has been executed.
In summary:
# purge locks all the rows
# purge sends a RemoveExpiredCommand and waits for it to complete
# RemoveExpiredCommand tries to remove the row but it can't as it is locked
Solution, send the {{RemoveExpiredCommand}} with the {{SKIP_CACHE_STORE}} flag when a store is shared,so that it only removes entries from memory.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the infinispan-issues
mailing list