Commit 83b0b20
authored
fix: upgrade raft-log: use pread to prevent race condition in concurrent chunk reads (databendlabs#19401)
Chunk::read_record() had a race condition when multiple threads read
from the same chunk concurrently. The non-atomic seek + read operation
allowed one thread's seek to be overwritten by another before reading,
causing reads from wrong file positions.
Changes:
- Use read_exact_at() (pread) instead of seek() + read() in read_record()
- Add concurrent read test to verify the fix1 parent e9337c7 commit 83b0b20
2 files changed
+7
-7
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
398 | | - | |
| 398 | + | |
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
| |||
0 commit comments