The Deleter commits its SQL transaction with the CALL DOLT_COMMIT inside
its withRetryTx body (or withDeleteFence's, for a guarded delete): on a
Dolt sql-server that call commits the transaction, so it is the deletion's
commit point. A failure there was wrapped as a plain error. A lost response
("invalid connection") therefore reached withRetryTx as a pre-commit
connection error, which it replays. The replay re-probed ids the first
attempt had already deleted and reported "issues not found: <id>", a
failure report for a deletion that had landed.
The commit point is now classified with wrapSQLCommitError("dolt commit",
err), as doltAddAndCommitInTx already does for its in-body DOLT_COMMIT. An
undecoded response is ErrCommitIndeterminate and is never replayed. A
decoded server error, such as a 1213 that rolled the transaction back, is
still replayed. The Sweeper has the same in-body commit point under
withWriteTx. It is never replayed, but its lost response was not reported
as indeterminate either; it now is.
Audit: every other withRetryTx/withRetryTxOn body that commits in-body does
so through doltAddAndCommitInTx, which already classifies the response.
The remaining CALL DOLT_COMMIT sites run on a pinned connection after the
SQL transaction, outside any replayed body.
Tests (real Dolt). A MySQL-wire proxy in the test package forwards the
CALL DOLT_COMMIT to the server, then cuts the client off before the
response arrives:
- TestDeleterLostDoltCommitResponseIsIndeterminateAndNotReplayed: the row
is gone (the delete landed), the error is ErrCommitIndeterminate, and
the deleter began exactly one transaction. On main it fails with "delete
error = issues not found: test-doomed". With only the error check
removed, it also reports "the delete began 2 transactions, want 1".
- TestSweeperLostDoltCommitResponseIsIndeterminate: on main it fails with
"sweep error = dolt commit: invalid connection".
Both pass with this change. The package's Delete|Deleter|Sweep|Fence|Purge
tests pass too, against a dolt sql-server 2.2.0 test container.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>