A deadlock was observed in HA after running the BSBM 100M UPDATE mixture for several hours. The deadlock is related to the release time consensus protocol for HA. However, the deadlock is also the cause of a known hot spot for the standalone deployment model.
The following method
DefaultResourceLocator.locateResourceOn(final IIndexManager indexManager,final String namespace, final long timestamp)
to obtain the commitTime corresponding to the timestamp. This latter method is a hot spot since it requires the field read/write lock for the AbstractJournal and access to the CommitRecordIndex must be mutex for readers and mutation (concurrent readers are allow). However, this method is invoked most commonly using a read-only tx, and this is in fact true for the observed deadlock since the resource is being located for a QUERY as shown by the following stack traces:
This thread was blocked on AbstractJournal.fieldReadWriteLock while holding the NamedLock in DefaultResourceLocator.
New read-only queries (such as the following trace) were unable to start since the NamedLock was held by the thread above:
The HA commit protocol was causing the deadlock by (a):
Also, new UPDATEs could not run since the monitor for the unisolated view of the LocalTripleStore was held by the thread requesting the commit (which is shown immediately above):
Looking at the followers, I see the 2nd follower at
and the first follower is not running a GatherTask at all.
This last observation leads me to wonder if the problem had to do with a non-atomic decision concerning the #of parties that would participate in the release time consensus protocol or if the code that was running on the HA3 cluster was not monitoring the quorum state for a quorum break or service leave.
Thus, I think that this issue was misdiagnosed. The problem is that new transaction starts are blocking on getCommitRecordIndex() in the DefaultResourceLocator during the commitNow(). However, that contention can be removed by using the LocalTransactionManager to resolve the ITx for the timestamp and then the readsOnCommitTime from the ITx. This should increase query throughput (on the leader) with concurrent UPDATEs on the leader.
See https://sourceforge.net/apps/trac/bigdata/ticket/673 (DGC in release time consensus protocol causes native thread leak in HAJournalServer at each commit)