Replace CLI_ASYNC_DDL with DDL_EXECUTION_MODE and DDL_ASYNC_WAIT_TIMEOUT - #974
Conversation
…-36c5 Co-authored-by: apstndb <apstndb@users.noreply.github.com>
Fixes #485. SYNC waits for the LRO result. ASYNC returns the accepted operation ID. ASYNC_WAIT reuses the existing wait helper with a separate 10s budget; budget expiry hands off the still-running operation ID without canceling the server operation. Caller cancellation remains an error with that ID. --async selects ASYNC. Co-authored-by: apstndb <apstndb@users.noreply.github.com>
Code Metrics Report📊 View detailed coverage report (available for 7 days)
Details | | main (92f986d) | #974 (1a22434) | +/- |
|---------------------|----------------|----------------|-------|
+ | Coverage | 86.7% | 86.8% | +0.1% |
| Files | 112 | 112 | 0 |
| Lines | 10428 | 10486 | +58 |
+ | Covered | 9051 | 9112 | +61 |
- | Code to Test Ratio | 1:2.2 | 1:2.2 | -0.1 |
| Code | 23309 | 23491 | +182 |
+ | Test | 52940 | 53348 | +408 |
- | Test Execution Time | 2m1s | 2m3s | +2s |Code coverage of files in pull request scope (90.8% → 91.7%, patch 85.0%)
Reported by octocov |
|
Reviewed [P1] Apply the ASYNC_WAIT budget to in-flight polling RPCs. Runtime-reproduced at the poll call: the timer is only observed after Use one remaining wait budget across initial/subsequent polls as well as the between-poll wait. A deadline on the GetOperation request cancels only the polling RPC; it must never send CancelOperation for the accepted DDL. Distinguish budget expiry from caller cancellation/STATEMENT_TIMEOUT and a completed failing LRO. Add regression coverage with GetOperation actually blocked until context cancellation, plus caller-deadline precedence and the zero-budget boundary; the current timeout test only covers a immediately returning pending poll. Keep the existing poll helper and progress teardown. Existing focused DDL RPC and wait-budget tests passed independently. The new slow-poll regression fails as described, while tracked files remain unchanged (a Go test overlay supplied the blocking fake). Validation is also incomplete: the PR body lists short tests/lint/format/race and says full make check needs Docker. The accepted lane requires make check before every push. Set up/start Docker in the assigned environment, run the full gate with captured output and actual exit status, and report that evidence after the fix; passing hosted CI does not retroactively establish that local gate. Do not silently substitute short tests for it. |
The wait timer was only observed after Poll returned, so a stalled GetOperation ignored DDL_ASYNC_WAIT_TIMEOUT. Bound initial/later polls and the between-poll wait with the remaining budget. Expiry cancels only the polling RPC and hands off the operation ID; caller/STATEMENT_TIMEOUT and completed LRO failures stay distinct. Co-authored-by: apstndb <apstndb@users.noreply.github.com>
…-36c5 Co-authored-by: apstndb <apstndb@users.noreply.github.com>
|
P1 addressed on ASYNC_WAIT now applies one remaining wait budget to the initial GetOperation poll, later polls, and the between-poll wait. Budget expiry cancels only the polling RPC and hands off the still-running operation ID as a successful async submission; it never sends CancelOperation. Caller/ Regression coverage: GetOperation blocked until context cancellation, caller-deadline precedence, and the zero-budget boundary. Current PR HEAD This replies to #974 (comment) |
|
Reviewed [P1] Preserve an already-completed LRO failure when the wait budget is zero. Runtime-reproduced through the existing Admin RPC fake: UpdateDatabaseDdl returns The budget controls waiting for a still-pending operation; it must not bypass a terminal result already received from UpdateDatabaseDdl or a preceding poll. Inspect/return the cached completed operation outcome before applying the remaining wait budget (the SDK can resolve a completed operation without another RPC). Keep the pending zero-budget handoff and caller-cancellation rules intact. Include terminal errors with cancellation/deadline status codes when checking error classification, so a known operation failure cannot be mistaken for expiration of the local polling context. Prefer simplifying the wait context/error-cause handling over adding another independent timing engine. Independent existing focused tests passed; an overlay test using newCompletedDDLServer plus opErr and a zero budget fails exactly as above. No tracked files were modified. Please fix this in the existing PR, run the required full make check before push with captured output/exit, and handle CI. |
A cached Done operation from UpdateDatabaseDdl is resolved before the wait budget is applied. Poll reads that terminal result without another RPC, so a FailedPrecondition or deadline-coded LRO failure stays a failure instead of a successful async handoff. Pending zero-budget handoff is unchanged. Co-authored-by: apstndb <apstndb@users.noreply.github.com>
|
P1 addressed on Zero-budget ASYNC_WAIT now inspects a cached completed LRO before applying the remaining wait budget. This replies to #974 (comment) |
Hosted readme-sync failed during go install tool with a proxy.golang.org INTERNAL_ERROR fetching github-schema-go. Local make docs-update produces no README.md or docs/system_variables.md diff. Co-authored-by: apstndb <apstndb@users.noreply.github.com>
|
Independent review of HEAD The independent regression overlay, focused DDL tests and full Docker |
|
Independent coordinator confirmation on exact HEAD That SHA is the empty CI retrigger after P1 {"repo":"apstndb/spanner-mycli","pr":974,"head":"a3577f7227c3bd60416141525002aca752053e95","base":"92f986d6a7ab74566bee82f318b8c44e9f340820","validation":["hosted test/lint/race/readme-sync/govulncheck/cross-compile success on exact HEAD","MERGEABLE CLEAN","no unresolved review threads"],"deviations":["CLI_ASYNC_DDL removed with no bool alias","did not adopt draft #947"],"blockers":[]} |
Fixes #485.
Replace boolean
CLI_ASYNC_DDLwith driver-parityDDL_EXECUTION_MODE=SYNC|ASYNC|ASYNC_WAITandDDL_ASYNC_WAIT_TIMEOUT(default 10s).--asyncselectsASYNC.SYNCremains the default.Semantics
SHOW OPERATION.STATEMENT_TIMEOUTcancellation remains an error that includes the operation ID.CLI_ASYNC_DDLis removed (not a name-only alias). Migration:SET CLI_ASYNC_DDL = TRUE→SET DDL_EXECUTION_MODE = 'ASYNC'.Review follow-up
1ad9423(in-flight polls):72718d829ac0082e422b43df1af648c7625c507881c15ff(zero-budget completed LRO failure):744f217facb7bd4b6663d193ce6c8a665b22e561Additive merge of
origin/main92f986d(#975) is included. Draft PR #947 was inspected for wait-loop cancel timing only and was not adopted.Validation
origin/mainafter Synchronize SAVEPOINT replay cancellation before mock RPC release #975 (92f986d).make checkwith Docker (exit 0), thenmake check-race(exit 0), before push.