fix: panic when lance.auto_cleanup.interval is set to 0#5571
fix: panic when lance.auto_cleanup.interval is set to 0#5571wjones127 merged 2 commits intolance-format:mainfrom
Conversation
PR ReviewP1 - Semantic Inconsistency: The fix treats Consider either:
The current silent conversion of 0 → 1 behavior could confuse users who expect 0 to disable the feature. Suggestion: A cleaner fix would be: if interval == 0 || manifest.version % interval \!= 0 {
return Ok(None);
}This interprets Test coverage is good. The helper function refactoring is a nice improvement. |
PR ReviewSummary: Fix for division-by-zero panic when AssessmentThe fix is correct and minimal. The change interprets No blocking issues found. The test coverage is adequate - it verifies that cleanup runs on consecutive commits with interval=0 and that file counts stabilize correctly. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Hi, @westonpace |
wjones127
left a comment
There was a problem hiding this comment.
0 seems good to me, given you can always unset auto cleanup.
…#5571) For now, when lance.auto_cleanup.interval is set to 0, dataset commits panic with a "division by zero" error: ``` thread 'dataset::cleanup::tests::test_auto_cleanup_interval_zero' panicked at rust/lance/src/dataset/cleanup.rs:672:12: attempt to calculate the remainder with a divisor of zero note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` To fix the panic, we can interpret `lance.auto_cleanup.interval = 0` as triggering cleanup after each commit, which is equivalent to `lance.auto_cleanup.interval = 1`
For now, when lance.auto_cleanup.interval is set to 0, dataset commits panic with a "division by zero" error:
To fix the panic, we can interpret
lance.auto_cleanup.interval = 0as triggering cleanup after each commit, which is equivalent tolance.auto_cleanup.interval = 1