You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
adapter: correct the comments around the read-only write-enable
Review of MaterializeInc#38399 found several claims that no longer match the code:
- The `allow_writes_in_read_only` tripwire falls back to a no-op, which
now blocks promotion rather than leaving a cold collection at cut-over,
and the storage-side check it points at is a hard assert, not a soft
panic with a fallback. Say both, and say why compute is deliberately
softer.
- Exclusive ownership of a replacement shard holds per (build version,
deploy generation), not per process. Two read-only processes of one
generation both write the shard, the same shape as a multi-replica MV,
which the self-correcting persist sink is built to tolerate.
- The replica-side handler enables persist compaction process-wide, which
this path is the first thing to trigger inside a read-only deployment.
- "Replacement" meant two unrelated things three lines apart in
`bootstrap`: user `REPLACEMENT FOR` DDL and the builtin-migration
mechanism. The sets are disjoint, so this is wording only.
- Record why a *new* builtin MV cannot be write-enabled the same way: its
shard allocation lives only in the read-only savepoint, so the promoted
leader allocates a different shard.
- Cite PR MaterializeInc#35402 for the v26.17 leader floor, and note that forcing the
replacement mechanism across all builtins, as the 0dt tests do, leaves
the caught-up gate reading its own frontiers.
The design doc stated the force-write unconditionally; give the two
conditions and the exclude-from-gate fallback.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: doc/developer/design/20251015_builtin_schema_migration.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,11 @@ Because this environment exclusively owns the replacement shard, the read-only p
81
81
This lets a migrated builtin materialized view and its dependents hydrate before cut-over instead of all at once at cut-over.
82
82
It is safe only for the self-owned replacement shard, never a shard the leader is still serving, which is why it applies to shard replacement and not schema evolution.
83
83
84
+
The force-write is conditional on two things.
85
+
First, the leader must be at v26.17 or later, because every builtin materialized view reads the catalog shard and only leaders from that version on keep its frontier advancing with the current time; against an older leader the dataflow would sit at a stale frontier.
86
+
Second, the `enable_0dt_hydrate_migrated_builtin_mvs` feature flag must be on; it exists as a break-glass revert.
87
+
When either condition does not hold, the migrated materialized views and their dependents are instead excluded from the 0dt caught-up check, which is the older behaviour: promotion proceeds without them and they hydrate at cut-over.
88
+
84
89
A leader process performing shard replacement performs the same steps as in read-only mode.
85
90
Additionally, it cleans up durable state written by earlier versions and/or deploy generations by:
86
91
- arranging for the previous shards used by the migrated storage collections to be finalized
0 commit comments