Page MenuHomePhabricator

sre.elasticsearch.rolling-operation: Fix reboot --start-datetime logic
Closed, ResolvedPublic

Description

Although our hosts are technically on OpenSearch now, we still use sre.elasticsearch.rolling-operation to restart the fleet. The cookbook has an argument called --start-datetime we can use to recover from a failed cookbook run without having to restart services on the hosts that were already successfully restarted.

Unfortunately, the rolling-operation cookbook uses the JVM start time for --start-datetime , which only works for service restarts. It doesn't account for host reboots, which are also needed occasionally (ref T407110 amongst others).

Creating this ticket to:

  • Adjust the cookbook and/or spicerack logic to handle reboots correctly.
  • Verify operation

Event Timeline

Change #1207280 had a related patch set uploaded (by Ryan Kemper; author: Ryan Kemper):

[operations/cookbooks@master] elastic: reboot should check uptime not jvm start time

https://gerrit.wikimedia.org/r/1207280

bking changed the task status from Open to In Progress.Nov 19 2025, 10:59 PM
bking assigned this task to RKemper.
bking triaged this task as Medium priority.
bking updated Other Assignee, added: bking.

Change #1207280 abandoned by Ryan Kemper:

[operations/cookbooks@master] elastic: reboot should check uptime not jvm start time

Reason:

We should change this at the spicerack level to have a more elegant solution

https://gerrit.wikimedia.org/r/1207280

Change #1235112 had a related patch set uploaded (by Ryan Kemper; author: Ryan Kemper):

[operations/software/spicerack@master] elasticsearch_cluster: allow checking last reboot

https://gerrit.wikimedia.org/r/1235112

Change #1235113 had a related patch set uploaded (by Ryan Kemper; author: Ryan Kemper):

[operations/cookbooks@master] sre.elasticsearch.rolling-operation: use boottime for reboot operations

https://gerrit.wikimedia.org/r/1235113

Spicerack and cookbook patches are up. 99% of the logic lives in spicerack so that's the most important patch to review.

And as far as tests are concerned, the most important test is test_get_next_clusters_nodes_restarted_but_not_rebooted since that actually tests the new feature.

Most recent rounds of feedback is addressed

Change #1235112 merged by Elukey:

[operations/software/spicerack@master] elasticsearch_cluster: allow checking last reboot

https://gerrit.wikimedia.org/r/1235112

Mentioned in SAL (#wikimedia-operations) [2026-03-31T06:55:35Z] <ryankemper@cumin2002> START - Cookbook sre.elasticsearch.rolling-operation Operation.REBOOT (1 nodes at a time) for ElasticSearch cluster search_codfw: test reboot boottime check T410577 - ryankemper@cumin2002 - T410577

Mentioned in SAL (#wikimedia-operations) [2026-03-31T07:22:46Z] <ryankemper@cumin2002> END (ERROR) - Cookbook sre.elasticsearch.rolling-operation (exit_code=97) Operation.REBOOT (1 nodes at a time) for ElasticSearch cluster search_codfw: test reboot boottime check T410577 - ryankemper@cumin2002 - T410577

Mentioned in SAL (#wikimedia-operations) [2026-03-31T07:23:18Z] <ryankemper> T410577 ^ cookbook did its job, ctrl+c'd after one host was rebooted. new spicerack upgrade confirmed working

Change #1235113 merged by jenkins-bot:

[operations/cookbooks@master] sre.elasticsearch.rolling-operation: use boottime for reboot operations

https://gerrit.wikimedia.org/r/1235113