Commit 2b0c9d8b authored by unknown's avatar unknown

Bug #20142 show engine ndb status may falsely return latest epoch == 0

parent e1dfae74
...@@ -56,7 +56,6 @@ ...@@ -56,7 +56,6 @@
DBUG_RETURN(b);\ DBUG_RETURN(b);\
} }
extern Uint64 g_latest_trans_gci;
int ndb_dictionary_is_mysqld = 0; int ndb_dictionary_is_mysqld = 0;
bool bool
...@@ -4226,7 +4225,6 @@ NdbDictInterface::execWAIT_GCP_CONF(NdbApiSignal* signal, ...@@ -4226,7 +4225,6 @@ NdbDictInterface::execWAIT_GCP_CONF(NdbApiSignal* signal,
{ {
const WaitGCPConf * const conf= const WaitGCPConf * const conf=
CAST_CONSTPTR(WaitGCPConf, signal->getDataPtr()); CAST_CONSTPTR(WaitGCPConf, signal->getDataPtr());
g_latest_trans_gci= conf->gcp;
m_waiter.signal(NO_WAIT); m_waiter.signal(NO_WAIT);
} }
......
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
#include <signaldata/TcKeyFailConf.hpp> #include <signaldata/TcKeyFailConf.hpp>
#include <signaldata/TcHbRep.hpp> #include <signaldata/TcHbRep.hpp>
Uint64 g_latest_trans_gci = 0;
/***************************************************************************** /*****************************************************************************
NdbTransaction( Ndb* aNdb ); NdbTransaction( Ndb* aNdb );
...@@ -1568,6 +1570,9 @@ NdbTransaction::receiveTC_COMMITCONF(const TcCommitConf * commitConf) ...@@ -1568,6 +1570,9 @@ NdbTransaction::receiveTC_COMMITCONF(const TcCommitConf * commitConf)
theCommitStatus = Committed; theCommitStatus = Committed;
theCompletionStatus = CompletedSuccess; theCompletionStatus = CompletedSuccess;
theGlobalCheckpointId = commitConf->gci; theGlobalCheckpointId = commitConf->gci;
// theGlobalCheckpointId == 0 if NoOp transaction
if (theGlobalCheckpointId)
g_latest_trans_gci = theGlobalCheckpointId;
return 0; return 0;
} else { } else {
#ifdef NDB_NO_DROPPED_SIGNAL #ifdef NDB_NO_DROPPED_SIGNAL
...@@ -1746,6 +1751,8 @@ from other transactions. ...@@ -1746,6 +1751,8 @@ from other transactions.
if (tCommitFlag == 1) { if (tCommitFlag == 1) {
theCommitStatus = Committed; theCommitStatus = Committed;
theGlobalCheckpointId = tGCI; theGlobalCheckpointId = tGCI;
assert(tGCI);
g_latest_trans_gci = tGCI;
} else if ((tNoComp >= tNoSent) && } else if ((tNoComp >= tNoSent) &&
(theLastExecOpInList->theCommitIndicator == 1)){ (theLastExecOpInList->theCommitIndicator == 1)){
...@@ -1922,6 +1929,8 @@ NdbTransaction::receiveTCINDXCONF(const TcIndxConf * indxConf, ...@@ -1922,6 +1929,8 @@ NdbTransaction::receiveTCINDXCONF(const TcIndxConf * indxConf,
if (tCommitFlag == 1) { if (tCommitFlag == 1) {
theCommitStatus = Committed; theCommitStatus = Committed;
theGlobalCheckpointId = tGCI; theGlobalCheckpointId = tGCI;
assert(tGCI);
g_latest_trans_gci = tGCI;
} else if ((tNoComp >= tNoSent) && } else if ((tNoComp >= tNoSent) &&
(theLastExecOpInList->theCommitIndicator == 1)){ (theLastExecOpInList->theCommitIndicator == 1)){
/**********************************************************************/ /**********************************************************************/
......
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
#include <EventLogger.hpp> #include <EventLogger.hpp>
extern EventLogger g_eventLogger; extern EventLogger g_eventLogger;
Uint64 g_latest_trans_gci= 0;
/****************************************************************************** /******************************************************************************
* int init( int aNrOfCon, int aNrOfOp ); * int init( int aNrOfCon, int aNrOfOp );
...@@ -367,7 +366,6 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) ...@@ -367,7 +366,6 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
tCon = void2con(tFirstDataPtr); tCon = void2con(tFirstDataPtr);
if ((tCon->checkMagicNumber() == 0) && if ((tCon->checkMagicNumber() == 0) &&
(tCon->theSendStatus == NdbTransaction::sendTC_OP)) { (tCon->theSendStatus == NdbTransaction::sendTC_OP)) {
g_latest_trans_gci= keyConf->gci;
tReturnCode = tCon->receiveTCKEYCONF(keyConf, tLen); tReturnCode = tCon->receiveTCKEYCONF(keyConf, tLen);
if (tReturnCode != -1) { if (tReturnCode != -1) {
completedTransaction(tCon); completedTransaction(tCon);
...@@ -520,7 +518,6 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) ...@@ -520,7 +518,6 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
tCon = void2con(tFirstDataPtr); tCon = void2con(tFirstDataPtr);
if ((tCon->checkMagicNumber() == 0) && if ((tCon->checkMagicNumber() == 0) &&
(tCon->theSendStatus == NdbTransaction::sendTC_COMMIT)) { (tCon->theSendStatus == NdbTransaction::sendTC_COMMIT)) {
g_latest_trans_gci= commitConf->gci;
tReturnCode = tCon->receiveTC_COMMITCONF(commitConf); tReturnCode = tCon->receiveTC_COMMITCONF(commitConf);
if (tReturnCode != -1) { if (tReturnCode != -1) {
completedTransaction(tCon); completedTransaction(tCon);
...@@ -855,7 +852,6 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) ...@@ -855,7 +852,6 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
tCon = void2con(tFirstDataPtr); tCon = void2con(tFirstDataPtr);
if ((tCon->checkMagicNumber() == 0) && if ((tCon->checkMagicNumber() == 0) &&
(tCon->theSendStatus == NdbTransaction::sendTC_OP)) { (tCon->theSendStatus == NdbTransaction::sendTC_OP)) {
g_latest_trans_gci= indxConf->gci;
tReturnCode = tCon->receiveTCINDXCONF(indxConf, tLen); tReturnCode = tCon->receiveTCINDXCONF(indxConf, tLen);
if (tReturnCode != -1) { if (tReturnCode != -1) {
completedTransaction(tCon); completedTransaction(tCon);
......
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