Skip to content

Commit 83b0b20

Browse files
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 fix
1 parent e9337c7 commit 83b0b20

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Cargo.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ proptest = { version = "1", default-features = false, features = ["std"] }
395395
prost = { version = "0.13" }
396396
prost-build = { version = "0.13" }
397397
prqlc = "0.11.3"
398-
raft-log = { version = "0.2.12" }
398+
raft-log = { version = "0.2.13" }
399399
rand = { version = "0.8.5", features = ["small_rng", "serde1"] }
400400
rand_distr = "0.4.3"
401401
rayon = "1.9.0"

0 commit comments

Comments
 (0)