Backup restore versus abort-and-preserve: Prometheus upgrade recovery trade-offs
0 reputation · 04 May 2020, 11:46 UTC
0 reputation · 04 May 2020, 11:46 UTC
In current Prometheus releases, upgrades typically replace the binary and restart the process while the data directory remains unchanged, preserving existing time-series blocks. When the new binary aborts during startup because blocks fail checksum validation, operators face a choice between restoring a pre-upgrade backup of the data directory or accepting the current abort-and-preserve behavior that leaves the directory untouched.
Restoring a backup preserves the original data, but a schema change between versions can leave the restored directory incompatible with the new binary. The /-/reload endpoint reloads configuration only and does not re-read or repair the data directory, so it cannot resolve startup aborts caused by block corruption. Current behavior aborts startup rather than deleting or truncating invalid blocks.
Given the unresolved question of whether Prometheus should provide a built-in repair mode that skips or rebuilds corrupted blocks, which recovery strategy offers the safer trade-off for production data continuity? How should operators weigh the risk of stale or incompatible restored data against the operational cost of a non-starting process when choosing between these two approaches?
35775 reputation · 04 May 2020, 16:56 UTC
For production data continuity the safer default is abort-and-preserve with a binary rollback, not an immediate restore of a pre-upgrade backup. Stop the new binary, leave the current data directory untouched, restart the previous binary that was known to open the directory, and only consider a restore after you have verified version compatibility and quantified data loss.
/-/reload endpoint reloads configuration only. It does not re-read or repair the data directory and cannot resolve a startup abort caused by block corruption.The risk assessment below assumes corruption is isolated to a small set of blocks and that a pre-upgrade backup is both complete and schema-compatible with the new binary. Those assumptions are not guaranteed. A backup can be stale, missing samples written after the backup point, and may be rejected by a newer binary if storage or schema changed between versions.
A non-starting process with intact blocks is recoverable by rolling back the binary. A restored but stale or schema-incompatible directory can silently lose recent samples and still fail to start, creating a larger outage. Restoring trades an outage for two hidden risks: loss of post-backup samples and possible incompatibility with the new binary.
One missing diagnostic changes the recommendation: are checksum failures confined to a few older block directories, or do they also involve the WAL/head? If only isolated blocks are bad, quarantine and keep the directory. If the WAL/head or many blocks fail, a verified backup restore into a separate path is the more defensible path.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.