Comments (4)
Weird. No deadlock detected and no unreasonable idle task.
from runkv.
Error raised in log:
2022-05-16T12:04:59.698565Z ERROR runkv_rudder::worker::compaction_detector: trigger compaction l0 error: other: compaction error: [Err(StorageError(ManifestError(InvalidVersionDiff("sst L1-433791697681 not exists")))), Err(StorageError(ManifestError(InvalidVersionDiff("sst L1-433791697690 not exists")))), Err(StorageError(ManifestError(InvalidVersionDiff("sst L1-433791697716 not exists")))), Err(StorageError(ManifestError(InvalidVersionDiff("sst L1-433791697708 not exists"))))]
Maybe caused by the error. And #149 maybe caused by the same reasion.
Not related, QwQ.
from runkv.
New founds:
A new round of vote began when stuck:
2022-05-16T16:40:14.521787Z INFO runkv_common::tracing_slog_drain: starting a new election raft_id=17 raft node=17 group=6 namespace=raft
2022-05-16T16:40:14.521823Z INFO runkv_common::tracing_slog_drain: became pre-candidate at term 1 raft_id=17 raft node=17 group=6 namespace=raft
2022-05-16T16:40:14.521869Z INFO runkv_common::tracing_slog_drain: broadcasting vote request raft_id=17 raft node=17 group=6 namespace=raft
2022-05-16T16:40:15.806796Z INFO runkv_common::tracing_slog_drain: starting a new election raft_id=25 raft node=25 group=9 namespace=raft
2022-05-16T16:40:15.806835Z INFO runkv_common::tracing_slog_drain: became pre-candidate at term 1 raft_id=25 raft node=25 group=9 namespace=raft
2022-05-16T16:40:15.806880Z INFO runkv_common::tracing_slog_drain: broadcasting vote request raft_id=25 raft node=25 group=9 namespace=raft
2022-05-16T16:40:17.312915Z INFO runkv_common::tracing_slog_drain: starting a new election raft_id=17 raft node=17 group=6 namespace=raft
2022-05-16T16:40:17.312957Z INFO runkv_common::tracing_slog_drain: became pre-candidate at term 1 raft_id=17 raft node=17 group=6 namespace=raft
2022-05-16T16:40:17.313005Z INFO runkv_common::tracing_slog_drain: broadcasting vote request raft_id=17 raft node=17 group=6 namespace=raft
2022-05-16T16:40:19.841470Z INFO runkv_common::tracing_slog_drain: starting a new election raft_id=25 raft node=25 group=9 namespace=raft
2022-05-16T16:40:19.841507Z INFO runkv_common::tracing_slog_drain: became pre-candidate at term 1 raft_id=25 raft node=25 group=9 namespace=raft
2022-05-16T16:40:19.841549Z INFO runkv_common::tracing_slog_drain: broadcasting vote request raft_id=25 raft node=25 group=9 namespace=raft
2022-05-16T16:40:20.091152Z INFO runkv_common::tracing_slog_drain: starting a new election raft_id=17 raft node=17 group=6 namespace=raft
2022-05-16T16:40:20.091189Z INFO runkv_common::tracing_slog_drain: became pre-candidate at term 1 raft_id=17 raft node=17 group=6 namespace=raft
2022-05-16T16:40:20.091230Z INFO runkv_common::tracing_slog_drain: broadcasting vote request raft_id=17 raft node=17 group=6 namespace=raft
2022-05-16T16:40:22.891380Z INFO runkv_common::tracing_slog_drain: starting a new election raft_id=17 raft node=17 group=6 namespace=raft
2022-05-16T16:40:22.891420Z INFO runkv_common::tracing_slog_drain: became pre-candidate at term 1 raft_id=17 raft node=17 group=6 namespace=raft
2022-05-16T16:40:22.891462Z INFO runkv_common::tracing_slog_drain: broadcasting vote request raft_id=17 raft node=17 group=6 namespace=raft
2022-05-16T16:40:23.857864Z INFO runkv_common::tracing_slog_drain: starting a new election raft_id=25 raft node=25 group=9 namespace=raft
2022-05-16T16:40:23.857902Z INFO runkv_common::tracing_slog_drain: became pre-candidate at term 1 raft_id=25 raft node=25 group=9 namespace=raft
2022-05-16T16:40:23.857946Z INFO runkv_common::tracing_slog_drain: broadcasting vote request raft_id=25 raft node=25 group=9 namespace=raft
2022-05-16T16:40:25.661396Z INFO runkv_common::tracing_slog_drain: starting a new election raft_id=17 raft node=17 group=6 namespace=raft
2022-05-16T16:40:25.661436Z INFO runkv_common::tracing_slog_drain: became pre-candidate at term 1 raft_id=17 raft node=17 group=6 namespace=raft
2022-05-16T16:40:25.661479Z INFO runkv_common::tracing_slog_drain: broadcasting vote request raft_id=17 raft node=17 group=6 namespace=raft
from runkv.
The deadlock locates in runkv_storage::raft_log_store::log
, between fn append()
and fn read()
.
fn append()
When batch leader appending the log, it first locks the active_file
:
RunKV/storage/src/raft_log_store/log.rs
Lines 198 to 204 in 7925e66
And when log rotation is needed, it will locks the frozen_files
and append the old active file to the queue:
RunKV/storage/src/raft_log_store/log.rs
Line 279 in 7925e66
fn read()
When reading, frozen_files
are locked and be checked first to see if the given index locates in frozen log files. If not, check the active log file instead. The order to acquire the locks of frozen_files
and active_file
in fn read()
is opposite with fn append()
, and the lock of frozen_files
is forgotten to be freed:
RunKV/storage/src/raft_log_store/log.rs
Lines 332 to 351 in 7925e66
from runkv.
Related Issues (20)
- optimize concurrent writes for ObjectLsmTree memory states
- purge raft log files with low utilization rate HOT 1
- introduce tracing with opentelemetry and jaeger HOT 1
- refactor: rename group in raft log store
- wait apply notify latency is extremely high HOT 7
- bug: some requests are not applied or applied out of order without error HOT 1
- bug: abnormal fsync latency jitter HOT 3
- bug: multi version of one key are separated into two sstables in the same level HOT 1
- bug: tend to delete not-exist sstable after comaction
- bug: raft log store read data race HOT 1
- chore: Celebrate my 100th commit for RunKV HOT 1
- File Cache as Secondary Cache HOT 1
- introduce connection pool
- replace unnecessary Bytes with Vec<u8> and &[u8] in storage module HOT 2
- bug: concurrent put & get found None but Some expected HOT 2
- Tracking: raft WAL
- enhance: avoid unnecessary buffer copy in raft log store
- enhance: better write model for batching and pipeline
- bench: port block iterator micro bench HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from runkv.