Repository navigation
harness: the MSSQL CDC capture wait ends on the instance's change row, not on the database max LSN advancing - #1246
Open
panchenkoai wants to merge 1 commit into
Open
panchenkoai wants to merge 1 commit into
panchenkoai wants to merge 1 commit into
Conversation
…, not on the database max LSN advancing A DDL on a tracked table advances sys.fn_cdc_get_max_lsn() with no change-table row, so the wait released before the capture job had harvested the last insert and rivet opened its window on a max LSN that did not yet cover it (no_silent_null_cdc[mssql], cdc-removed leg, 1 of 1 change rows not delivered). The wait now polls cdc.<instance>_CT for the last write's row, returns False with a stderr line when it never lands, and the callers that grade a run raise instead of grading an undrained one.
This branch has not been deployed
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.
Why
Nightly Gate run 45603119161 (job 139166893594, oracle-scenarios) failed
no_silent_null_cdc[mssql]: NO_OUTPUT over 10 source->override pairs, only on the cdc-removed leg (1 of 1 change rows not delivered, insert:2003). The stage took 206 s against 146 s the night before, and two later re-runs at the same sha were green._wait_mssql_capturedreleased as soon as the database-widesys.fn_cdc_get_max_lsn()moved past a value read before the write. A DDL on a tracked table advances that max LSN with no change-table row, so the wait released before the capture job had harvested the last insert. rivet then read its upper bound (fn_cdc_get_max_lsn()at open, src/source/mssql/cdc.rs) before the row was covered and drained nothing with exit 0.wait_untilreturned False on timeout and every caller ignored it, so a wait that never succeeded read the same as one that did (the +60 s in the CI log is consistent with two silent 30 s timeouts).What
_wait_mssql_captured(url, instance, op, row_id)pollscdc.<instance>_CTfor the LAST write's change row and returns False with a stderr line when it never lands._mssql_max_lsnis gone._mssql_landedis the one place that reads the change table._lc_insert), perf.py and upgrade_cdc_load.py pass the last write and return the wait's result.exec_allwaits for the last row each leg writes (fromexpected(leg, n), the single source of truth) and raises when it never lands, so an undrained leg is an error and not a graded run.beforevalue read at 6 sites. Guards added: none that need a list kept in step; the two new self-test blocks grade the wait itself.Evidence
Live, devbox stand-mssql2022-cdc-1, scratch database (3 rounds of DDL then insert): the old condition returned in every round while the change table lacked the inserted row.
RED against the mutant each guard exists to catch (restored from a snapshot copy, cmp clean, no mutant text left):
_mssql_landedreturns on max LSN not NULLAssertionError: the wait returned before the row was in the change tableexec_allignores the wait's FalseAssertionError: a change row that never lands is a refusal, not a graded runexec_allwaits for the first expected rowAssertionError: a leg waits for the change row of its last write: [('dbo_t', 'insert', 2003), ('dbo_t', 'delete', 1)]GREEN:
python -m dev.release_oracle.cdc --self-test:self-test ok: ... the capture wait ends on the row, not on the max LSNpython -m dev.release_oracle --self-test: rc=0skip_census --self-test: okdev.seeded --self-test:self-test ok: seeded recall ...## Invariantsand no new env reads.Ratchets raised: none.
Not run here:
make pr-ready --fastwas started on the Mac at load average 74 and had not finished its offline-suite step (the diff touches only dev/ Python); the pre-push hook passed. CI carries the offline suite, mutants and the full gate cell.For the gate: run
no_silent_null_cdcfor mssql repeatedly and expect noNO_OUTPUTline; the stage time should return to about 146 s.