Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-08-31 13:27:37+02:00, jonas@stripped +6 -0
ndb - micro
add config parameter
mysql-test/ndb/ndb_config_1_node.ini@stripped, 2007-08-31 13:27:35+02:00,
jonas@stripped +1 -0
add test of epoch handling
mysql-test/ndb/ndb_config_2_node.ini@stripped, 2007-08-31 13:27:35+02:00,
jonas@stripped +2 -1
add test of epoch handling
storage/ndb/include/mgmapi/mgmapi_config_parameters.h@stripped, 2007-08-31 13:27:35+02:00,
jonas@stripped +1 -0
new config parameters
storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp@stripped, 2007-08-31 13:27:35+02:00,
jonas@stripped +1 -2
new config parameters
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp@stripped, 2007-08-31 13:27:35+02:00,
jonas@stripped +74 -45
new config parameters
storage/ndb/src/mgmsrv/ConfigInfo.cpp@stripped, 2007-08-31 13:27:35+02:00,
jonas@stripped +13 -1
new config parameters
diff -Nrup a/mysql-test/ndb/ndb_config_1_node.ini b/mysql-test/ndb/ndb_config_1_node.ini
--- a/mysql-test/ndb/ndb_config_1_node.ini 2007-06-09 07:25:43 +02:00
+++ b/mysql-test/ndb/ndb_config_1_node.ini 2007-08-31 13:27:35 +02:00
@@ -10,6 +10,7 @@ DataDir= CHOOSE_FILESYSTEM
MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes
MaxNoOfAttributes= CHOOSE_MaxNoOfAttributes
TimeBetweenGlobalCheckpoints= 500
+TimeBetweenEpochs=0
NoOfFragmentLogFiles= 8
FragmentLogFileSize= 6M
DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory
diff -Nrup a/mysql-test/ndb/ndb_config_2_node.ini b/mysql-test/ndb/ndb_config_2_node.ini
--- a/mysql-test/ndb/ndb_config_2_node.ini 2007-08-21 15:37:46 +02:00
+++ b/mysql-test/ndb/ndb_config_2_node.ini 2007-08-31 13:27:35 +02:00
@@ -9,7 +9,8 @@ TimeBetweenWatchDogCheck= 30000
DataDir= CHOOSE_FILESYSTEM
MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes
MaxNoOfAttributes= CHOOSE_MaxNoOfAttributes
-TimeBetweenGlobalCheckpoints= 500
+TimeBetweenGlobalCheckpoints= 3000
+TimeBetweenEpochs=100
NoOfFragmentLogFiles= 4
FragmentLogFileSize=12M
DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory
diff -Nrup a/storage/ndb/include/mgmapi/mgmapi_config_parameters.h
b/storage/ndb/include/mgmapi/mgmapi_config_parameters.h
--- a/storage/ndb/include/mgmapi/mgmapi_config_parameters.h 2007-06-12 10:55:15 +02:00
+++ b/storage/ndb/include/mgmapi/mgmapi_config_parameters.h 2007-08-31 13:27:35 +02:00
@@ -120,6 +120,7 @@
#define CFG_DB_O_DIRECT 168
#define CFG_DB_MAX_ALLOCATE 169
+#define CFG_DB_MICRO_GCP_INTERVAL 170 /* micro gcp */
#define CFG_DB_SGA 198 /* super pool mem */
#define CFG_DB_DATA_MEM_2 199 /* used in special build in 5.1 */
diff -Nrup a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
--- a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp 2007-08-30 08:22:53 +02:00
+++ b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp 2007-08-31 13:27:35 +02:00
@@ -1255,8 +1255,7 @@ private:
M_GCP_IDLE = 0,
M_GCP_PREPARE = 1,
M_GCP_COMMIT = 2,
- M_GCP_COMMITTED = 3,
- M_GCP_SAVE = 4 /** Only used when running with old node(s) */
+ M_GCP_COMMITTED = 3
} m_state, m_master_state;
} m_micro_gcp;
diff -Nrup a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
--- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2007-08-30 08:26:33 +02:00
+++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2007-08-31 13:27:35 +02:00
@@ -741,7 +741,16 @@ done:
Sysfile::setRestartOngoing(SYSFILE->systemRestartBits);
m_micro_gcp.m_current_gci = Uint64(newest + 1) << 32;
m_micro_gcp.m_new_gci = Uint64(newest + 1) << 32;
- m_micro_gcp.m_next_gci = (Uint64(newest + 1) << 32) + 1;
+ if (m_micro_gcp.m_enabled)
+ {
+ jam();
+ m_micro_gcp.m_next_gci = (Uint64(newest + 1) << 32) + 1;
+ }
+ else
+ {
+ jam();
+ m_micro_gcp.m_next_gci = (Uint64(newest + 2) << 32);
+ }
setNodeInfo(signal);
if ((Sysfile::getLCPOngoing(SYSFILE->systemRestartBits))) {
jam();
@@ -5277,12 +5286,6 @@ void Dbdih::execMASTER_GCPREQ(Signal* si
jam();
gcpState = MasterGCPConf::GCP_COMMITTED;
break;
- case MicroGcp::M_GCP_SAVE:
- /**
- * Only when running old protocol, only at master...
- */
- jam();
- ndbrequire(false);
};
MasterGCPConf::SaveState saveState;
@@ -5517,8 +5520,6 @@ void Dbdih::MASTER_GCPhandling(Signal* s
sendLoopMacro(GCP_COMMIT, sendGCP_COMMIT);
break;
}
- case MicroGcp::M_GCP_SAVE:
- jam();
case MicroGcp::M_GCP_COMMITTED:
jam();
ndbrequire(false);
@@ -7923,7 +7924,15 @@ void Dbdih::checkGcpStopLab(Signal* sign
return;
}//Dbdih::checkGcpStopLab()
-void Dbdih::startGcpLab(Signal* signal, Uint32 aWaitTime)
+static
+bool
+check_enable_micro_gcp()
+{
+ return false;
+}
+
+void
+Dbdih::startGcpLab(Signal* signal, Uint32 aWaitTime)
{
if (c_nodeStartMaster.blockGcp == true)
{
@@ -7972,6 +7981,15 @@ void Dbdih::startGcpLab(Signal* signal,
cstartGcpNow = false;
m_micro_gcp.m_start_time = now;
+ if (m_micro_gcp.m_enabled == false && m_micro_gcp.m_time_between_gcp)
+ {
+ /**
+ * Micro GCP is disabled...but configured...
+ */
+ jam();
+ check_enable_micro_gcp();
+ }
+
m_micro_gcp.m_new_gci = m_micro_gcp.m_next_gci;
m_micro_gcp.m_next_gci++;
@@ -8087,20 +8105,16 @@ void Dbdih::execGCP_NODEFINISH(Signal* s
ndbrequire(m_micro_gcp.m_master_state == MicroGcp::M_GCP_COMMIT);
receiveLoopMacro(GCP_COMMIT, senderNodeId);
+ jam();
+
if (m_micro_gcp.m_enabled)
{
- jam();
-
SubGcpCompleteRep * const rep = (SubGcpCompleteRep*)signal->getDataPtr();
rep->senderRef = reference();
-#if 1
rep->gci_hi = m_micro_gcp.m_old_gci >> 32;
rep->gci_lo = m_micro_gcp.m_old_gci & 0xFFFFFFFF;
rep->flags = SubGcpCompleteRep::IN_MEMORY;
-#else
- rep->gci = m_micro_gcp.m_old_gci >> 32;
-#endif
-
+
#ifdef ERROR_INSERT
if (ERROR_INSERTED(7190))
{
@@ -8137,11 +8151,11 @@ void Dbdih::execGCP_NODEFINISH(Signal* s
* New protocol
*/
Uint64 now;
+ m_micro_gcp.m_master_state = MicroGcp::M_GCP_IDLE;
if (m_micro_gcp.m_enabled)
{
jam();
- m_micro_gcp.m_master_state = MicroGcp::M_GCP_IDLE;
if (!ERROR_INSERTED(7190))
{
signal->theData[0] = DihContinueB::ZSTART_GCP;
@@ -8164,10 +8178,10 @@ void Dbdih::execGCP_NODEFINISH(Signal* s
else
{
jam();
- m_micro_gcp.m_master_state = MicroGcp::M_GCP_SAVE;
now = NdbTick_CurrentMillisecond();
+ ndbrequire(m_gcp_save.m_master_state == GcpSave::GCP_SAVE_IDLE);
}
-
+
/**
* Start a save
*/
@@ -8385,7 +8399,7 @@ void Dbdih::execGCP_PREPARE(Signal* sign
*/
infoEvent("keso");
ndbrequire(m_micro_gcp.m_master_ref != retRef);
- // Note...done set master_ref...and this will also be GCP_COMMIT:ed
+ // Note...dont set master_ref...and this will also be GCP_COMMIT:ed
goto reply;
}
@@ -8532,6 +8546,8 @@ Dbdih::execSUB_GCP_COMPLETE_REP(Signal*
{
ndbrequire(m_micro_gcp.m_master_state == MicroGcp::M_GCP_IDLE);
}
+
+ printf("execSUB_GCP_COMPLETE_REP(%u/%u)", rep->gci_hi, rep->gci_lo);
Uint32 masterRef = rep->senderRef;
if (m_micro_gcp.m_state == MicroGcp::M_GCP_IDLE)
@@ -8543,9 +8559,11 @@ Dbdih::execSUB_GCP_COMPLETE_REP(Signal*
*/
ndbrequire(m_micro_gcp.m_master_ref != masterRef);
m_micro_gcp.m_master_ref = masterRef;
+ ndbout_c(" - ignore");
return;
}
+ ndbout_c(" - forward to suma");
ndbrequire(m_micro_gcp.m_state == MicroGcp::M_GCP_COMMITTED);
m_micro_gcp.m_state = MicroGcp::M_GCP_IDLE;
EXECUTE_DIRECT(SUMA, GSN_SUB_GCP_COMPLETE_REP, signal, signal->length());
@@ -8859,14 +8877,17 @@ void Dbdih::execCOPY_GCICONF(Signal* sig
c_newest_restorable_gci = m_gcp_save.m_gci;
Uint64 next = m_micro_gcp.m_next_gci;
- ndbout_c("execCOPY_GCICONF: %u micros: %d",
- m_gcp_save.m_gci, Uint32(next));
+ printf("execCOPY_GCICONF: %u micros: %d next:",
+ m_gcp_save.m_gci, Uint32(next));
ndbassert(Uint32(next) != 0);
next &= ~Uint64(0xFFFFFFFF);
next += Uint64(1) << 32;
m_micro_gcp.m_next_gci = next;
+ ndbout_c(" %u/%u curr: %u/%u", Uint32(next >> 32), Uint32(next),
+ Uint32(m_micro_gcp.m_current_gci >> 32),
+ Uint32(m_micro_gcp.m_current_gci));
- if (m_micro_gcp.m_state == MicroGcp::M_GCP_SAVE)
+ if (m_micro_gcp.m_enabled == false)
{
jam();
/**
@@ -8874,6 +8895,23 @@ void Dbdih::execCOPY_GCICONF(Signal* sig
*/
signal->theData[0] = DihContinueB::ZSTART_GCP;
sendSignal(reference(), GSN_CONTINUEB, signal, 1, JBB);
+
+ SubGcpCompleteRep * const rep = (SubGcpCompleteRep*)signal->getDataPtr();
+ rep->gci_hi = m_gcp_save.m_gci;
+ rep->gci_lo = 0;
+ rep->flags = SubGcpCompleteRep::ON_DISK;
+
+ {
+ NodeRecordPtr specNodePtr;
+ specNodePtr.i = cfirstAliveNode;
+ do {
+ jam();
+ ptrCheckGuard(specNodePtr, MAX_NDB_NODES, nodeRecord);
+ sendSignal(calcDihBlockRef(specNodePtr.i), GSN_SUB_GCP_COMPLETE_REP,
+ signal, SubGcpCompleteRep::SignalLength, JBA);
+ specNodePtr.i = specNodePtr.p->nextNode;
+ } while (specNodePtr.i != RNIL);
+ }
}
m_gcp_save.m_master_state = GcpSave::GCP_SAVE_IDLE;
@@ -8984,20 +9022,9 @@ void Dbdih::writingCopyGciLab(Signal* si
m_gcp_save.m_state = GcpSave::GCP_SAVE_IDLE;
SubGcpCompleteRep * const rep = (SubGcpCompleteRep*)signal->getDataPtr();
-#if 1
rep->gci_hi = SYSFILE->newestRestorableGCI;
rep->gci_lo = 0;
rep->flags = SubGcpCompleteRep::ON_DISK;
-#else
- rep->gci = SYSFILE->newestRestorableGCI;
-#endif
-
- if (m_micro_gcp.m_enabled == false)
- {
- jam();
- sendSignal(SUMA_REF, GSN_SUB_GCP_COMPLETE_REP, signal,
- SubGcpCompleteRep::SignalLength, JBB);
- }
EXECUTE_DIRECT(LGMAN, GSN_SUB_GCP_COMPLETE_REP, signal,
SubGcpCompleteRep::SignalLength);
@@ -12593,9 +12620,8 @@ void Dbdih::initCommonData()
tmp = tmp > 60000 ? 60000 : (tmp < 10 ? 10 : tmp);
m_gcp_save.m_time_between_gcp = tmp;
- tmp = 20;
- //ndb_mgm_get_int_parameter(p, CFG_DB_MICRO_GCP_INTERVAL, &tmp);
- if (tmp)
+ if (ndb_mgm_get_int_parameter(p, CFG_DB_MICRO_GCP_INTERVAL, &tmp) == 0 &&
+ tmp)
{
/**
* A value is set for micro gcp...run new protocol when applicable
@@ -12606,12 +12632,6 @@ void Dbdih::initCommonData()
tmp = 10;
m_micro_gcp.m_time_between_gcp = tmp;
m_micro_gcp.m_enabled = true;
-
- if (m_micro_gcp.m_enabled == false)
- {
- jam();
- m_micro_gcp.m_time_between_gcp = m_gcp_save.m_time_between_gcp;
- }
}
}
}//Dbdih::initCommonData()
@@ -12658,7 +12678,16 @@ void Dbdih::initRestartInfo()
m_micro_gcp.m_old_gci = Uint64(1) << 32;
m_micro_gcp.m_current_gci = Uint64(2) << 32;
m_micro_gcp.m_new_gci = Uint64(2) << 32;
- m_micro_gcp.m_next_gci = m_micro_gcp.m_new_gci + 1;
+ if (m_micro_gcp.m_enabled)
+ {
+ jam();
+ m_micro_gcp.m_next_gci = m_micro_gcp.m_new_gci + 1;
+ }
+ else
+ {
+ jam();
+ m_micro_gcp.m_next_gci = m_micro_gcp.m_new_gci + (Uint64(1) << 32);
+ }
crestartGci = 1;
c_newest_restorable_gci = 1;
diff -Nrup a/storage/ndb/src/mgmsrv/ConfigInfo.cpp b/storage/ndb/src/mgmsrv/ConfigInfo.cpp
--- a/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2007-07-23 09:33:20 +02:00
+++ b/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2007-08-31 13:27:35 +02:00
@@ -889,7 +889,19 @@ const ConfigInfo::ParamInfo ConfigInfo::
true,
ConfigInfo::CI_INT,
"2000",
- "10",
+ "20",
+ "32000" },
+
+ {
+ CFG_DB_MICRO_GCP_INTERVAL,
+ "TimeBetweenEpochs",
+ DB_TOKEN,
+ "Time bewteen eopchs (syncronization used e.g for replication)",
+ ConfigInfo::CI_USED,
+ true,
+ ConfigInfo::CI_INT,
+ "100",
+ "0",
"32000" },
{
| Thread |
|---|
| • bk commit into 5.1 tree (jonas:1.2577) | jonas | 31 Aug |