Skip to content

v0.26.0

Choose a tag to compare

@github-actions github-actions released this 12 Oct 07:42
· 128 commits to main since this release
0961c2f

Added

  • Fault-injection and load tests (#103): a nightly suite (internal/chaos, make test-chaos-docker, job "Chaos") breaks backups, restores, purges, migrations, key rotations and PITR collection with Toxiproxy (storage outage and partition, MongoDB connection drops), a primary stepdown, a full disk, SIGKILL and clock steps, and checks that no broken run ends completed, nothing that looks complete is left, the next run succeeds and the alerts fire; a weekly load test (internal/load, make test-load-docker, job "Load") measures scheduler tick latency, memory, API p95, SQLite contention, backup throughput and the impact of a dump on a busy primary with hundreds of connections and thousands of jobs, writes a JSON report and fails on regressions against internal/load/testdata/baseline.json; scenarios, expected outcomes and numbers are in docs/testing.md.
  • Cross-region disaster recovery (#143). See docs/production.md.
    • Locked copies. A job with require_locked_copies is refused (400) unless every copy target has S3 Object Lock. security.require_locked_copies (Settings → Security) applies to every job while it is on (no job can opt out) and is the default for new jobs; turning it off, or a job's policy while it is off, takes effect after the delete grace period and, under the two-person rule, after a second administrator's approval (pending change and approval kinds disable_locked_copies and job_locked_copies).
    • Region awareness. Storage targets have a region: an operator's label, or on AWS S3 the bucket's region (from s3.region or GetBucketLocation, region_detected); other endpoints and local targets need a label. Readiness rows of jobs with copies carry dr and warn with dr_same_region when no copy is in another region than the primary, with dr_same_credentials when every copy shares the primary's access key, default credentials or Cloudflare account, and with dr_unlocked_copy when a job requiring locked copies has a copy target without Object Lock (removing the lock of such a target is refused).
    • DR drills. restore_test.source_target_id makes a job's restore tests read one of its copy targets; results record source_target_id. Readiness shows the last drill and warns with dr_drill_stale when none passed in 30 days. A row shows DR: cross-region once a locked copy in another region passed a recent drill.
    • Cross-region PITR. PITR streams take copy_targets: base backups are copied like a job's backups, and the copy queue copies every oplog chunk with its checksum checked and purges the copies with their chunks (migration 0027, oplog_chunk_copies). A point-in-time restore can read a copy chain (source_target_id) and falls back to one when the primary base or a chunk cannot be read; a chain is used only when every chunk in the range has a completed copy on that target.
    • docs/production.md has a Region failure runbook, least-privilege credentials for copy targets in another account, and new checklist items.
  • PITR on a three-member replica set (#141): make test-pitr-replset (scripts/test-replset-docker.sh, internal/replset, build tag replset3) starts m1, m2 and m3 with docker compose for every scenario and checks a failover during collection and during a restore (in the base pass and in the replay), a rollback through network isolation and divergence after a forced reconfiguration: the chain stays unbroken (or ends exactly where the surviving history ends), the stored oplog equals the members' entry by entry, no rolled-back or lost write is in a live chunk, and restores match. The Nightly workflow runs it (job PITR replica set) on MongoDB 5.0 and 8.0 with Database Tools 100.12.2 and 100.19.1; it is not a required check. See docs/testing.md.
  • PITR chain tests in CI (#141): the integration suite's chain test, which runs on every pull request in the replica set jobs, is now started by the stream's chain_test_cron schedule, wired as the application wires it, and checks that the base before the newest was restored exactly to the newest base's consistent point, that the clones matched its manifest collection by collection and that they were dropped.
  • Measured RTO of point-in-time restores (#141): completed restores and chain tests record how long the base and the oplog replay took (pitr.base_seconds, pitr.replay_seconds) and log the replay rate in entries and MiB per second. The preflight's estimate (estimate_from: measured) and the readiness report's new streams[].rto (a whole-instance restore to the newest point of the open window, with its source, samples and rates) use the stream's five newest timed restores and chain tests instead of the newest chain test's overall rate: the base at their rate, the replay from a least-squares fit of their replay times to entries and stored bytes (per entry when one workload cannot tell the two apart), so small entries in the history do not inflate the estimate for large ones; the dashboard shows the estimate under the RTO of the connection's readiness rows. Typical rates are in docs/pitr.md.
  • PITR soak test (#141): make test-pitr-soak (TestSoak, build tags replset3 and soak) runs the collector with scheduled base backups and retention under a steady write load for MONGORESCUE_SOAK_DURATION and checks every sample that there is no gap and no false break, that the collector keeps up, and that the chunk objects and live bases stay bounded; at the end, that retention deleted and purged what fell out of the window, that the stored oplog equals the primary's, and that a chain test passes. It writes a JSON report (MONGORESCUE_SOAK_REPORT). The Nightly workflow runs it every week for 5.5 hours (job PITR soak, not required); scripts/soak-pitr.sh is the manual 7-day run (docs/testing.md).

Fixed

  • A storage partition during an upload is caught within general.storage_stall_timeout (new, default 5m, 1m to 1h; #136) instead of hanging until the backup timeout: every upload (backups, PITR base backups and oplog chunks, copies, metadata snapshots, re-encryption) fails with ErrStorageStalled ("no upload progress for 5m0s to target …") when its target accepts no bytes for that long, the multipart upload is aborted and the run is recorded failed; waiting for a slow or throttled source does not count. The S3 HTTP client now bounds the wait for response headers (2 minutes) and sets explicit dial (30 s), TCP keep-alive (30 s), TLS handshake (10 s) and idle connection (90 s) timeouts. See docs/configuration.md.
  • A backward wall clock step (NTP, a restored VM) no longer makes /api/v1/health answer 503 (scheduler stale) for up to the size of the step (#137): the scheduler's liveness tick runs on a monotonic time.Ticker bound to the scheduler's lifecycle instead of the cron. Scheduled jobs stay on cron; a trigger that repeats a job's previous scheduled run within half its interval, possible when a job's schedule is rebuilt (edit or restart) after a backward step, is skipped and logged. See docs/monitoring.md.
  • A backup or restore that a crash or SIGKILL interrupted now publishes backup.failed or restore.failed when the next start marks it failed (a job run of several databases its run summary), so the alerts fire; before, the run was marked failed silently (#103).
  • Creating or moving a storage target onto or inside the location of another answers 409 with the reason, as documented, instead of 500 "internal error" (#103).
  • The abort of a failed S3 multipart upload is retried for its whole 30-second window instead of the client's three quick attempts, so a storage outage shorter than that no longer leaves the uploaded parts in the bucket (#103).
  • A backup whose record could not be saved because the data disk was full stayed in_progress and still reported success (#152). The final save is now retried for a few seconds; if it still fails the backup is reported as failed (backup.failed, a failed job run and heartbeat /fail ping, no verification.succeeded, copies or retention), the failure is logged and written to the run log, the failed record is saved once writes work again, and its complete archive is kept (the archive was kept, never archive_cleanup_pending), so the storage scan offers it for import instead of a good backup being deleted during the incident. The startup recovery of interrupted runs fails a backup left in progress but keeps an archive that exists in storage (interrupted before the record was saved; the archive was kept), so the storage scan offers it for import; only an archive smaller than its recorded size goes to the purge.
  • A full data directory no longer goes unnoticed (#152): a metadata write failing with SQLITE_FULL/ENOSPC publishes the critical event system.disk_full (to every enabled channel), raises the data_dir_full settings warning and refuses new backups and restores until space is freed (checked every 30 seconds), and every run first checks that the data directory has MONGORESCUE_MIN_FREE_SPACE_MB (-min-free-space-mb, default 100 MiB, 0 turns it off) free, failing with an error that names the free space (503). See docs/production.md.
  • Notifications are no longer lost when the process dies before they are delivered (#150). Every delivery is stored in the metadata database (notification_outbox, migration 0026) before it is sent and removed once delivered or given up, and the next start sends what is left: at least once, in order per channel, retried after 1 minute doubling to 1 hour for 8 rounds, also across restarts. The queue holds the event and the channel ID, never a rendered message or a channel secret, and is capped at 10,000 deliveries (the oldest are dropped, logged and counted as dropped). Every event now carries an ID (event_id in webhook payloads) so receivers can drop duplicates. Events still pass through the in-process bus for a few milliseconds before they are stored; see docs/notifications.md.
  • Restores, point-in-time restores and chain tests published restore.succeeded before their record was saved, so on a full data disk a restore could report success the metadata never recorded (#152). The record is now saved first; one that cannot be saved fails the restore (restore.failed), drops its safe clone (or its point-in-time clones) like any failed restore, and is saved once writes work again. Failed writes at the start of backups and restores and failed PITR chunk commits now also start a disk-full episode.
  • Only a full disk fails a backup or restore whose final record cannot be saved (#152). A transient failure (a busy or locked database, a timeout) keeps the record as it is, saves it in the background with backoff until it succeeds, and reports the run's real outcome, so a good archive or clone is never deleted over a lock.
  • A queued notification whose channel could not be loaded (a decryption failure) blocked that channel's queue for good (#150). It now counts rounds like a failed send and is given up after the same limit, and the settings report the notification_channel_unreadable warning naming the channel. A delivered notification whose removal from the outbox failed is no longer sent again in a loop: the removal (and a failed reschedule) is retried from memory with backoff.
  • Queued notifications no longer wait forever behind a failing channel or across a long downtime (#150): one older than MONGORESCUE_NOTIFICATION_MAX_AGE (-notification-max-age, default 24h) is dropped, logged and counted as mongorescue_notifications_total{status="expired"}. The docs describe the per-channel head-of-line order, and that disabling or deleting a channel discards its backlog.
  • A disk-full episode on a data directory whose free space cannot be read lasted until a restart (#152). It now also ends once a write succeeds: a small probe file in the data directory (at most every 5 seconds) or the save of a record that waited. system.disk_full is sent at most once an hour.
  • The dashboard shows the data_dir_full and notification_channel_unreadable warnings (#150, #152) in a generic warnings banner, which also shows any warning without a banner of its own, in all eight languages; a backup or restore refused for space answers 503 with Retry-After: 30.
  • The fault-injection scenarios of #150 and #152 (TestKillDuringKeyRotation's alert check, TestFullDiskOnDataDir) are no longer skipped; the chaos processes run with MONGORESCUE_MIN_FREE_SPACE_MB=1 on the suite's 48 MiB filesystem.
  • PITR: after a chain started (a new stream, a gap or a divergence), a base backup that completed before the new chain stored its first chunk no longer makes another base due at every schedule check (#141); the replica set divergence scenario took five bases in one second. The base now waits for the chain to reach its t_after like any other.
  • PITR: the collector no longer hangs when the replica set member it reads from dies or is cut off without closing its connections (#141). The tick waited on the socket until the operating system gave up, minutes later, storing nothing and raising no alert; the three-member divergence scenario saw it hold for over three minutes. Small round trips of the collector to a member (hello, the oplog's ends, lookups) now give up after one minute, and range reads after one minute without any byte received (not one minute in all, so a 16 MiB batch on a slow cross-region link still completes); the tick then fails, logs and tries again with a member that answers.
  • PITR: a stream whose chain started at the "initiating set" entry of a new replica set no longer diverges at once (#141). That entry has no term field, which the collector read as term 0 while the server reports its optime, which the collector stores, with term -1; it now reads a missing term as -1 everywhere, like the oplog codec. Found by the three-member scenarios on MongoDB 5.0.
  • PITR: a stream created on a replica set that has no majority commit point yet (just initiated) no longer starts its chain at 0:0, which the next tick took for an overrun window, ending the chain as a gap and raising a false pitr.chain_broken (#141). The collector waits for the commit point. Found by the three-member scenarios on MongoDB 5.0.

Changed

  • Point-in-time restores and their preflight need the operator role or an operator API key instead of admin (#141, design decision 8): they only add safe-clone databases, like other safe-clone restores. A restore into another connection than the stream's (target_connection_id) and chain tests stay admin, in-place point-in-time restores stay refused (#142), and a caller limited to some connections still only sees and restores their streams (#98). The MCP tool pitr_restore is offered to operator keys, and the dashboard's Restore to a time to operators.
  • CI version matrix (#141): the integration suite also runs on single-node replica sets of MongoDB 5.0, 6.0 and 7.0, so the point-in-time recovery tests run on every supported release, and the 8.0 replica set also runs with the newest Database Tools (100.19.1) next to the oldest supported (100.12.2). New jobs: Integration (MongoDB 5.0 replset, minio), Integration (MongoDB 6.0 replset, minio), Integration (MongoDB 7.0 replset, minio) and Integration (MongoDB 8.0 replset, minio, tools 100.19.1).
  • Point-in-time recovery is no longer experimental (#141): the dashboard panel and the restore wizard lose their Experimental badges, the stream API, the point-in-time body of restores, the CLI and the MCP tools are documented as supported (they follow the versioning policy from now on), and the always-true experimental field of GET /api/v1/pitr/streams/{id} is gone. docs/pitr.md is written as a supported feature, with a runbook for restoring to the minute before an accident and what is tested; the README's Known limitations keep that point-in-time restores are never in place (#142) and that sharded clusters are not supported (#58).
  • Documentation (#145): the README's Known limitations match v0.25.0 (shipped features dropped, every remaining gap linked to its issue), a new Security model summary links the threat model, delete protection, Object Lock, roles, the audit log and TLS, docs/production.md has a Production checklist (Object Lock, separate credentials and a cross-region copy, heartbeats, the offline recovery kit, the two-person rule, secondaries and windows, restore and chain tests, TLS, per-connection access, key rotation, a separate failure domain), and the release steps in CONTRIBUTING.md review both at every release.