Skip to content

atepg: Guardrail to disallow changes to atespace tables that limit future partitioning - #1467

Open
Joe Betz (jpbetz) wants to merge 2 commits into
agent-substrate:mainfrom
jpbetz:steward/actors-partition-ready
Open

atepg: Guardrail to disallow changes to atespace tables that limit future partitioning#1467
Joe Betz (jpbetz) wants to merge 2 commits into
agent-substrate:mainfrom
jpbetz:steward/actors-partition-ready

Conversation

@jpbetz

@jpbetz Joe Betz (jpbetz) commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

This adds a test that serves as a guardrail to prevent changes to the atespace-scoped tables that would make it difficult or impossible to partition it in the future.

  • Tests pass
  • Appropriate changes to documentation are included in the PR

cc Bowei Du (@bowei) Benjamin Elder (@BenTheElder) Julian Gutierrez Oschmann (@juli4n) shrutiyam-glitch Tim Hockin (@thockin)

@jpbetz Joe Betz (jpbetz) changed the title atepg: Guardrail to disallow changes to actor table that limit future partitioning atepg: Guardrail to disallow changes to tenant tables that limit future partitioning Sep 4, 2026
@jpbetz
Joe Betz (jpbetz) force-pushed the steward/actors-partition-ready branch from fedfd9e to 09ecf26 Compare September 4, 2026 03:47
@jpbetz Joe Betz (jpbetz) changed the title atepg: Guardrail to disallow changes to tenant tables that limit future partitioning atepg: Guardrail to disallow changes to atespace-scoped tables that limit future partitioning Sep 4, 2026
@jpbetz Joe Betz (jpbetz) changed the title atepg: Guardrail to disallow changes to atespace-scoped tables that limit future partitioning atepg: Guardrail to disallow changes to atespace tables that limit future partitioning Sep 4, 2026
@EItanya

Copy link
Copy Markdown
Collaborator

Jeremy Alvis (@iplay88keys) as well

@jpbetz
Joe Betz (jpbetz) force-pushed the steward/actors-partition-ready branch from 09ecf26 to 808ac88 Compare September 4, 2026 22:29

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

bandwidth is low today but I do want to keep rolling on this, I let fable 5.1 rip:

Comment thread cmd/ateapi/internal/store/atepg/partition_test.go Outdated
Comment thread cmd/ateapi/internal/store/atepg/partition_test.go Outdated
Comment thread cmd/ateapi/internal/store/atepg/partition_test.go Outdated
Comment thread cmd/ateapi/internal/store/atepg/partition_test.go Outdated
Comment thread cmd/ateapi/internal/store/atepg/partition_test.go Outdated
Comment thread cmd/ateapi/internal/store/atepg/partition_test.go Outdated
Comment thread cmd/ateapi/internal/store/atepg/partition_test.go
Comment thread docs/dev/postgresql-schema-evolution.md Outdated
@jpbetz

Copy link
Copy Markdown
Contributor Author

Thanks Benjamin Elder (@BenTheElder) (and thanks Fable 5.1). Feedback applied

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks Joe!

Derive the atespace-scoped tables from the catalog, so a new table with
an atespace column is covered without editing the test, and fail when
the contract suite never touches a partitioned table. The previous guard
against a disconnected tracer was satisfied by a startup catalog query
that names the actors table in a string literal, so it could not fire.
The tag table, which replaced the snapshot tables, is covered this way,
and its global list takes the snapshot list's place among the statements
that span every partition by definition.

Explain every execution of a statement rather than the first one per
statement text. A NULL page token turns a one-partition scan into a scan
of every partition, so call order decided the verdict. The round trips
add about a tenth of a second per layout. Also check batched statements,
explain WITH and MERGE statements instead of skipping them, and keep the
lock out of the EXPLAIN round trip.

Use nine partitions per table. A multi-valued predicate is only reported
when its values land in different partitions, and a power-of-two modulus
takes the low bits of the hash, which puts the suite's team-a and team-b
in one partition for every modulus up to 32. Nine is the smallest that
separates the atespace names the suite creates. A subtest pins that a
lookup over team-a and team-b is reported. Every contract subtest
truncates every partition, so this costs a few seconds.

Correct the schema evolution guide: a query on actors must filter on
name as well as atespace, which is what the by-name layout enforces.
@jpbetz

Copy link
Copy Markdown
Contributor Author

Rebased to sync up with table rename

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