Skip to content

feat(config): add nested runtime availability configuration#613

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:feat/nested-availability-config-496
Jul 18, 2026
Merged

feat(config): add nested runtime availability configuration#613
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:feat/nested-availability-config-496

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

peryx fixes the meaning of its none, dc, and ha mutation modes in the availability contracts, yet an operator had no way to select one. A node's topology lived in a top-level [replication] table that predated the mode vocabulary and left no field for the durability an acknowledgement promises, so you could stand up a primary and a replica without ever stating the contract they were meant to satisfy.

This change adds the [availability] table, one surface for the mode and the topology it needs. mode selects none, dc, or ha, and an omitted table resolves the same as an explicit mode = "none", so a zero-config deployment holds no availability state beyond the resolved enum's discriminant. dc and ha require a nested [availability.replication] role, the former top-level primary/replica shape migrated intact, while none rejects one. The merge rejects a mode without its role, or a role placed under none, with a diagnostic that names the availability field, and parsing refuses an unknown key in either table before any store opens or listener binds.

The resolved value replaces the former Config replication field, so the replication runtime, the read-replica startup check, and the backup snapshot read one model rather than two, and a token_file keeps the shared credential out of both the config file and the snapshot. The configuration reference documents the nested TOML, the file-scoped precedence it shares with the index topology, the validation errors, and the secret handling. Only the mode selector lands here; the full datacenter membership model and the embedded consensus runtime that dc and ha will drive come in later issues.

Closes #496

@gaborbernat gaborbernat added the enhancement New feature or request label Jul 18, 2026
@read-the-docs-community

read-the-docs-community Bot commented Jul 18, 2026

Copy link
Copy Markdown

@gaborbernat
gaborbernat enabled auto-merge (squash) July 18, 2026 04:18
Add the `[availability]` table that selects the none, dc, or ha runtime
availability mode. An omitted table and `mode = "none"` resolve alike to
single-node operation, so a zero-config node holds no availability state
beyond the resolved enum. The dc and ha modes carry a nested
`[availability.replication]` role, migrating the former top-level
`[replication]` primary/replica shape, and none rejects one.

Replace the `Config` replication field with the availability model so the
replication runtime, the read-replica startup check, and the backup
snapshot read one model. Reject an unknown key or an impossible mode and
role pairing with a field-path diagnostic, and document the nested TOML,
precedence, validation, and secret handling.

Refs tox-dev#496
@gaborbernat
gaborbernat force-pushed the feat/nested-availability-config-496 branch from e006ae8 to c194c75 Compare July 18, 2026 04:26
@codspeed-hq

codspeed-hq Bot commented Jul 18, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 32 untouched benchmarks
⏩ 94 skipped benchmarks1


Comparing gaborbernat:feat/nested-availability-config-496 (c194c75) with main (9adc775)

Open in CodSpeed

Footnotes

  1. 94 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@gaborbernat
gaborbernat merged commit 1787df5 into tox-dev:main Jul 18, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add nested runtime availability configuration

1 participant