Repository navigation
Conversation
The integration workflow's PostgreSQL and SQLite jobs ran the wire suite with `--filter "not import_export"`. The filter came with the PostgreSQL job's first version (687e46f) and was copied into the SQLite job (556c501); neither commit gives a reason. A foreground server wrote a PID file in every tree up to e0d6a0a, which made foreground mode write none by default and added `--write-pid-file` to the job in the same commit; 556c501 came after e0d6a0a. The MongoDB and Cassandra jobs already run `tests/test_import_export.py` unfiltered. The expression selects out that file's ten tests and nothing else. Run the job's way on release builds of this tree they pass 10 of 10 on SQLite and on PostgreSQL, so both filters go and no narrower one stays. `docs/design/15-backup-restore-bench-pr11.md` (row 15d of the design index) records the cells the testing summary left open, in the PR 9 record's method: release builds, a filesystem store, the server restarted before each phase, `VmHWM` sampled every 200 ms, on the 16-core host class of the earlier records. 1M items of 200 bytes restore in 33.8 s on MongoDB (its own backup) and 49.0 s on Cassandra (a SQLite backup adopted with `backup sync`), 52 and 33 MiB over idle. A 1M-item table with a 128-dimension vector index backs up in 243 s on PostgreSQL and 210 s on SQLite and restores in 246 s and 214 s, 111 MiB and 552 MiB over idle; SQLite's figure is higher than at 100k under glibc's default arenas and is 204 MiB, flat from 100k, under `MALLOC_ARENA_MAX=1`, where the backup took 222 s and the restore 283 s. The Cassandra cells ran on a node of their own with the Cassandra workflow's service settings. No cell is left open. Later runs on the same host, also in the record, reproduce the cells and show that SQLite's restore memory is the items' lists of numbers, not the vector index: 408 MiB for the same 100k items with no index, and 301 to 316 MiB under one arena for 20,000 items of 1,536 numbers. Two restores at once under one arena took 57.5 s against 24.9 s. `docs/manuals/14-backup-and-restore.md` is the operator's manual, derived from the design: the strategy (its first sentence: a filesystem store keeps the host's failure domain, S3 is the production recommendation), RPO and RTO per store kind with the three records' figures and host class, the configuration (pointing at the admin guide's rows and the store crate's README), securing the store, what a running backup costs each database, a restore drill, catalog-loss recovery with `backup sync`, `--adopt-store` and the in-memory startup sync, legacy backups and what to do with them while `migrate-legacy` (#821) is not shipped, what a restore preserves, and moving data to and from Amazon DynamoDB with ImportTable and export (a store-prefix import is #748). It states each deployment statement the design's PR 11 acceptance lists. Figures measured for it: a 25 s PostgreSQL backup beside 12,156 overwrites of 200-byte items grew the written table from 0.4 to 4.4 MiB, its dead row versions not removable by a `VACUUM` during the backup (0.5 MiB with no backup); on SQLite the WAL grows by the pages each write changes, from 4.0 to 61.1 MiB over 15,472 writes to a table with no index during a 22.8 s backup and from 4.1 to 1,294 MiB over 13,996 writes to a table with two GSIs during a 25.6 s backup (about 24 pages per write). The manual's process-level statements were checked on release builds of this tree, SQLite and PostgreSQL: the root placement refusals and their texts, the drill, a re-created catalog's store health with an explicit store and with SQLite's default root (unconfigured, with CreateBackup writing in-catalog backups until the adoption), the accounts re-created with their old ids and old key pairs imported, the adoption, the in-memory startup sync and, on the in-memory dev build, the adopted backups refused until their account is re-created, the in-catalog create's warning and the restore of its backup through a store-configured server, an S3 store at moto with the default spool, `backup sync` exiting 6 beside a SQLite server, ImportTable refusing a gzip file and a path through a symbolic link and importing a decompressed backup data file, and on PostgreSQL the claim session found by its lock key, whose termination stops the job at its next heartbeat and leaves the row to the reconciler. The admin guide's Data Recovery entry named the PostgreSQL data database `extenddb_catalog_data`; `init` names it after the catalog without its `_catalog` suffix (`extenddb` by default). The entry now lists each backend's databases, says the two `pg_dump` runs agree only with the server stopped, and says a catalog name without the suffix needs `--data-db`. The architecture, design, quickstart and security-model guides carry the right name, and `init --help` states both defaults. The admin guide's `[backup]` section and the upgrade manual's backup paragraph point at the manual; the upgrade manual's shared-root and re-created-catalog sentences move there. The admin guide's `max_concurrent_jobs` row gives the vector restore's figures, and the deployment guide's checklist has a `[backup.store]` line. ADR-0019 and the Cassandra RFC's "Backup and restore" section carry a note: superseded in part, since CreateBackup on Cassandra still writes their in-catalog format; the RFC's lines on synchronous operations and on restored indexes carry notes too. The differences document gives the 1M MongoDB and Cassandra restore figures. `docs/build-docs.py` lists the manual as document 19 (the build renders all 19), and the README's and AGENTS.md's documentation tables have a row for it. The design's testing summary states the measured cells in place of "still to be measured", the PR 11 section's line says what shipped, and revision item 35 records the filter history, the measurements, the manual and the database-name correction. Co-authored-by: Lee <leeroyhannigan@yahoo.ie> Signed-off-by: Scott Robinson <robinnsc@amazon.com>
robinnsc
force-pushed
the
feat/backup-docs
branch
from
November 6, 2026 00:45
30553b3 to
04c2915
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backup/restore series (design: #396): #384 restore fidelity (merged) · #393 store · #394 format · #395 SnapshotEngine · #666 catalog migration framework (merged) · PR 6 the catalog index · PR 7 configuration, the store identity file and
backup purge· #700 the CreateBackup job · #740 the restore job, the cross-backend matrix andbackup remove-target· #825backup sync,--prune-missing,--adopt-store· this PR: the CI filters, the open measurement cells and the backup and restore manual · next: #820 the store-maintenance options, #821migrate-legacy, #748 export and import through the store.Closes #747 (part of #624).
Stacked on #825 (
feat/backup-sync, head358ff8bd), opened as a draft against it. The diff is one workflow file, documentation, and one source change: the help text ofinit --data-dband--catalog-db(crates/app/src/cmd_init.rs), which named the old defaults. The binaries every figure and check below used are release builds of this tree (358ff8bdplus this diff); the help text is the only source line the diff changes, so builds before and after it serve the same requests.What
CI filters (
.github/workflows/integration.yml). The PostgreSQL job's and the SQLite job's "Run integration tests" steps drop--filter "not import_export". History: the filter came with the PostgreSQL job's first version (687e46f, "ci: add integration test workflow with PostgreSQL") and was copied into the SQLite job (556c501); neither commit gives a reason. A foreground server wrote a PID file in every tree up to e0d6a0a (crates/bin/src/cmd_serve.rsat 687e46f,crates/server/src/serve.rsat e0d6a0a^), sostopcould signal the job's server. e0d6a0a made foreground mode write no PID file by default and added--write-pid-fileto the job's start in the same commit. 556c501 came after e0d6a0a (git merge-base --is-ancestor e0d6a0af 556c501e), and its SQLite job passes the flag. The MongoDB and Cassandra jobs already runtests/test_import_export.pyunfiltered (--pytest --comprehensive --parallel). What the expression selects out (collect-only, Python 3.10, the job's own ignore list): the 10 tests oftests/test_import_export.pyand nothing else (0 of 502 comprehensive, 0 of the 52 CLI lifecycle tests, 0 of the 18 backup-store step tests). Run the job's way (release build,init,serve --foreground --write-pid-file, the job's environment,run-tests --extenddb --pytest --parallel --filter import_export): the main pytest step passed 10 of 10 on SQLite and on PostgreSQL. That command exits 1, because its later steps select nothing under the filter (on SQLite the backup-store step's 18 tests are deselected, on PostgreSQL the CLI lifecycle list's 52) and pytest exits 5 there. No test fails, so both filters go and no narrower filter is kept.The open measurement cells (
docs/design/15-backup-restore-bench-pr11.md, new; row 15d ofdocs/design/README.mdbeside 15b and 15c). In the PR 9 record's method: release builds, a filesystem store,[backup] max_concurrent_jobs = 2, the table loaded through the wire from four processes of eight threads, the script'scontrol_plane_delay_seconds = 0.05andindex_propagation_delay_ms = 0, the server restarted before each phase,VmHWMread one second after the start and one second after the phase and sampled every 200 ms. The plain items' 200-byte pad is one repeated character, which the record states. Host: 16 cores (Xeon Platinum 8124M), 30 GiB, Linux 5.10, glibc 2.26; PostgreSQL 16.15 with pgvector 0.8.7, MongoDB 7.0.43, Cassandra 4.1.12, each in a container on loopback; one run each, load average beside each figure.backup sync)MALLOC_ARENA_MAX=1The 100k cells for each shape are in the record. From 100k to 1M the restore's peak moved +16.7 MiB on MongoDB, +13.2 on Cassandra, +10.5 on PostgreSQL with a vector index, and +198 MiB on SQLite with a vector index under the default arenas (the 1M run levelled off after about 150 s; no other size was measured) against +8.6 MiB under one arena. One arena cost that restore 32% in duration. A whole-table
SearchVectorsover the 1M restored vectors answered in 0.24 s on PostgreSQL and 14.7 s on SQLite (an exact scan). No cell is left open: the 1M Cassandra restore finished. It ran on a Cassandra 4.1 node of its own with the Cassandra integration workflow's service settings (PasswordAuthenticator,MAX_HEAP_SIZE=1024M), under the Cassandra lock, removed afterwards: the shared node on this host runsAllowAllAuthenticator, whereextenddb initcannot create its role, and it was not reconfigured. The record says the node was used by these runs alone.The record's "Later runs on the same host" section holds a second set of runs on release builds of 30553b3 (this tree's sources before the help-text line), on the same host, with a separate harness and the server's default settings. They reproduce every cell in kind (within 12% on the peak, 20% on the durations; the SQLite 1M vector restore 522.8 MiB, 218.7 s) and add:
The manual (
docs/manuals/14-backup-and-restore.md, new), for operators and derived from the design, which remains the record. Its first sentence: a filesystem store keeps the backups in the host's failure domain, so S3 is the production recommendation. Sections: strategy (what a table backup holds and does not: the catalog, scheduling with a crontab line that escapes%and namesAWS_CA_BUNDLE, retention, PITR; Cassandra's in-catalog create); RPO and RTO per store kind (RPO equals the backup interval, no PITR; the restore and backup durations and the memory figures from the three records and the later runs, with the host class and what was not measured;MALLOC_ARENA_MAX=1recommended on a SQLite host that restores tables whose items carry long lists of numbers, with or without a vector index, with its duration cost for one job and for two); configuration (filesystem and S3 examples, the root that must exist, pointing at the admin guide's[backup]and[backup.store]rows andcrates/backup-store/README.md); securing the store (including that the check does not probekms:Decrypt); what a running backup costs each database; a restore drill (with the copy modes an off-host drill needs); catalog-loss recovery withbackup sync(a catalog restored from a dump, a re-created catalog with--adopt-storein both SQLite shapes, the in-memory startup sync and the accounts it needs re-created); legacy backups (they stay restorable;migrate-legacyis #821, so the manual gives today's path: restore, back up again with a store, check, delete); what a restore preserves (the table the differences document carries, with its one gap); and moving data to and from Amazon DynamoDB (the format is the S3 export layout; the service's ImportTable parameters and that it creates no LSI; ExtendDB's ImportTable reads one uncompressed local file named by its canonical path; the export'sFilePath; a store-prefix import is #748, not in this release).Each statement of the design's PR 11 acceptance is in the manual: the first-sentence failure domain and S3 recommendation; encryption at rest is the store's job; a copy tool runs as the server's user or as root, and a root under a storage administrator's directory, an NFS mount owned by
nobodyor a group-writable parent without the sticky bit is refused; a bind mount or a filesystem without Unix permission semantics is outside what the store observes, and a root mounted with a mask that reports0700enforces nothing;AbortIncompleteMultipartUpload, and for a versioned bucketNoncurrentVersionExpirationandExpiredObjectDeleteMarker; the least-privilege IAM policy (pointed at); a PostgreSQL snapshot retains every dead row version and the SQLite WAL grows during a backup, with figures measured for the manual (below); the claim connection's keepalive bound (30 s idle, three probes 10 s apart: about a minute) andpg_terminate_backendon the claim's session, with the query that finds it by its lock key in the catalog database; a transaction-mode pooler is unsupported; the SDK'stracelogs carry the session token; write access to an account's prefix is backup-administrator authority for that account, with per-account IAM prefix policies; MongoDB'sminSnapshotHistoryWindowInSeconds.Figures measured for the manual, same host class, release builds, 100k-item vector tables as the backup's source: on PostgreSQL a 25.2 s backup beside 12,156
PutItemoverwrites of 1,000 200-byte items in another table grew that table from 0.4 to 4.4 MiB, and aVACUUM (VERBOSE)10 s into the backup reported 4,948 row versions "dead but not yet removable"; the same writer for the same time with no backup left the table at 0.5 MiB, and the firstVACUUMafter the backup removed every dead version. On SQLite the WAL grows by the pages each write changes, which depends on the table's indexes. A 22.8 s backup beside 15,472 such writes to a table with no secondary index grew the-walfile from 4.0 to 61.1 MiB, about 3.9 KB per write. The same writer on a table with two GSIs grew it from 4.1 to 1,294.1 MiB over 13,996 writes in a 25.6 s backup (96.6 KB per write), 58.7 to 1,277.6 MiB over 13,953 writes in a second run on a WAL already grown (91.6 KB), and 4.1 to 1,261.8 MiB over 13,891 writes in 26.0 s in the run on this tree (94.9 KB, load 3.7). With no backup the writers left it at 4.0 and 4.1 MiB, and the file kept its size after the backup and after the server stopped. The manual's sizing rule names the indexes: about one 4 KiB page per write for a table with no index and about 24 for a table with two GSIs, since an asynchronous GSI write goes throughgsi_pendingand is applied in later transactions.Binary checks of the manual's process-level statements (release builds of this tree, SQLite and PostgreSQL unless named):
0775parent: startup error, "has mode 0775 and is writable by group or others without the sticky bit"; a0755root: "chmod it to 0700 (on a filesystem without Unix permissions, mount it with a mask that yields 0700)"; a0700root under a1777parent starts healthy; an absent configured root stops startup, "backup root is not usable: No such file or directory (os error 2)".CREATINGfrom both requests,AVAILABLE,ACTIVE, the count equal;backup listbeside a running server. An off-host copy with0755/0644modes makes the drill deployment's store unhealthy and refuses the restore; with the modes kept the copy adopts and restores.[backup.store]configured explicitly: the database removed andinitrun again;/healthreports"reason":"owned by another catalog",degraded;DescribeBackupisBackupNotFoundException; plainbackup syncexits 1;--adopt-storeadopts (its output quoted in the manual), the store is healthy and the backup restores. Plainsyncon an owned root reports the prefix as having a row.[backup.store]section): the server logs "the default root ... failed its check (extenddb-store.json names catalog ; this catalog is ); the catalog has no backup rows for it, so the store is unconfigured and CreateBackup writes in-catalog backups",/healthis{"components":{},"status":"healthy"}, and aCreateBackupanswersAVAILABLEwith the in-catalog warning. The account re-created withmanage create-account --account-id 123456789012, its user and policy, and the old key pair imported withmanage import-access-key ... --yes: the old key pair signs requests again.--adopt-storebeside the running server exits 6 ("another extenddb process is already using ..."); with it stopped, plain sync exits 1 and--adopt-storeexits 0; restarted,backup_storeis healthy, the old backup and the in-catalog one areAVAILABLE, and the old one restores with 300 of 300 items.DescribeBackupAVAILABLEin the new catalog once its account exists, the restore,backup listrefused with exit 1. On thesqlite-memory,dev-modebuild: a backup taken in the first start's default account (995720651603); the second start's default account was 823675310910,ListBackupslisted nothing andDescribeBackupansweredAccessDeniedExceptionafter the line "startup sync of the in-memory catalog: 1 backup(s) adopted"; aftermanage create-account --account-id 995720651603, a user, a policy and a key,DescribeBackupansweredAVAILABLEand the restore reachedACTIVEwith 300 of 300 items.kind = "disabled": the in-catalog create answersAVAILABLEand logs the deprecation warning; with the store back,ListBackupslists both kinds, the legacy backup restores, the restored table backs up to the store,backup listlists only store rows;backup migrate-legacyis an unrecognized subcommand.<prefix><account>/<table>/<id>/besideextenddb-store.json, a restore throughbackup-spool/beside the database file.backup syncbeside a running SQLite server exits 6 ("another extenddb process is already using ...").FileSource.Paththrough a symbolic link (/hometo/local/homeon this host) is refused, "Path must resolve under one of the configured allowed paths", whether the[import] pathsentry is written through the link or not; the canonical path imports with either entry. Export writes one uncompressed{"Item": ...}file under the account's directory, atFilePath, or atS3PrefixwhenFilePathis absent;S3Bucketalone is refused, "Either FilePath or S3Prefix must be provided".manage create-account --helpnames--account-id;manage import-access-key --helpnames--account-id,--user-name,--access-key-id,--secret-access-keyand--yes;init --helpgives the two new defaults.init --catalog-db <name>_catalogcreates the data database<name>and recordsdata_database_name. The claim session is found byhashtextextended('backup:<backup id>', 4539474)inpg_locks(and a restore's by<account id>/<table>), distinct from theextenddb serveregistration session; with two catalogs on one cluster holding the same key, the query without a database predicate returned both sessions, and withl.databaselimited to the current database (as the manual gives it) only its own. Terminating the claim stopped the job 13 s later at its heartbeat ("stopped with no further store or catalog access"), and withstale_job_after_secs = 45the reconciler failed the row and deleted its partial objects 47 s after the termination. Terminating the registration session as well (a first run that ended every advisory holder) makes the server answerServiceUnavailablewhile it registers again, which the manual warns against./health"reason":"manifest probe failed",CreateBackupand the restore of an older backup refused, plainsyncand--prune-missingexit 1 ("sync changes no row while the store is unhealthy"), still unhealthy after a restart. The manual says this release has no command that clears it without a copy of the prefix, and to take the catalog dump after deletions.Other documentation. The admin guide's Data Recovery entry named the PostgreSQL data database
extenddb_catalog_data;initderives it from the catalog's name without_catalog(extenddbby default) and records it insettingsasdata_database_name. The entry now has a table of each backend's databases, says that a catalog name without the suffix needs--data-db, and gives thepg_dumplines with the server stopped (eachpg_dumptakes its own snapshot of one database, so two dumps beside a running server disagree when a table is created or deleted between them), or a base backup of the PostgreSQL server holding both. The same wrong name is corrected in the architecture, design and security-model guides; the quickstart's--data-dbrow gave<catalog>_dataand now gives the derived name; the design guide's settings key wasdata_database_urland isdata_database_connection_string(anddata_database_name);init --helpsaid "Data database name (default: extenddb)" and "Catalog database name (default: _catalog)", and now says "the catalog's name without its_catalogsuffix" and "extenddb_catalog, or the config file's" (bootstrapper.rs: the catalog never derives from--data-db).git grep '<catalog>_data\|<data-db>_catalog\|data_database_url'finds nothing. The admin guide's[backup]section and the upgrade manual's backup paragraph point at the manual; the upgrade manual's shared-root and re-created-catalog sentences move to the manual, which states both. The admin guide'smax_concurrent_jobsrow adds the vector restore's figures on SQLite and points at the manual's. The deployment guide's PostgreSQL checklist has "Configure[backup.store](S3 for production) per the Backup and Restore manual", and its backup mentions and service-unit comment point at the manual. The differences document's restore row gives the 1M Cassandra (49.0 s) and MongoDB (33.8 s) restores with a pointer to the PR 11 record. ADR-0019 (status and index row) and the Cassandra RFC's "Backup and restore" section carry a short note pointing at the manual and the design: superseded in part, since CreateBackup on Cassandra still writes their in-catalog format, before it returns. The ADR's note adds that the reconciler now removes an in-catalog backup whose CreateBackup did not finish, so its Negative consequence about a future reconciliation worker no longer holds for the create. The RFC's section 4 line on synchronous data movement and its Known Gaps lines on synchronous backup and restore and on restored indexes carry "Superseded in part" notes.docs/adr/README.mdsays an ADR is never edited after acceptance except to update its Status, while design section 10 asks for a note at the top of ADR-0019. The maintainer chooses which rule wins: a "Superseded in part by" status allowed in the README with the note kept, or the ADR back to a Status-only change and the note moved to the design.docs/build-docs.pylists the manual as document 19; the full build ran on this host (Python 3.10, WeasyPrint 70.0): 19 HTML, 19 PDF, 0 failed. The README's and AGENTS.md's documentation tables have a row for it.Design (
docs/design/15-backup-restore.md). The testing summary's "still to be measured" sentence now states the measured cells, what the vector restore's memory belongs to and the vector index's share of the restore's duration (earlier revision items keep their wording); the PR 11 section's line says what shipped; section 10's closing paragraph says what the ADR, the RFC and the two manuals now carry; revision item 35 records the filter history, the measurements, the manual's place and checks, and the database-name correction. The design's revision items 32 to 34 already exist, so this PR's item is 35. The bench record's Durations section gives the one-arena SQLite backup (222 s) and restore (283 s) separately.Cross-references with #737
#737 (open, another author's) touches four files this PR also edits:
05-admin-guide.md,07-upgrade-manual.md,10-security-model.mdand11-deployment-guide.md. It is not on this branch and nothing it adds is edited here. The overlaps:pg_dumplines with the server stopped or a base backup). The manual links to that entry.CreateBackupstores each table backup in the deployment's own database, in the catalog'sbackupsandbackup_itemstables", which is false of this series once a backup store is configured.Whichever of the two lands second reconciles these: the entry's anchor and body, the security model's block, its CreateBackup sentence, and the manual's links.
Verification
cargo fmt --all -- --check: clean.cargo build -p extenddb-appandcargo clippy -p extenddb-app --all-targets --no-deps -- -D warnings: clean. No test or snapshot holds theinit --helptext.cargo test -p extenddb-storage-postgres --test doc_version_literals: 3 passed (the manual carries no binary version literal; the record's service versions are not flagged).integration.yml: only the pre-existing custom runner-label findings.docs/build-docs.pyon an exported copy of the tree (Python 3.10, WeasyPrint 70.0): 19 HTML, 19 PDF, 0 failed.git grep '<catalog>_data\|<data-db>_catalog\|data_database_url': no hit;extenddb_catalog_dataonly in revision item 35, as history.Not here
migrate-legacy(Backup/restore: backup migrate-legacy #821), the store-maintenance options (Backup/restore: backup sync --move-store, --forget-store, --forget-backup #820), export and import through the store (Backup/restore: export and import through the store #748).init --catalog-dbwith a name that lacks the_catalogsuffix derives the catalog's own name for the data database, creates the database once, fails on the second create with "Run 'destroy' first", and leaves an empty database behind with no config file fordestroyto read. An existinginitdefect; the admin guide now says such a name needs--data-db.AVAILABLEbackup was deleted after the dump keeps its store unhealthy (every store operation refused, across restarts), and this release has no remedy without a copy of that backup's prefix:--prune-missingrefuses while the store is unhealthy. The manual states it and says to take the dump after deletions.