#At file:///home/msvensson/mysql/6.3-bug47366/ based on revid:magnus.blaudd@stripped28-u72djdsaqgw00qs7
3144 Magnus Blåudd 2009-11-03
Bug#47366 ndb_config --xml --configinfo: Add restart type for config variables
- Add flags CS_RESTART_INITIAL and CS_RESTART_SYSTEM which describes how
the system must be restarted for a configuration parameter change to take effect.
Default is none of these flags set, which means node restart of one node at a
time for the setting to take effect
CS_RESTART_INITIAL
Each data node need to be restarted one at a time with --initial
CS_RESTART_SYSTEM
The whole system need to be stopped and then started up again
CS_RESTART_SYSTEM + CS_RESTART_INITIAL
The whole system need to be stopped and then restarted with --initial
thus destroying any data in the cluster
- Rename CI_UPDATEABALE to CI_ONLINE_UPDATEABLE and check that no parameter
yet have that flag set, turn it off for some variables.
- This is the current list of parameters that require --initial node restart
NoOfFragmentLogFiles
FragmentLogFileSize
InitFragmentLogFiles
DataDir
FileSystemPath
BackupDataDir
CompressedLCP
FileSystemPathDD
FileSystemPathDataFiles
FileSystemPathUndoFiles
- This is the current list of parameters that require --initial system restart
NoOfReplicas
Diskless(aka Discless)
InitialLogfileGroup
InitialTablespace
- There are currently no parameters that require system restart
modified:
storage/ndb/src/mgmsrv/ConfigInfo.cpp
storage/ndb/src/mgmsrv/ConfigInfo.hpp
=== modified file 'storage/ndb/src/mgmsrv/ConfigInfo.cpp'
--- a/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2009-10-09 13:09:38 +0000
+++ b/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2009-11-03 14:47:16 +0000
@@ -355,7 +355,22 @@ const ConfigInfo::ParamInfo ConfigInfo::
"0",
STR_VALUE(MAX_INT_RNIL) },
- {
+ /***************************************************************************
+ * DB
+ ***************************************************************************/
+ {
+ CFG_SECTION_NODE,
+ DB_TOKEN,
+ DB_TOKEN,
+ "[DB] section",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_SECTION,
+ (const char *)NODE_TYPE_DB,
+ 0, 0
+ },
+
+ {
CFG_DB_SUBSCRIPTIONS,
"MaxNoOfSubscriptions",
DB_TOKEN,
@@ -402,21 +417,6 @@ const ConfigInfo::ParamInfo ConfigInfo::
"false",
"false",
"true"},
-
- /***************************************************************************
- * DB
- ***************************************************************************/
- {
- CFG_SECTION_NODE,
- DB_TOKEN,
- DB_TOKEN,
- "Node section",
- ConfigInfo::CI_USED,
- false,
- ConfigInfo::CI_SECTION,
- (const char *)NODE_TYPE_DB,
- 0, 0
- },
{
CFG_NODE_HOST,
@@ -482,7 +482,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Number of copies of all data in the database (1-4)",
ConfigInfo::CI_USED,
- false,
+ CI_RESTART_SYSTEM | CI_RESTART_INITIAL,
ConfigInfo::CI_INT,
"2",
"1",
@@ -602,7 +602,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Max number of error messages in error log and max number of trace files",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_INT,
"25",
"0",
@@ -614,7 +614,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"CPU ID indicating which CPU will run the execution thread",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_INT,
"65535",
"0",
@@ -626,7 +626,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"CPU ID indicating which CPU will run the maintenance threads",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_INT,
"65535",
"0",
@@ -638,7 +638,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"If yes, then NDB Cluster threads will be scheduled as real-time threads",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_BOOL,
"false",
"false",
@@ -650,7 +650,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"If set to yes, then NDB Cluster data will not be swapped out to disk",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_INT,
"0",
"0",
@@ -662,7 +662,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Time between execution checks inside a database node",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_INT,
"6000",
"70",
@@ -698,7 +698,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Time between execution checks inside a database node in the early start phases when memory is allocated",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_INT,
"6000",
"70",
@@ -710,7 +710,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"If set to N, "DB_TOKEN_PRINT" automatically restarts/recovers in case of node failure",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_BOOL,
"true",
"false",
@@ -722,7 +722,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"See src/kernel/vm/Emulator.hpp NdbRestartType for details",
ConfigInfo::CI_INTERNAL,
- true,
+ 0,
ConfigInfo::CI_INT,
"2",
"0",
@@ -914,7 +914,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Time to wait before trying to start wo/ all nodes. 0=Wait forever",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_INT,
"30000",
"0",
@@ -926,7 +926,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Time to wait before trying to start partitioned. 0=Wait forever",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_INT,
"60000",
"0",
@@ -938,7 +938,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Time to wait before terminating. 0=Wait forever",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_INT,
"0",
"0",
@@ -950,7 +950,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Time between "DB_TOKEN_PRINT"-"DB_TOKEN_PRINT" heartbeats. "DB_TOKEN_PRINT" considered dead after 3 missed HBs",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_INT,
"1500",
"10",
@@ -962,7 +962,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Time between "API_TOKEN_PRINT"-"DB_TOKEN_PRINT" heartbeats. "API_TOKEN_PRINT" connection closed after 3 missed HBs",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_INT,
"1500",
"100",
@@ -974,7 +974,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Time between taking snapshots of the database (expressed in 2log of bytes)",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_INT,
"20",
"0",
@@ -986,7 +986,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Time between doing group commit of transactions to disk",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_INT,
"2000",
"20",
@@ -998,7 +998,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Time between epochs (syncronization used e.g for replication)",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_INT,
"100",
"0",
@@ -1010,7 +1010,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Timeout for time between epochs. Exceeding will cause node shutdown.",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_INT,
"4000",
"0",
@@ -1022,7 +1022,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Allowed numbered of epochs that a subscribing node can lag behind (unprocessed epochs). Exceeding will cause lagging subscribers to be disconnected.",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_INT,
"100",
"0",
@@ -1034,7 +1034,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"No of 16 Mbyte Redo log files in each of 4 file sets belonging to "DB_TOKEN_PRINT" node",
ConfigInfo::CI_USED,
- false,
+ CI_RESTART_INITIAL,
ConfigInfo::CI_INT,
"16",
"3",
@@ -1046,7 +1046,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Size of each Redo log file",
ConfigInfo::CI_USED,
- false,
+ CI_RESTART_INITIAL,
ConfigInfo::CI_INT,
"16M",
"4M",
@@ -1058,7 +1058,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Initialize fragment logfiles (sparse/full)",
ConfigInfo::CI_USED,
- false,
+ CI_RESTART_INITIAL,
ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1093,7 +1093,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Time between inactive transaction checks",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_INT,
"1000",
"1000",
@@ -1109,7 +1109,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
"If the application takes too long time, the transaction gets aborted.\n"
"Timeout set to 0 means that we don't timeout at all on application wait.",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_INT,
STR_VALUE(MAX_INT_RNIL),
"0",
@@ -1124,7 +1124,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
"of the transaction to execute a request. If the database node takes too\n"
"long time, the transaction gets aborted.",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_INT,
"1200",
"50",
@@ -1136,7 +1136,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"DiskCheckpointSpeedSr",
ConfigInfo::CI_DEPRICATED,
- true,
+ 0,
ConfigInfo::CI_INT,
"40",
"1",
@@ -1148,7 +1148,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"DiskCheckpointSpeed",
ConfigInfo::CI_DEPRICATED,
- true,
+ 0,
ConfigInfo::CI_INT,
"40",
"1",
@@ -1160,7 +1160,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"DiskCheckpointSpeedSr",
ConfigInfo::CI_DEPRICATED,
- true,
+ 0,
ConfigInfo::CI_INT,
"20",
"1",
@@ -1172,7 +1172,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"DiskCheckpointSpeed",
ConfigInfo::CI_DEPRICATED,
- true,
+ 0,
ConfigInfo::CI_INT,
"20",
"1",
@@ -1185,7 +1185,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Run wo/ disk",
ConfigInfo::CI_USED,
- true,
+ CI_RESTART_INITIAL | CI_RESTART_SYSTEM,
ConfigInfo::CI_BOOL,
"false",
"false",
@@ -1197,7 +1197,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Diskless",
ConfigInfo::CI_DEPRICATED,
- true,
+ CI_RESTART_INITIAL | CI_RESTART_SYSTEM,
ConfigInfo::CI_BOOL,
"false",
"false",
@@ -1223,7 +1223,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Data directory for this node",
ConfigInfo::CI_USED,
- CI_CHECK_WRITABLE,
+ CI_CHECK_WRITABLE | CI_RESTART_INITIAL,
ConfigInfo::CI_STRING,
MYSQLCLUSTERDIR,
0, 0 },
@@ -1234,7 +1234,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Path to directory where the "DB_TOKEN_PRINT" node stores its data (directory must exist)",
ConfigInfo::CI_USED,
- CI_CHECK_WRITABLE,
+ CI_CHECK_WRITABLE | CI_RESTART_INITIAL,
ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1368,7 +1368,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Path to where to store backups",
ConfigInfo::CI_USED,
- CI_CHECK_WRITABLE,
+ CI_CHECK_WRITABLE | CI_RESTART_INITIAL,
ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1523,7 +1523,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Use O_DIRECT file write/read when possible",
ConfigInfo::CI_USED,
- true,
+ false,
ConfigInfo::CI_BOOL,
"false",
"false",
@@ -1534,7 +1534,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Use zlib to compress BACKUPs as they are written",
ConfigInfo::CI_USED,
- true,
+ 0,
ConfigInfo::CI_BOOL,
"false",
"false",
@@ -1545,7 +1545,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Write compressed LCPs using zlib",
ConfigInfo::CI_USED,
- true,
+ CI_RESTART_INITIAL,
ConfigInfo::CI_BOOL,
"false",
"false",
@@ -1557,7 +1557,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Path to directory where the "DB_TOKEN_PRINT" node stores its disk-data/undo-files",
ConfigInfo::CI_USED,
- CI_CHECK_WRITABLE,
+ CI_CHECK_WRITABLE | CI_RESTART_INITIAL,
ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1568,7 +1568,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Path to directory where the "DB_TOKEN_PRINT" node stores its disk-data-files",
ConfigInfo::CI_USED,
- CI_CHECK_WRITABLE,
+ CI_CHECK_WRITABLE | CI_RESTART_INITIAL,
ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1579,7 +1579,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Path to directory where the "DB_TOKEN_PRINT" node stores its disk-undo-files",
ConfigInfo::CI_USED,
- CI_CHECK_WRITABLE,
+ CI_CHECK_WRITABLE | CI_RESTART_INITIAL,
ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1590,7 +1590,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Logfile group that will be created during initial start",
ConfigInfo::CI_USED,
- false,
+ CI_RESTART_SYSTEM | CI_RESTART_INITIAL,
ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1601,7 +1601,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
DB_TOKEN,
"Tablespace that will be created during initial start",
ConfigInfo::CI_USED,
- false,
+ CI_RESTART_SYSTEM | CI_RESTART_INITIAL,
ConfigInfo::CI_STRING,
UNDEFINED,
0, 0 },
@@ -1618,6 +1618,8 @@ const ConfigInfo::ParamInfo ConfigInfo::
"0",
"600" },
+// 7.0 NodeGroup -> initial, system
+
/***************************************************************************
* API
***************************************************************************/
@@ -1721,7 +1723,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
API_TOKEN,
"When asked to arbitrate, arbitrator waits this long before voting (msec)",
ConfigInfo::CI_USED,
- false,
+ 0,
ConfigInfo::CI_INT,
"0",
"0",
@@ -2578,16 +2580,21 @@ const int ConfigInfo::m_NoOfParams = siz
/****************************************************************************
* Ctor
****************************************************************************/
-static void require(bool v)
+static void
+_require(bool v, const char* expr, unsigned line)
{
if(!v)
{
+ fprintf(stderr, "require(%s) failed at %s:%d\n",
+ expr, __FILE__, line);
+ fflush(stderr);
if (opt_core)
abort();
else
exit(-1);
}
}
+#define require(x) _require(x, #x, __LINE__)
ConfigInfo::ConfigInfo()
: m_info(true), m_systemDefaults(true)
@@ -2615,7 +2622,33 @@ ConfigInfo::ConfigInfo()
pinfo.put("Id", param._paramId);
pinfo.put("Fname", param._fname);
pinfo.put("Description", param._description);
- pinfo.put("Flags", param._flags);
+
+ /*
+ Check that flags are set according to current rules
+ */
+ const Uint32 flags = param._flags;
+ const Uint32 allowed_flags = (CI_ONLINE_UPDATEABLE | CI_CHECK_WRITABLE |
+ CI_RESTART_SYSTEM | CI_RESTART_INITIAL);
+ // Check that no other flags then the defined are set
+ require((flags & ~allowed_flags) == 0);
+
+ if (flags & CI_ONLINE_UPDATEABLE)
+ {
+ // Check that online updateable parameter does
+ // not have any CI_RESTART_* flag(s)
+ require((flags & CI_RESTART_INITIAL) == 0 &&
+ (flags & CI_RESTART_SYSTEM) == 0);
+
+ // Currently no online updatable parameters have been implemented
+ require(false);
+ }
+
+ // only DB nodes should have CI_RESTART_*
+ if ((flags & CI_RESTART_INITIAL) || (flags & CI_RESTART_SYSTEM))
+ require(strcmp(param._section, DB_TOKEN) == 0);
+
+ pinfo.put("Flags", flags);
+
pinfo.put("Type", param._type);
pinfo.put("Status", param._status);
@@ -2740,6 +2773,7 @@ ConfigInfo::ConfigInfo()
require(false);
}
}
+
}
/****************************************************************************
@@ -3142,6 +3176,14 @@ public:
if (buf.length())
pairs.put("check", buf.c_str());
+ // Get "restart" flag
+ if (flags & ConfigInfo::CI_RESTART_SYSTEM)
+ pairs.put("restart", "system");
+
+ // Get "initial" flag
+ if (flags & ConfigInfo::CI_RESTART_INITIAL)
+ pairs.put("initial", "true");
+
print_xml("param", pairs);
}
};
=== modified file 'storage/ndb/src/mgmsrv/ConfigInfo.hpp'
--- a/storage/ndb/src/mgmsrv/ConfigInfo.hpp 2009-05-27 12:11:46 +0000
+++ b/storage/ndb/src/mgmsrv/ConfigInfo.hpp 2009-11-03 14:47:16 +0000
@@ -53,8 +53,32 @@ public:
};
enum Flags {
- CI_UPDATEABLE = 1, // Parameter can be updated
- CI_CHECK_WRITABLE = 2 // Path given by parameter should be writable
+ CI_ONLINE_UPDATEABLE = 1, // Parameter can be updated online
+ CI_CHECK_WRITABLE = 2, // Path given by parameter should be writable
+
+ /*
+ Flags telling how the system must be restarted for a changed
+ parameter to take effect
+
+ Default is none of these flags set, which means node restart
+ of one node at a time for the setting to take effect
+
+ CS_RESTART_INITIAL
+ Each data node need to be restarted one at a time with --initial
+
+ CS_RESTART_SYSTEM
+ The whole system need to be stopped and then started up again
+
+ CS_RESTART_SYSTEM + CS_RESTART_INITIAL
+ The whole system need to be stopped and then restarted with --initial
+ thus destroying any data in the cluster
+
+ These flags can not be combined with CI_ONLINE_UPDATABLE flag which
+ indicates that the parameter can be changed online without
+ restarting anything
+ */
+ CI_RESTART_SYSTEM = 4, // System restart is necessary to apply setting
+ CI_RESTART_INITIAL = 8 // Initial restart is necessary to apply setting
};
/**
Attachment: [text/bzr-bundle] bzr/magnus.blaudd@sun.com-20091103144716-csudh4a164cjhi2c.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-6.3 branch (magnus.blaudd:3144)Bug#47366 | Magnus Blåudd | 3 Nov |