Commit 46c8a6ab authored by Iustin Pop's avatar Iustin Pop
Browse files

Add a new watcher option --ignore-pause



During cluster maintenance, when the watcher is disabled, it's useful to
run it just once. This is incovenient to do currently, as the watcher
needs to be unpaused, then run, then paused again.

This patch adds an option “--ignore-pause” that can be used to ignore
the cluster-level setting. Also the man page is updated as it was
missing the options available.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent ac96953d
......@@ -671,6 +671,8 @@ def ParseOptions():
parser.add_option("-A", "--job-age", dest="job_age",
help="Autoarchive jobs older than this age (default"
" 6 hours)", default=6*3600)
parser.add_option("--ignore-pause", dest="ignore_pause", default=False,
action="store_true", help="Ignore cluster pause setting")
options, args = parser.parse_args()
options.job_age = cli.ParseTimespec(options.job_age)
return options, args
......@@ -692,7 +694,7 @@ def main():
utils.SetupLogging(constants.LOG_WATCHER, debug=options.debug,
stderr_logging=options.debug)
if ShouldPause():
if ShouldPause() and not options.ignore_pause:
logging.debug("Pause has been set, exiting")
sys.exit(constants.EXIT_SUCCESS)
......
......@@ -41,6 +41,10 @@
<cmdsynopsis>
<command>&dhpackage; </command>
<arg><option>--debug</option></arg>
<arg><option>--job-age=<replaceable>age</replaceable></option></arg>
<arg><option>--ignore-pause</option></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
......@@ -53,6 +57,20 @@
and another one that runs on every node.
</para>
<para>
If the watcher is disabled at cluster level (via
the <command>gnt-cluster watcher pause</command> command), it
will exit without doing anything. The cluster-level pause can be
overriden via the <option>--ignore-pause</option> option, for
example if during a maintenance the watcher needs to be disabled
in general, but the administrator wants to run it just once.
</para>
<para>
The <option>--debug</option> option will increase the verbosity
of the watcher and also activate logging to the standard error.
</para>
<refsect2>
<title>Master operations</title>
......@@ -63,11 +81,18 @@
</para>
<para>
Its other function is to <quote>repair</quote> DRBD links by
Another function is to <quote>repair</quote> DRBD links by
reactivating the block devices of instances which have
secondaries on nodes that have been rebooted.
</para>
<para>
The watcher will also archive old jobs (older than the age
given via the <option>--job-age</option> option, which
defaults to 6 hours), in order to keep the job queue
manageable.
</para>
</refsect2>
<refsect2>
......@@ -96,7 +121,7 @@
<para>
The watcher does synchronous queries but will submit jobs for
executing the changes. Due to locking, it could be that the jobs
execute much later than the watcher executes them.
execute much later than the watcher submits them.
</para>
</refsect2>
......
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