Commit 185bee5
db/state: fix data race between buildFiles and recalcVisibleFiles
buildFiles() calls BeginFilesRo() on Domain and InvertedIndex without
holding visibleFilesLock, racing with recalcVisibleFiles() which writes
_visible/_visibleFiles under the same lock. Wrap the BeginFilesRo()
calls in buildFiles() with visibleFilesLock.RLock() to synchronize
with the writer, matching the pattern already used in
Aggregator.BeginFilesRo().
Fixes TestHistoryVerification_WithUserTransactions DATA RACE.
Co-Authored-By: Claude Opus 4.6 <[email protected]>1 parent 8d4b28d commit 185bee5
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
687 | 687 | | |
688 | 688 | | |
689 | 689 | | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
690 | 694 | | |
691 | 695 | | |
692 | 696 | | |
| |||
768 | 772 | | |
769 | 773 | | |
770 | 774 | | |
| 775 | + | |
771 | 776 | | |
772 | 777 | | |
773 | 778 | | |
| |||
0 commit comments