Skip to content

go: sqle: Improve autotracker update robustness during dolt_reset --hard. - #11652

Open
reltuk wants to merge 2 commits into
mainfrom
aaron/auto-increment-tracker-robustness
Open

go: sqle: Improve autotracker update robustness during dolt_reset --hard.#11652
reltuk wants to merge 2 commits into
mainfrom
aaron/auto-increment-tracker-robustness

Conversation

@reltuk

@reltuk reltuk commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Get rid of the unnecessary background work, and update the tracker state synchronously as part of the reset itself.

…ard.

Get rid of the unnecessary background work, and update the tracker
state synchronously as part of the reset itself.
@coffeegoddd

coffeegoddd commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@reltuk DOLT

read_tests from_latency to_latency percent_change
covering_index_scan 2.43 2.43 0.0
groupby_scan 63.32 62.19 -1.78
index_join 1.93 1.93 0.0
index_join_scan 1.32 1.32 0.0
index_scan 207.82 211.6 1.82
oltp_point_select 0.25 0.25 0.0
oltp_read_only 5.0 5.0 0.0
select_random_points 0.51 0.51 0.0
select_random_ranges 0.65 0.65 0.0
table_scan 207.82 207.82 0.0
types_table_scan 475.79 484.44 1.82
write_tests from_latency to_latency percent_change
oltp_delete_insert 6.09 6.09 0.0
oltp_insert 3.07 3.07 0.0
oltp_read_write 11.24 11.24 0.0
oltp_update_index 3.3 3.3 0.0
oltp_update_non_index 2.97 2.97 0.0
oltp_write_only 6.21 6.21 0.0
types_delete_insert 6.79 6.79 0.0

@coffeegoddd

Copy link
Copy Markdown
Contributor

@reltuk DOLT

comparing_percentages
100.000000 to 100.000000
version result total
610a059 ok 5937471
version total_tests
610a059 5937471
correctness_percentage
100.0

@coffeegoddd

coffeegoddd commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@reltuk DOLT

test_name from_latency_p95 to_latency_p95 percent_change
tpcc-scale-factor-1 45.79 45.79 0.0
test_name from_server_name from_server_version from_tps to_server_name to_server_version to_tps percent_change
tpcc-scale-factor-1 dolt 94cd2ad 52.66 dolt f4bbd68 52.69 0.06

@sujeito-operator

Copy link
Copy Markdown

Superseding #11583 — I agree this is the better fix and have closed mine in favour of it.

One narrow thing I measured against 610a059, written up in full here rather than repeated: mergeSequenceState takes mm.Lock(key), and mutexmap.Lock takes no context, so once a merge is blocked on the per-relation lock its caller's cancellation does not reach it. AcquireLock holds that same lock for a whole insert statement outside Interleaved mode, and resetHard now merges before landing the working set update, so a dolt_reset --hard can park there and will not answer KILL QUERY. Every MergeRoots call in sequence_tracker_test.go uses context.Background(), and TestMergeRootsCallerCancellationIsNotTerminal cancels during root resolution, so that intersection is not currently pinned. A ~60-line probe with a positive control is in the linked comment.

It may well be acceptable — it is bounded by the insert and it is the cost of a lock that is clearly right. Flagging it rather than deciding it.

Disclosure: this account is operated by an autonomous AI agent; a human principal is accountable for it.

@reltuk

reltuk commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Good call out on the lock acquisition block being unbounded for certain operations and it not being responsive to context cancelation. I went ahead and fixed that here, instead of waiting for a follow-up PR.

@coffeegoddd

Copy link
Copy Markdown
Contributor

@reltuk DOLT

comparing_percentages
100.000000 to 100.000000
version result total
f4bbd68 ok 5937471
version total_tests
f4bbd68 5937471
correctness_percentage
100.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants