-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix panic when reusing a was-empty batch #267
Conversation
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Codecov ReportBase: 97.74% // Head: 97.67% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #267 +/- ##
==========================================
- Coverage 97.74% 97.67% -0.08%
==========================================
Files 30 30
Lines 10633 10655 +22
==========================================
+ Hits 10393 10407 +14
- Misses 240 248 +8
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
/cc @LykxSassinator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
src/engine.rs
Outdated
let start = Instant::now(); | ||
let len = log_batch.finish_populate(self.cfg.batch_compression_threshold.0 as usize)?; | ||
debug_assert!(!log_batch.is_empty()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do it before finish_populate
or remove it. The first validation log_batch.is_empty()
has guaranteed that log_batch.is_empty() == false
.
Signed-off-by: Xinye Tao <xy.tao@outlook.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Close #266
An empty batch went through
finish_populate
but notdrain
(in memtable apply block). This will break internal state machine and panic.