Repository navigation
docs: describe the PostgreSQL read replica mode as a proposal - #584
Open
LeeroyHannigan wants to merge 1 commit into
Open
LeeroyHannigan wants to merge 1 commit into
LeeroyHannigan wants to merge 1 commit into
Conversation
…rrent behaviour Four design documents stated a read replica mode in the present tense: a storage.postgres.read_replica_url setting with read_replica_pool_size, a read_pool field on PostgresEngine, a read_pool() helper, and ConsistentRead=false reads routed to a streaming replica. None of it exists: grep read_replica over crates/ returns nothing, PostgresConfig carries deny_unknown_fields, and every item read and write runs on data_pool. An operator who copied read_replica_url from the configuration reference got a server that refused to start. - 01-requirements: REQ-DATA-015 states what the backends do (the flag reaches storage as ReadOptions::consistent_read; every in-tree backend serves both values from the copy that took the write) and REQ-PG-008 is marked proposed with the startup refusal named. - 02-high-level-design 4.7: the decision is strongly consistent reads today, the replica route a proposal; the rationale bullets are in the conditional. - 04-component-storage 5.2: the pool sketch is labelled a proposal (5.3 is rewritten by #559). - 08-component-config: the read_replica_url environment row and the two sample lines are removed, since the setting stops the server. - technical-debt F-2 and the TODO index line say the same in the same tense. Closes #561
LeeroyHannigan
requested review from
amrith,
c33howard,
jcshepherd,
pdf-amzn,
robinnsc and
yesyayen
as code owners
October 25, 2026 22:27
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.
What
Four design documents and the technical debt register described a PostgreSQL read replica mode as current behaviour: a
storage.postgres.read_replica_urlsetting, aread_replica_pool_size, aread_pool()selected per read, andConsistentRead=falsereads routed to a streaming replica. None of that is in the repository. The PostgreSQL backend serves every item read and write fromdata_pool, andPostgresStorageConfigcarries#[serde(deny_unknown_fields)], so a configuration that copiesread_replica_urlfrom the documents stops the server at startup.The documents now state what the backend does and label the replica mode a proposal.
docs/design/01-requirements.md: REQ-DATA-015 states that the parameter is accepted and charged and that no in-tree backend routes a read on it. REQ-PG-008 is marked proposed, names the struct that refuses the keys, says every item read and write runs ondata_pool, and points at both proposals (document 04 section 5.3 with one replica URL, document 11 Stage 2 with areplicaslist).docs/design/02-high-level-design.md: section 4.7 states the decision as the PostgreSQL backend serving every item read from the pool that takes the writes, with the replica routing as a proposal; the rationale bullets are rewritten in that tense.docs/design/04-component-storage.md: the section 5.2 sketch carries a label saying it is a proposal, that itspoolpredates the catalog and data pool split and stands for today'sdata_pool, and that the two keys stop the server. Section 5.3 is left to feat(storage): carry ConsistentRead to the data engine as ReadOptions #559, which rewrites it.docs/design/08-component-config.md: theread_replica_urlenvironment variable row and the two sample lines are removed, since a configuration carrying them does not load.docs/technical-debt.md: the F-2 row says the twoConsistentReadvalues are served the same way on every backend, and its line reference is corrected toitem.rs:176.Why
Closes #561.
An operator who followed document 08 got a server that refused to start. A backend author reading documents 01, 02 or 04 would have built against a
read_pooland a configuration field that do not exist. The TODO atcrates/core/src/types/item.rs:176is the only trace of the mode in code and it is future tense.Testing done
Documentation only; no code or test changes. Each statement in the new text was checked against the source at
744ea291:git grep read_replicaandgit grep read_poolundercrates/return nothing;deny_unknown_fieldsis onPostgresStorageConfigincrates/storage-postgres/src/config.rs;get_item_impl,query_impl,scan_impland the item writes useself.data_pool; the capacity charge is incrates/engine/src/capacity_helpers.rs. The new text does not depend on #559: it names neitherReadOptionsnor ADR-0024, andgit merge-treeof this branch withfeat/read-optionsproduces a clean tree in either order.Checklist
Storagetrait, auth model, on-diskformat, or public CLI surface, an RFC has been accepted or is linked
below. Otherwise, an ADR captures the decision (link below).
ADR / RFC: n/a (documentation correction; the decision the documents now describe is the one in the code)
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.