diff options
author | unknown <jonas@perch.ndb.mysql.com> | 2006-10-12 14:02:48 +0200 |
---|---|---|
committer | unknown <jonas@perch.ndb.mysql.com> | 2006-10-12 14:02:48 +0200 |
commit | 855c4e063d8c81ad3136f58df7a75bd37eca22dc (patch) | |
tree | f2c12ac0010d1d237f16c1abd796939b4b1154db /ndb | |
parent | 311abf108bcc9fff9aff1a9e176ac667014019e9 (diff) | |
download | mariadb-git-855c4e063d8c81ad3136f58df7a75bd37eca22dc.tar.gz |
ndb - bug#23210
Fix race-condition between COPY_GCIREQ (GCP) and lcpSetActiveStatusEnd
Solution is _not_ to copy sysfileData from COPY_GCIREQ from "self"
ndb/src/kernel/blocks/ERROR_codes.txt:
Add error insert for dealying of copy sysfileData
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
1) Add error insert for delaying of sysfileData
2) Change to that master is _not_ copying sysfileData from COPY_GCIREQ
as it might be updating it while COPY_GCIREQ is "in the fly"
Diffstat (limited to 'ndb')
-rw-r--r-- | ndb/src/kernel/blocks/ERROR_codes.txt | 4 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 38 |
2 files changed, 35 insertions, 7 deletions
diff --git a/ndb/src/kernel/blocks/ERROR_codes.txt b/ndb/src/kernel/blocks/ERROR_codes.txt index d6dfcfe8587..874c128a56d 100644 --- a/ndb/src/kernel/blocks/ERROR_codes.txt +++ b/ndb/src/kernel/blocks/ERROR_codes.txt @@ -5,7 +5,7 @@ Next DBACC 3002 Next DBTUP 4014 Next DBLQH 5043 Next DBDICT 6006 -Next DBDIH 7174 +Next DBDIH 7178 Next DBTC 8038 Next CMVMI 9000 Next BACKUP 10022 @@ -66,6 +66,8 @@ Delay GCP_SAVEREQ by 10 secs 7030: Delay in GCP_PREPARE until node has completed a node failure 7031: Delay in GCP_PREPARE and die 3s later +7177: Delay copying of sysfileData in execCOPY_GCIREQ + ERROR CODES FOR TESTING NODE FAILURE, LOCAL CHECKPOINT HANDLING: ----------------------------------------------------------------- diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index 7ae7db967b2..fcb9b0fbb60 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -626,22 +626,48 @@ void Dbdih::execCOPY_GCIREQ(Signal* signal) ndbrequire(c_copyGCISlave.m_copyReason == CopyGCIReq::IDLE); ndbrequire(c_copyGCISlave.m_expectedNextWord == tstart); ndbrequire(reason != CopyGCIReq::IDLE); - + bool isdone = (tstart + CopyGCIReq::DATA_SIZE) >= Sysfile::SYSFILE_SIZE32; + + if (ERROR_INSERTED(7177)) + { + jam(); + + if (signal->getLength() == 3) + { + jam(); + goto done; + } + } + arrGuard(tstart + CopyGCIReq::DATA_SIZE, sizeof(sysfileData)/4); for(Uint32 i = 0; i<CopyGCIReq::DATA_SIZE; i++) cdata[tstart+i] = copyGCI->data[i]; - if ((tstart + CopyGCIReq::DATA_SIZE) >= Sysfile::SYSFILE_SIZE32) { + if (ERROR_INSERTED(7177) && isMaster() && isdone) + { + sendSignalWithDelay(reference(), GSN_COPY_GCIREQ, signal, 1000, 3); + return; + } + +done: + if (isdone) + { jam(); c_copyGCISlave.m_expectedNextWord = 0; - } else { + } + else + { jam(); c_copyGCISlave.m_expectedNextWord += CopyGCIReq::DATA_SIZE; return; - }//if - - memcpy(sysfileData, cdata, sizeof(sysfileData)); + } + if (cmasterdihref != reference()) + { + jam(); + memcpy(sysfileData, cdata, sizeof(sysfileData)); + } + c_copyGCISlave.m_copyReason = reason; c_copyGCISlave.m_senderRef = signal->senderBlockRef(); c_copyGCISlave.m_senderData = copyGCI->anyData; |