Skip to content

feat(storage): add Spanner pause scheduling schema migration - #1085

Merged
andrzejfudro merged 2 commits into
mainfrom
feat/pause-scheduling-spanner-schema
Oct 9, 2026
Merged

andrzejfudro merged 2 commits into
mainfrom
feat/pause-scheduling-spanner-schema

Conversation

@andrzejfudro

@andrzejfudro andrzejfudro commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Adds the Spanner schema migration (013_pause_scheduling.{up,down}.sql) and canonical DDL updates (ess-schema.sql) for the PauseSchedulingState and PausedTasks tables to support Pause Scheduling persistence.

  • Adds PauseSchedulingState (singleton row keyed by Id) and PausedTasks (interleaved in WorkUnits, with partial index PausedTasksUnprocessed and 7-day TTL policy) to the ESS Spanner schema and migration 013.
  • Adds //api/protos/task_queue:task_proto to experiment_messages_descriptor in api/protos/experiment/BUILD.bazel and registers the cloud.xmanager.v1.*Action proto bundle types stored in PausedTasks.ActionProto (along with updating WorkUnitState for SCHEDULING_PAUSED in migration 013).
  • Updates driverinterceptor in internal/storage/spanner/migrations/testing to skip ALTER PROTO BUNDLE UPDATE (cloud.xmanager.v1.WorkUnitStatus.WorkUnitState) during v13 up-migration in emulator tests.

Assumptions

TAG=agy

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces database migrations and schema updates to support pausing and resuming scheduling in Spanner. It adds the PauseSchedulingState and PausedTasks tables, along with corresponding index and proto bundle configurations. Additionally, it updates the migration testing framework to handle emulator-specific limitations regarding proto bundle updates. The review feedback highlights an optimization opportunity for the PausedTasksUnprocessed index: storing the Xid column and removing the redundant IsPending column from the STORING clause to ensure a fully covering index and avoid inefficient base table lookups.

@andrzejfudro
andrzejfudro added this pull request to stack #1086 October 6, 2026 07:20
@andrzejfudro
andrzejfudro force-pushed the feat/pause-scheduling-spanner-schema branch from 437834a to d106baa Compare October 7, 2026 07:23
@andrzejfudro
andrzejfudro removed this pull request from stack #1086 October 7, 2026 07:53
@andrzejfudro
andrzejfudro changed the base branch from main to refactor/decouple-pause-scheduling-storage October 7, 2026 07:54
@andrzejfudro
andrzejfudro added this pull request to stack #1117 October 7, 2026 08:43
@andrzejfudro
andrzejfudro force-pushed the feat/pause-scheduling-spanner-schema branch from d106baa to 1c29ca9 Compare October 8, 2026 06:43
@andrzejfudro
andrzejfudro removed this pull request from stack #1117 October 8, 2026 07:31
@andrzejfudro
andrzejfudro changed the base branch from refactor/decouple-pause-scheduling-storage to main October 8, 2026 07:31
@andrzejfudro
andrzejfudro added this pull request to stack #1149 October 8, 2026 07:31
@andrzejfudro
andrzejfudro marked this pull request as ready for review October 8, 2026 09:30
@github-actions
github-actions Bot requested a review from pachopepe October 8, 2026 09:30
pachopepe
pachopepe previously approved these changes Oct 8, 2026
…x comment

Update PausedTasks.ExpirationTime to TIMESTAMP_ADD(ProcessedTime, INTERVAL 7 DAY) so pending rows (ProcessedTime IS NULL) have a NULL ExpirationTime and are never deleted by the Spanner TTL policy before replay. Also clarify why the PausedTasksUnprocessed index is unsharded.

TAG=agy
CONV=aca941d1-8c29-4820-96a9-0200c1071207
@andrzejfudro
andrzejfudro force-pushed the feat/pause-scheduling-spanner-schema branch from 2ed7240 to cc4091f Compare October 9, 2026 12:04
@andrzejfudro
andrzejfudro added this pull request to the merge queue Oct 9, 2026
Merged via the queue into main with commit f5e16b5 Oct 9, 2026
12 checks passed
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.

3 participants