age_global_graph: stabilize regression tests#2431
Open
jrgemignani wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR stabilizes the age_global_graph regression test output under concurrent transaction ID (xid) churn by making the snapshot used during graph-context construction deterministic, and by ensuring multi-row heap reads are ordered.
Changes:
- Wrap each 3-call
vertex_stats()context build phase in a singleBEGIN ISOLATION LEVEL REPEATABLE READ; ... COMMIT;transaction so the calls share one snapshot. - Add
ORDER BY idto direct SQL reads from_ag_label_vertexand_ag_label_edgeto avoid nondeterministic heap-scan ordering. - Update the expected regression output to match the new SQL (transaction statements + ordered SELECT output).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| regress/sql/age_global_graph.sql | Pins a single snapshot per context-build phase via REPEATABLE READ and makes label-table SELECT ordering deterministic. |
| regress/expected/age_global_graph.out | Updates expected output to reflect the added transaction statements and ordered SELECT results. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
age_global_graph: stabilize regression tests under concurrent xid load Wrap both vertex_stats() context-building phases in a single BEGIN ISOLATION LEVEL REPEATABLE READ; ... COMMIT; transaction so the three calls share one snapshot. This prevents the snapshot-fallback path in is_ggctx_invalid() from purging an already-built graph context when concurrent xid activity (autovacuum, parallel installcheck, replication, shared CI) advances the snapshot between calls, which would otherwise make the targeted delete_global_graphs(name) checks return false instead of the expected true. Read Committed is insufficient because it acquires a fresh snapshot per statement; REPEATABLE READ pins one snapshot for the whole transaction. Also add explicit ORDER BY id to the three direct-SQL label-table SELECTs (_ag_label_vertex x2, _ag_label_edge) that return multiple rows, so their output no longer depends on heap scan order. This is a test-only change (regress/sql/age_global_graph.sql and regress/expected/age_global_graph.out); no extension C code or SQL is modified. All 37 regression tests pass (installcheck) on PostgreSQL 18.3. Co-authored-by: GitHub Copilot <noreply@github.com> modified: regress/expected/age_global_graph.out modified: regress/sql/age_global_graph.sql
524767c to
e7da8f8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
age_global_graph: stabilize regression tests under concurrent xid load
Wrap both vertex_stats() context-building phases in a single BEGIN ISOLATION LEVEL REPEATABLE READ; ... COMMIT; transaction so the three calls share one snapshot. This prevents the snapshot-fallback path in is_ggctx_invalid() from purging an already-built graph context when concurrent xid activity (autovacuum, parallel installcheck, replication, shared CI) advances the snapshot between calls, which would otherwise make the targeted delete_global_graphs(name) checks return false instead of the expected true. Read Committed is insufficient because it acquires a fresh snapshot per statement; REPEATABLE READ pins one snapshot for the whole transaction.
Also add explicit ORDER BY id to the three direct-SQL label-table SELECTs (_ag_label_vertex x2, _ag_label_edge) that return multiple rows, so their output no longer depends on heap scan order.
This is a test-only change (regress/sql/age_global_graph.sql and regress/expected/age_global_graph.out); no extension C code or SQL is modified.
All 37 regression tests pass (installcheck) on PostgreSQL 18.3.
Co-authored-by: GitHub Copilot noreply@github.com
modified: regress/expected/age_global_graph.out
modified: regress/sql/age_global_graph.sql