stats: avoid blocking updates while loading history - #8541
Conversation
|
Updated against current While revalidating the integration, I found and fixed one remaining blocking path in this PR’s scope: The new regression forces actual stats-database growth, pauses decoding, and verifies that Validation:
GitHub now reports this PR as mergeable. |
Summary
under a short lock
unit is neither lost nor counted twice
Evidence
On current unmodified
master, both new concurrency regressions fail becauseloadUnitskeepscurrMuheld while opening/loading a writable transaction:With this change, both tests pass 20 consecutive runs under
-race. The90-day persisted-history benchmark on an Apple M4 Pro measured approximately
74 ms for
loadUnitsand 90 ms forgetData; the important behavioral changeis that those reads no longer hold the update lock for that duration.
Testing
-raceinternal/statspackage under-racemake go-checkgit diff --checkThis addresses the confirmed DNS-path blocking behavior in #3113 without
closing the broader storage/schema investigation.