Tuesday, February 2, 2016

2009806 - Deadlock during DML and JoinQueries

Symptom
Long running / hanging DML statements in combination with statements using joins (same table)


Other Terms
SAP HANA, deadlock, hanging situation, lock


Reason and Prerequisites
HANA Database on Revision 70-73, parallel DML statements and queries using joins on the same table, join queries are executed the first time on the table
Explanation:
When queries with joins are executed for the first time on a table, join statistics are created. Due to a programming error, the creation of such join statistics can lead to a deadlock if at the same time DML activities are running on the table. If you collect a runtimedump you should see threads with similiar call stacks as follows (not necessarily all):
1.
syscall+0x15 (libc.so.6)
Synchronization::ReadWriteLock::timedWaitLockExclusive
AttributeEngine::BtreeAttribute::GuardContainerWrite::acquire
AttributeEngine::BTreeAttribute<TrexTypes::StringAttributeValue>::jeUpdateValidMapping
AttributeEngine::AttributeApi::jeOpenAttributeUpdateValidMapping
AttributeEngine::AttributeApi::jeSearchValueIdCounts
TRexAPI::DeltaIndexManager::jeSearchValueIdCounts
TRexAPI::JERequestHandler::do_getValueIdCounts
TRexAPI::JERequestHandler::getValueIdCounts
TRexAPI::JERequestHandler::do_getJoinStatistic
2.
syscall+0x15
Synchronization::ReadWriteLock::timedWaitLockSharedLL
Synchronization::ReadWriteLock::lockShared
AttributeEngine::BtreeAttribute::GuardContainerLocks::acquireRead
AttributeEngine::BtreeAttribute::GuardContainerRead::GuardContainerRead
AttributeEngine::BTreeAttribute<TrexTypes::StringAttributeValue>::jeSearchValueIdCounts
AttributeEngine::AttributeApi::jeSearchValueIdCounts
TRexAPI::DeltaIndexManager::jeSearchValueIdCounts
TRexAPI::JERequestHandler::do_getValueIdCounts
TRexAPI::JERequestHandler::getValueIdCounts
TRexAPI::JERequestHandler::do_getJoinStatistic
3.
Synchronization::ReadWriteLock::timedWaitLockSharedLL
Synchronization::ReadWriteLock::lockShared
Synchronization::LockHandleCreator<Synchronization::SharedLock>::lockHandle
AttributeEngine::SingleAttribute<TrexTypes::FixedAttributeValue8, AttributeEngine::ValueDict<TrexTypes::FixedAttributeValue8> >::getStatistics
AttributeEngine::BTreeAttribute<TrexTypes::FixedAttributeValue8>::jeUpdateValidMapping
AttributeEngine::AttributeApi::jeOpenAttributeUpdateValidMapping
AttributeEngine::AttributeApi::jeSearchValueIdCounts
TRexAPI::DeltaIndexManager::jeSearchValueIdCounts
TRexAPI::JERequestHandler::do_getJoinStatistic
4.
Synchronization::ReadWriteLock::timedWaitLockExclusive
AttributeEngine::BtreeAttribute::GuardContainerWrite::acquire
AttributeEngine::BTreeAttribute<TrexTypes::FixedAttributeValue8>::jeUpdateValidMapping
AttributeEngine::SingleAttribute<TrexTypes::FixedAttributeValue8, AttributeEngine::ValueDict<TrexTypes::FixedAttributeValue8> >::mainTwoDeltasIterator
AttributeEngine::AttributeApi::jeCreateTranslator
TRexAPI::DeltaIndexManager::jeCreateTranslator
JoinEvaluator::JoinEvaluator::createTranslationVector
JoinEvaluator::JoinEvaluator::createTranslationTable
TRexAPI::JERequestHandler::do_getJoinStatistic


Solution
The issue is fixed with revision 74.
As a workaround, you can execute the join queries before doing any DML activity on the table.



Header Data

Released On 25.04.2014 10:14:40
Release Status Released for Customer
Component HAN-DB SAP HANA Database
Priority Correction with medium priority
Category Program error

No comments:

Post a Comment