</para>
</refsect2>
- <refsect2>
- <title>VerifyRecoveryLock</title>
- <para>Default: 1</para>
- <para>
- Should we take a fcntl() lock on the reclock file to verify that we are the
- sole recovery master node on the cluster or not.
- </para>
- </refsect2>
-
<refsect2>
<title>VacuumInterval</title>
<para>Default: 10</para>
LogLatencyMs = 0
RecLockLatencyMs = 1000
RecoveryDropAllIPs = 120
-VerifyRecoveryLock = 1
VacuumInterval = 10
VacuumMaxRunTime = 30
RepackLimit = 10000
<refsect2>
<title>getreclock</title>
<para>
- This command is used to show the filename of the reclock file that is used.
+ Show the name of the recovery lock file, if any.
</para>
<para>
Example output:
</para>
<screen>
- Reclock file:/gpfs/.ctdb/shared
+ Reclock file:/clusterfs/.ctdb/recovery.lock
</screen>
</refsect2>
<refsect2>
- <title>setreclock [filename]</title>
+ <title>
+ setreclock <optional><parameter>FILE</parameter></optional>
+ </title>
+
<para>
- This command is used to modify, or clear, the file that is used as the reclock file at runtime. When this command is used, the reclock file checks are disabled. To re-enable the checks the administrator needs to activate the "VerifyRecoveryLock" tunable using "ctdb setvar".
+ FILE specifies the name of the recovery lock file. If the
+ recovery lock file is changed at run-time then this will cause
+ a recovery, which in turn causes the recovery lock to be
+ retaken.
</para>
<para>
- If run with no parameter this will remove the reclock file completely. If run with a parameter the parameter specifies the new filename to use for the recovery lock.
+ If no FILE is specified then a recovery lock file will no
+ longer be used.
</para>
<para>
- This command only affects the runtime settings of a ctdb node and will be lost when ctdb is restarted. For persistent changes to the reclock file setting you must edit /etc/sysconfig/ctdb.
+ This command only affects the run-time setting of a single
+ CTDB node. This setting <emphasis>must</emphasis> be changed
+ on all nodes simultaneously by specifying <option>-n
+ all</option> (or similar). For information about configuring
+ the recovery lock file please see the
+ <citetitle>CTDB_RECOVERY_LOCK</citetitle> entry in
+ <citerefentry><refentrytitle>ctdbd.conf</refentrytitle>
+ <manvolnum>5</manvolnum></citerefentry> and the
+ <citetitle>--reclock</citetitle> entry in
+ <citerefentry><refentrytitle>ctdbd</refentrytitle>
+ <manvolnum>1</manvolnum></citerefentry>. For information
+ about the recovery lock please see the <citetitle>RECOVERY
+ LOCK</citetitle> section in
+ <citerefentry><refentrytitle>ctdb</refentrytitle>
+ <manvolnum>7</manvolnum></citerefentry>.
</para>
</refsect2>
ctdb_process_deferred_attach(ctdb);
}
- if (ctdb->tunable.verify_recovery_lock == 0) {
- /* dont need to verify the reclock file */
+ if (ctdb->recovery_lock_file == NULL) {
+ /* Not using recovery lock file */
ctdb->recovery_mode = recmode;
return 0;
}
return -1;
}
- if (ctdb->tunable.verify_recovery_lock != 0) {
+ if (ctdb->recovery_lock_file != NULL) {
DEBUG(DEBUG_ERR,("Taking out recovery lock from recovery daemon\n"));
start_time = timeval_current();
if (!ctdb_recovery_lock(ctdb, true)) {
talloc_free(rec->send_election_te);
rec->send_election_te = NULL;
- if (ctdb->tunable.verify_recovery_lock != 0) {
- /* release the recmaster lock */
+ if (ctdb->recovery_lock_file != NULL) {
+ /* Release the recovery lock file */
if (em->pnn != ctdb->pnn &&
ctdb->recovery_lock_fd != -1) {
DEBUG(DEBUG_NOTICE, ("Release the recovery lock\n"));
ctdb->recovery_lock_fd = -1;
}
}
- ctdb->tunable.verify_recovery_lock = 0;
talloc_free(tmp_ctx);
return 0;
}
talloc_free(ctdb->recovery_lock_file);
ctdb->recovery_lock_file = talloc_strdup(ctdb, reclockfile);
- ctdb->tunable.verify_recovery_lock = 0;
if (ctdb->recovery_lock_fd != -1) {
close(ctdb->recovery_lock_fd);
ctdb->recovery_lock_fd = -1;
/* Make sure that if recovery lock verification becomes disabled when
we close the file
*/
- if (ctdb->tunable.verify_recovery_lock == 0) {
+ if (ctdb->recovery_lock_file == NULL) {
if (ctdb->recovery_lock_fd != -1) {
close(ctdb->recovery_lock_fd);
ctdb->recovery_lock_fd = -1;
}
- if (ctdb->tunable.verify_recovery_lock != 0) {
+ if (ctdb->recovery_lock_file != NULL) {
/* we should have the reclock - check its not stale */
ret = check_recovery_lock(ctdb);
if (ret != 0) {
if (file == NULL) {
DEBUG(DEBUG_ALERT,("Recovery lock file set to \"\". Disabling recovery lock checking\n"));
- ctdb->tunable.verify_recovery_lock = 0;
return 0;
}
{ "LogLatencyMs", 0, offsetof(struct ctdb_tunable, log_latency_ms), false },
{ "RecLockLatencyMs", 1000, offsetof(struct ctdb_tunable, reclock_latency_ms), false },
{ "RecoveryDropAllIPs", 120, offsetof(struct ctdb_tunable, recovery_drop_all_ips), false },
- { "VerifyRecoveryLock", 1, offsetof(struct ctdb_tunable, verify_recovery_lock), false },
+ { "VerifyRecoveryLock", 1, offsetof(struct ctdb_tunable, verify_recovery_lock), true },
{ "VacuumInterval", 10, offsetof(struct ctdb_tunable, vacuum_interval), false },
{ "VacuumMaxRunTime", 120, offsetof(struct ctdb_tunable, vacuum_max_run_time), false },
{ "RepackLimit", 10000, offsetof(struct ctdb_tunable, repack_limit), false },
*/
int32_t ctdb_control_set_tunable(struct ctdb_context *ctdb, TDB_DATA indata)
{
- struct ctdb_control_set_tunable *t =
+ struct ctdb_control_set_tunable *t =
(struct ctdb_control_set_tunable *)indata.dptr;
char *name;
int i;
if (strcasecmp(name, tunable_map[i].name) == 0) break;
}
- if (!strcmp(name, "VerifyRecoveryLock") && t->value != 0
- && ctdb->recovery_lock_file == NULL) {
- DEBUG(DEBUG_ERR,("Can not activate tunable \"VerifyRecoveryLock\" since there is no recovery lock file set.\n"));
- talloc_free(name);
- return -1;
- }
-
talloc_free(name);
-
+
if (i == ARRAY_SIZE(tunable_map)) {
return -1;
}