From 21cce7f4186c1eb6528c60a25ee70d2b053b4228 Mon Sep 17 00:00:00 2001 From: Vinoth Veeraraghavan Date: Sat, 10 Oct 2020 17:14:35 +0800 Subject: [PATCH] Fix core dump in MOT stress test --- .../storage/mot/core/src/system/transaction/txn.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gausskernel/storage/mot/core/src/system/transaction/txn.cpp b/src/gausskernel/storage/mot/core/src/system/transaction/txn.cpp index f5f47c3a6..0dd79c703 100644 --- a/src/gausskernel/storage/mot/core/src/system/transaction/txn.cpp +++ b/src/gausskernel/storage/mot/core/src/system/transaction/txn.cpp @@ -1111,6 +1111,13 @@ RC TxnManager::TruncateTable(Table* table) } } + // clean all GC elements for the table, this call should actually release + // all elements into an appropriate object pool + for (uint16_t i = 0; i < table->GetNumIndexes(); i++) { + MOT::Index* index = table->GetIndex(i); + GcManager::ClearIndexElements(index->GetIndexId(), false); + } + TxnDDLAccess::DDLAccess* ddl_access = m_txnDdlAccess->GetByOid(table->GetTableExId()); if (ddl_access == nullptr) { MOTIndexArr* indexesArr = nullptr;