ndb -

  Add abort in reception of invalid/inconsistent SUB_GCP_COMPLETE_REP
  as proceeding (in release wo/ asserts) make mysqld crash in mysterious ways
parent b498da87
...@@ -1279,6 +1279,23 @@ find_bucket(Vector<Gci_container> * active, Uint64 gci) ...@@ -1279,6 +1279,23 @@ find_bucket(Vector<Gci_container> * active, Uint64 gci)
return find_bucket_chained(active,gci); return find_bucket_chained(active,gci);
} }
static
void
crash_on_invalid_SUB_GCP_COMPLETE_REP(const Gci_container* bucket,
const SubGcpCompleteRep * const rep,
Uint32 nodes)
{
Uint32 old_cnt = bucket->m_gcp_complete_rep_count;
ndbout_c("INVALID SUB_GCP_COMPLETE_REP");
ndbout_c("gci: %d", rep->gci);
ndbout_c("sender: %x", rep->senderRef);
ndbout_c("count: %d", rep->gcp_complete_rep_count);
ndbout_c("bucket count: %u", old_cnt);
ndbout_c("nodes: %u", nodes);
abort();
}
void void
NdbEventBuffer::execSUB_GCP_COMPLETE_REP(const SubGcpCompleteRep * const rep) NdbEventBuffer::execSUB_GCP_COMPLETE_REP(const SubGcpCompleteRep * const rep)
{ {
...@@ -1317,9 +1334,13 @@ NdbEventBuffer::execSUB_GCP_COMPLETE_REP(const SubGcpCompleteRep * const rep) ...@@ -1317,9 +1334,13 @@ NdbEventBuffer::execSUB_GCP_COMPLETE_REP(const SubGcpCompleteRep * const rep)
old_cnt = m_system_nodes; old_cnt = m_system_nodes;
} }
assert(old_cnt >= cnt); //assert(old_cnt >= cnt);
if (unlikely(! (old_cnt >= cnt)))
{
crash_on_invalid_SUB_GCP_COMPLETE_REP(bucket, rep, m_system_nodes);
}
bucket->m_gcp_complete_rep_count = old_cnt - cnt; bucket->m_gcp_complete_rep_count = old_cnt - cnt;
if(old_cnt == cnt) if(old_cnt == cnt)
{ {
if(likely(gci == m_latestGCI + 1 || m_latestGCI == 0)) if(likely(gci == m_latestGCI + 1 || m_latestGCI == 0))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment