Repository navigation
fix(postgres): clean local push configs on task truncate - #247
Conversation
|
@codex review this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c63b5731b1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…gger support (#248) ### Motivation - Ensure TRUNCATE-based cleanup cannot run under snapshot isolation where a stale snapshot could miss concurrently committed local push configs. - Extend SQL generation, schema validation, docs, and tests to fully support statement-level `TRUNCATE` triggers and validation of their behavior. ### Description - Added a `TRUNCATE` branch to the push-config cleanup trigger that raises an exception if the current transaction isolation is `repeatable read` or `serializable` and otherwise deletes locally-owned push configs; updated generated function body in `BuildDeleteTaskPushConfigsFunctionBody` accordingly. - Introduced `kPostgresTruncateTriggerOperation` and a new error message constant to centralize the `TRUNCATE` literal and isolation error text, and updated trigger/SQL builders to use the literal consistently. - Expanded the push-schema validation SQL and parameter list to assert the presence and literal form of the `TRUNCATE` handling in the cleanup function, and increased related parameter/count constants. - Updated documentation (`book/src/server/storage.md` and `docs/storage.md`) to describe the new `AFTER TRUNCATE` trigger behavior and the transaction-isolation rejection; added/adjusted several tests and test helpers to validate the new behavior and literal-case preservation.
|
@codex review this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f7475ca8ff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review this PR |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Motivation
DELETEtriggers do not fire forTRUNCATE, allowing locally owned push configs to survive an administrativeTRUNCATE a2a_tasksand risk becoming active for a later reused task ID.TRUNCATEcannot silently leave locally owned push configs behind while preserving externally owned rows.Description
task-aware-push-config-v4and extend the cleanup function to handleTG_OP = 'TRUNCATE'by deleting all rows wherelocal_postgres_taskis true and returningNULLfor statement triggers.AFTER TRUNCATE ... FOR EACH STATEMENTtrigger (a2a_truncate_task_push_configs_trigger) wired to the same cleanup helper and create it duringauto_create_schemainitialization without changing normal per-row delete coordination.TRUNCATEremoves only locally owned push configs and that externally managed schemas are rejected when the truncate trigger is missing, and update the docs indocs/storage.mdandbook/src/server/storage.mdto document the migration and truncate semantics.Testing
./scripts/verify_changes.sh, which includesclang-format --dry-run --Werror, CMake build,ctest(full unit/functional/ integration run), andclang-tidy, and it completed successfully.build-postgresincludingStoreConformanceTest.TaskTableTruncateRemovesOnlyLocalPushConfigs,StoreConformanceTest.ExternallyManagedPushSchemaRequiresTruncateCleanupTrigger, andStoreConformanceTest.LocalTaskDeletionPreservesExternalTaskStoreConfigs, which passed in the test environment.clang-tidyon changed PostgreSQL sources and the conformance test file, and executed the performance smoke suite (./scripts/run_performance_tests.sh) which reported zero errors.mdbookwas not available in the environment and the external TCK checkout failed due to network/proxy restrictions, noted as environmental caveats.