Add KEEP_TRANSACTION_ALIVE without weakening owner isolation - #977
Conversation
Make transaction keepalive configurable. Default TRUE preserves existing heartbeat after first explicit RW user SQL. The policy is frozen on the logical owner with the constructor snapshot, including SAVEPOINT reconstruction. SET LOCAL is not supported. Fixes #965 Co-authored-by: apstndb <apstndb@users.noreply.github.com>
…cy-965-06a6 Co-authored-by: apstndb <apstndb@users.noreply.github.com>
Integration session helpers built systemVariables literals whose bool zero-value froze keepalive off. Seed the historical TRUE default there and update initializeSystemVariables expected structs. Co-authored-by: apstndb <apstndb@users.noreply.github.com>
Code Metrics Report📊 View detailed coverage report (available for 7 days)
Details | | main (31f52f5) | #977 (907dbc2) | +/- |
|---------------------|----------------|----------------|-------|
- | Coverage | 86.8% | 86.5% | -0.4% |
| Files | 112 | 113 | +1 |
| Lines | 10486 | 10678 | +192 |
+ | Covered | 9112 | 9241 | +129 |
+ | Code to Test Ratio | 1:2.2 | 1:2.2 | +0.0 |
| Code | 23491 | 23860 | +369 |
+ | Test | 53348 | 54538 | +1190 |
+ | Test Execution Time | 2m0s | 1m58s | -2s |Code coverage of files in pull request scope (88.9% → 87.1%, patch 100.0%)
Reported by octocov |
|
Reviewing Please correct the user-facing deadline claim before final acceptance. README and generated KEEP_TRANSACTION_ALIVE help currently say disabling keepalive does not disable idle-deadline/TRANSACTION_TIMEOUT enforcement, although #357/#482 are not implemented (the PR body correctly calls them future work). State explicitly that those policies are not yet implemented and are separate follow-up work, or omit claims of present enforcement. Regenerate docs/system_variables.md from the corrected varDef; keep docs/spanner-driver-compatibility.md equally clear. This needs no new runtime abstraction or deadline implementation in this PR. Run the required make check before pushing and own CI as usual. |
|
Docs-only fix for the deadline wording: README, varDef help, generated |
|
Replying to #977 (comment) Fixing commit: README, generated KEEP_TRANSACTION_ALIVE help, and
|
|
Independent coordinator confirmation on exact HEAD Docs-only follow-up: README, generated help/ {"repo":"apstndb/spanner-mycli","pr":977,"head":"f7c73e5cb6617eff408cee4096a5f5abe375d0d7","base":"92f986d6a7ab74566bee82f318b8c44e9f340820","validation":["hosted test/lint/race/readme-sync/govulncheck/cross-compile success on exact HEAD","MERGEABLE CLEAN","no unresolved review threads"],"deviations":[],"blockers":[]} |
|
Independent review of HEAD Independent focused policy tests, full Docker Final integration order is #976, then this PR, so avoid another redundant base update until #976 merges. Then additively integrate origin/main, retain reset support for KEEP_TRANSACTION_ALIVE, run the mandatory gate before push, and handle all CI. Codex will review that integration HEAD before merging. |
|
Withdrawing the ready JSON for |
|
Acknowledging Codex integration order: wait for #976 to merge, then additively merge origin/main. Stopping the in-flight main merge on this branch. No new commits until then. |
4d92e99 to
f7c73e5
Compare
|
Stopped the #974 main merge per Codex integration order (#976 first, then this PR). The additive merge No further |
…cy-965-06a6 # Conflicts: # docs/system_variables.md Co-authored-by: apstndb <apstndb@users.noreply.github.com>
|
Additive-merged Only conflict was the generated table in Local |
|
Independent coordinator confirmation on exact HEAD Additive main merge after #976. Worker reports KEEP_TRANSACTION_ALIVE remains resettable; idle-deadline / TRANSACTION_TIMEOUT wording unchanged; local {"repo":"apstndb/spanner-mycli","pr":977,"head":"9a6b1a00b650da67bdd0aa11d7dccacafba35c05","base":"83ae3abccc3105687d34931727e1db694bb34950","validation":["hosted test/lint/race/readme-sync/govulncheck/cross-compile success on exact HEAD","worker local make check exit 0","worker local make check-race exit 0","MERGEABLE CLEAN","no unresolved review threads"],"deviations":[],"blockers":[]} |
|
Independent review of current HEAD The integration with #976 preserves all RESET/DDL additions. I inspected the merge and its only manual conflict resolution, the generated system-variable documentation; the production delta remains the reviewed keepalive policy. An additional independent test on this HEAD confirmed that RESET ALL restores a startup KEEP_TRANSACTION_ALIVE=FALSE override after SET TRUE, alongside the keepalive and consumed/empty startup tag tests. Independent focused tests, full Docker This acceptance applies only to the current source. The previously reported published-history rewrite was unauthorized and is retained as a separate workflow incident; no further history rewriting is authorized. |
Add statement and registry RESET cases for the keepalive session variable now on main, including --set startup restore and isolation from unrelated LOCAL undo. Co-authored-by: apstndb <apstndb@users.noreply.github.com>
Fixes #965.
Add
KEEP_TRANSACTION_ALIVEso explicit read-write owners can opt out of keepalive heartbeats.TRUE(the default) preserves existing mycli behavior: heartbeat starts after the first user SQL on an explicit RW owner. That differs from JavaKEEP_TRANSACTION_ALIVE, which defaults tofalse; this PR does not copy that default.The policy is frozen on the logical owner together with the constructor/
ctorOptssnapshot from #972. Changing the session default does not alter an active or SAVEPOINT-reconstructed owner. Disabling keepalive prevents heartbeat scheduling for that owner and does not revive discarded-attempt callbacks. User SQL, COMMIT, ROLLBACK, and cancellation stay functional.SET LOCALis not supported.This PR does not implement #482
TRANSACTION_TIMEOUTor #357 idle expiry. Disabling keepalive does not disable those future deadlines, and heartbeat traffic is not user activity.Validation: focused fake-RPC tests for default-on RPCs, disabled no-RPC, frozen mid-transaction SET, pending activation, replacement owners, SAVEPOINT preserve/disable, delayed-tick isolation, and automatic DML enqueue;
make check;make check-race.Base: additive-merged
origin/main92f986d6a7ab74566bee82f318b8c44e9f340820(#975) after implementing onf10a4da(#972).