Skip to content

Conversation

@teskje
Copy link
Contributor

@teskje teskje commented Nov 13, 2025

This PR adds a turmoil-based chaos test for builtin schema migrations. It spawns a bunch of processes at different versions, defines some random builtin schema changes, and then performs migrations through all versions. For added chaos, processes are randomly restarted all the time.

(Includes commit from #34148.)

Motivation

  • This PR adds a test.

Tips for reviewer

The first commit adjusts the builtin schema migration code by pulling the Transaction handling out of the core migration logic. Turns out that it isn't easy to construct a Transaction in tests, so pulling it to the edge makes the test code simpler.

Checklist

  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.

This commit introduces `PersistClientCache::new_for_turmoil`, as a way
to use persist in turmoil tests. In particular, this disables the
isolated runtime. Tasks that would be spawned there are instead spawned
in the current runtime. The method is gated behind a new "turmoil"
feature.
This commit reorganizes the builtin schema migration code by pulling all
`Transaction` handling into the top-level `run` function. `Migration`
becomes unaware of the existing of the `Transaction` and instead returns
a `MigrationRunResult` that informs the caller about the changes that
need to be applied.

The reason for doing this is that it makes it easier to test the core
migration code. In tests it's difficult to construct a `Transaction`
object, and with this change we don't have to do that anymore, as long
as we're invoking `Migration::run` directly.
This commit adds a turmoil-based chaos test for builtin schema
migrations. It spawns a bunch of processes at different versions,
defines some random builtin schema changes, and then performs migrations
through all versions. For added chaos, process are randomly restarted
all the time.
@teskje teskje force-pushed the builtin-item-migration-turmoil branch from 39a7377 to c98c108 Compare November 16, 2025 13:35
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.

1 participant