Skip to content

[PartitionStore] Enable use-multi-db-layout for multi-db transition#4789

Open
AhmedSoliman wants to merge 3 commits into
mainfrom
pr4789
Open

[PartitionStore] Enable use-multi-db-layout for multi-db transition#4789
AhmedSoliman wants to merge 3 commits into
mainfrom
pr4789

Conversation

@AhmedSoliman
Copy link
Copy Markdown
Contributor

@AhmedSoliman AhmedSoliman commented May 21, 2026

The strategy is to allow nodes to start with RESTATE_WORKER__USE_MULTI_DB_LAYOUT=true when empty
and they'll provision their partition store with the multi-db layout. The layout choice is persisted
in the cluster marker and on future runs, it will be used as the source of truth. This makes it safe
to enable this option on all nodes of a cluster safely, only new nodes will respect it.

If/when we need to support a migration from single-db to multi-db layout, we'll trigger this transition
on node startup and update the marker accordingly. This makes the migration compatible with older nodes.

  • Persist the database layout choice (single-db vs multi-db) in the cluster
    marker on first provisioning, so nodes consistently open partition stores
    under the layout the cluster was created with. The layout flag flows from
    the ClusterMarker returned by validate_or_create into
    PartitionStoreManager, which uses it to compute per-partition DbNames.

  • All existing tests have been updated to use the new use_multi_db_layout to increase confidence.

  • Record the cluster fingerprint in the marker on provisioning. Not
    consumed yet — lays the groundwork for validating that a node's data
    directory belongs to the cluster it is being asked to join.

  • Remove the db_name field from the sql partitions, the field isn't useful in
    investigations and will require some plumbing if we want to keep it. I deemed it to be not worth the effort.


Stack created with Sapling. Best reviewed with ReviewStack.

@AhmedSoliman AhmedSoliman changed the title Native support for multi-db-layout [PartitionStore] Enable use-multi-db-layout for multi-db transition May 21, 2026
@AhmedSoliman AhmedSoliman marked this pull request as ready for review May 21, 2026 22:30
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

Test Results

  8 files  ± 0    8 suites  ±0   2m 41s ⏱️ - 2m 4s
 43 tests  - 17   43 ✅  - 17  0 💤 ±0  0 ❌ ±0 
186 runs   - 81  186 ✅  - 81  0 💤 ±0  0 ❌ ±0 

Results for commit 7ba29a6. ± Comparison against base commit ec29d04.

This pull request removes 17 tests.
dev.restate.sdktesting.tests.Combinators ‑ awakeableOrTimeoutUsingAwaitAny(Client)
dev.restate.sdktesting.tests.Combinators ‑ firstSuccessfulCompletedAwakeable(Client)
dev.restate.sdktesting.tests.Combinators ‑ mixedAllCompletedRunSignalAndFailedRun(Client)
dev.restate.sdktesting.tests.Combinators ‑ mixedAllSucceededRunAndSignal(Client)
dev.restate.sdktesting.tests.Combinators ‑ mixedRunWinsRaceAgainstSignal(Client)
dev.restate.sdktesting.tests.Combinators ‑ mixedSignalWinsAfterRunFails(Client)
dev.restate.sdktesting.tests.Combinators ‑ signalAllCompleted(Client)
dev.restate.sdktesting.tests.Combinators ‑ signalAllSuccessfulOrFirstFailed(Client)
dev.restate.sdktesting.tests.Combinators ‑ signalFirstCompleted(Client)
dev.restate.sdktesting.tests.Combinators ‑ signalFirstSuccessfulOrAllFailed(Client)
…

♻️ This comment has been updated with latest results.

@tillrohrmann tillrohrmann added this to the 1.7 milestone May 22, 2026
The strategy is to allow nodes to start with `RESTATE_WORKER__USE_MULTI_DB_LAYOUT=true` when empty
and they'll provision their partition store with the multi-db layout. The layout choice is persisted
in the cluster marker and on future runs, it will be used as the source of truth. This makes it safe
to enable this option on all nodes of a cluster safely, only new nodes will respect it.

If/when we need to support a migration from single-db to multi-db layout, we'll trigger this transition
on node startup and update the marker accordingly. This makes the migration compatible with older nodes.


- Persist the database layout choice (single-db vs multi-db) in the cluster
marker on first provisioning, so nodes consistently open partition stores
under the layout the cluster was created with. The layout flag flows from
the `ClusterMarker` returned by `validate_or_create` into
`PartitionStoreManager`, which uses it to compute per-partition `DbName`s.

- All existing tests have been updated to use the new `use_multi_db_layout` to increase confidence.

- Record the cluster fingerprint in the marker on provisioning. Not
consumed yet — lays the groundwork for validating that a node's data
directory belongs to the cluster it is being asked to join.

- Remove the `db_name` field from the sql `partitions`, the field isn't useful in
investigations and will require some plumbing if we want to keep it. I deemed it to be not worth the effort.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants