Commit d849f29
newsql_get_snapshot: fall back to stored snapshot on ha-retry
On an ha-retry, is_snap_uid_retry sets clnt->is_hasql_retry=1 and
stores the retry snapshot LSN in clnt->snapshot_file/offset during
BEGIN handling. Statements after BEGIN (INSERT, SELECT, COMMIT) carry
no snapshot_info in their sqlquery because only the BEGIN carries it
from the client.
initialize_shadow_trans calls newsql_get_snapshot to obtain the
snapshot LSN. Without a fallback, newsql_get_snapshot returns file=0
for these in-transaction queries, causing trans_start_serializable to
be called with file=0 and is_ha_retry=1 — which triggers the assertion
at bdb_osqltrn.c:278 and crashes the node.
fill_snapinfo already handles this correctly by checking
clnt->snapshot_file when is_hasql_retry is set. Add the same fallback
to newsql_get_snapshot so that initialize_shadow_trans always uses the
correct retry snapshot.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Mark Hannum <mhannum@bloomberg.net>1 parent ee66214 commit d849f29
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1406 | 1406 | | |
1407 | 1407 | | |
1408 | 1408 | | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
1409 | 1416 | | |
1410 | 1417 | | |
1411 | 1418 | | |
| |||
0 commit comments