The @PLUGIN@ plugin registers the pull-replication-outstanding-tasks
healthcheck. This check will mark a gerrit instance as healthy upon startup only when the node has caught up with all the outstanding pull-replication tasks. The goal is to mark the node as healthy when it is ready to receive write traffic. “Caught up” means:
See Healthcheck based on replication tasks for more details.
It is worth noting that once the healthcheck eventually succeeds and the instance is marked healthy, the check is then skipped (ie any subsequent invocations will always mark the instance as healthy irrespective of any pending or inflight tasks being present).
The configuration of the health check is split across two files.
healthcheck
plugin. These are set in the healthcheck
plugin's config file.The health check can be configured as follows:
healthcheck.@PLUGIN@-outstanding-tasks.projects
: The repo(s) that the health check will track outstanding replication tasks against. Multiple entries are supported. If not specified, all the outstanding replication tasks are tracked.healthcheck.@PLUGIN@-outstanding-tasks.periodOfTime
: The time for which the check needs to be successful, in order for the instance to be marked healthy. If the time unit is omitted it defaults to milliseconds. Values should use common unit suffixes to express their setting:Default is 10s.
This example config will report the node healthy when there are no pending tasks for the foo
and bar/baz
repos continuously for a period of 5 seconds after the plugin startup.
[healthcheck "pull-replication-tasks"] projects = foo projects = bar/baz periodOfTime = 5 sec
healthcheck
plugin is not installed, then the check registration is skipped during load of the pull-replication plugin.Note when the @@PLUGIN@@ plugin is installed as a lib (see extension-point.md), then the healthcheck plugin jar should also be present in the
lib
directory, for the check registration to work.
healthcheck
plugin, renaming/removing the healthcheck
jar file is not supported during runtime. Doing so can lead to unpredictable behaviour of your gerrit instance.