summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomas@poseidon.ndb.mysql.com <>2006-05-10 13:33:17 +0200
committertomas@poseidon.ndb.mysql.com <>2006-05-10 13:33:17 +0200
commite17a28ed5097bb6f9145ba3a3458b212fa6699c6 (patch)
treef5353c29239bc55fe2e44076cdd3bcd5ff4bc39c
parent30c569f8fe2923d6018896890de2b6404c113739 (diff)
downloadmariadb-git-e17a28ed5097bb6f9145ba3a3458b212fa6699c6.tar.gz
ndb: fix assertion code in event code during cluster shutdown
-rw-r--r--storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp44
1 files changed, 27 insertions, 17 deletions
diff --git a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
index 68a73115644..628ad5d925f 100644
--- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
+++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
@@ -1519,31 +1519,19 @@ NdbEventBuffer::completeClusterFailed()
{
NdbEventOperationImpl* impl= &op->m_impl;
data.senderData = impl->m_oid;
- insertDataL(impl, &data, ptr);
+ insertDataL(impl, &data, ptr);
} while((op = m_ndb->getEventOperation(op)));
/**
- * Find min not completed GCI
+ * Release all GCI's with m_gci > gci
*/
Uint32 i;
Uint32 sz= m_active_gci.size();
- Uint64 gci= ~0;
+ Uint64 gci= data.gci;
Gci_container* bucket = 0;
Gci_container* array = (Gci_container*)m_active_gci.getBase();
for(i = 0; i < sz; i++)
{
- if(array[i].m_gcp_complete_rep_count && array[i].m_gci < gci)
- {
- bucket= array + i;
- gci = bucket->m_gci;
- }
- }
-
- /**
- * Release all GCI's with m_gci > gci
- */
- for(i = 0; i < sz; i++)
- {
Gci_container* tmp = array + i;
if (tmp->m_gci > gci)
{
@@ -1554,9 +1542,31 @@ NdbEventBuffer::completeClusterFailed()
tmp->~Gci_container();
bzero(tmp, sizeof(Gci_container));
}
+ else if (tmp->m_gcp_complete_rep_count)
+ {
+ if (tmp->m_gci == gci)
+ {
+ bucket= tmp;
+ continue;
+ }
+ // we have found an old not-completed gci
+ // something is wrong, assert in debug, but try so salvage
+ // in release
+ ndbout_c("out of order bucket detected at cluster disconnect, "
+ "data.gci: %u. tmp->m_gci: %u",
+ (unsigned)data.gci, (unsigned)tmp->m_gci);
+ assert(false);
+ if(!tmp->m_data.is_empty())
+ {
+ free_list(tmp->m_data);
+ }
+ tmp->~Gci_container();
+ bzero(tmp, sizeof(Gci_container));
+ }
}
-
- assert(bucket != 0 && data.gci == gci);
+
+ assert(bucket != 0);
+
const Uint32 cnt= bucket->m_gcp_complete_rep_count = 1;
bucket->m_gci = gci;
bucket->m_gcp_complete_rep_count = cnt;