Skip to content

Commit 413ccdf

Browse files
committed
dataflow-state: Add some missing cases in eviction path
While scanning the eviction code, I noticed a missing case in a match statement. Since that might not have been the only mistake, an audit was conducted of the entire file, which revealed two additional accidental omissions. Clearly the code could use some refactoring via macros to make it more dense and to make these errors easier to see, but in light of possible near-term renovation, I'm just going to make things more correct for now. Change-Id: Ib999845211ca077aa66c49d89ca499376d060644 Reviewed-on: https://gerrit.readyset.name/c/readyset/+/7746 Tested-by: Buildkite CI Reviewed-by: Jason Brown <[email protected]>
1 parent 3bd9e50 commit 413ccdf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

dataflow-state/src/keyed_state.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ impl KeyedState {
441441
(KeyedState::DoubleBTree(m), RangeKey::Double(range)) => range!(m, range),
442442
(KeyedState::TriBTree(m), RangeKey::Tri(range)) => range!(m, range),
443443
(KeyedState::QuadBTree(m), RangeKey::Quad(range)) => range!(m, range),
444+
(KeyedState::QuinBTree(m), RangeKey::Quin(range)) => range!(m, range),
444445
(KeyedState::SexBTree(m), RangeKey::Sex(range)) => range!(m, range),
445446
(KeyedState::MultiBTree(m, _), RangeKey::Multi(range)) => m
446447
.range::<_, [DfValue]>(&(
@@ -453,6 +454,7 @@ impl KeyedState {
453454
| KeyedState::DoubleHash(_)
454455
| KeyedState::TriHash(_)
455456
| KeyedState::QuadHash(_)
457+
| KeyedState::QuinHash(_)
456458
| KeyedState::SexHash(_)
457459
| KeyedState::MultiHash(..),
458460
_,
@@ -489,6 +491,11 @@ impl KeyedState {
489491
m.swap_remove_index(index)
490492
.map(|(k, rs)| (rs, k.into_elements().collect()))
491493
}
494+
KeyedState::QuinHash(ref mut m) if !m.is_empty() => {
495+
let index = seed % m.len();
496+
m.swap_remove_index(index)
497+
.map(|(k, rs)| (rs, k.into_elements().collect()))
498+
}
492499
KeyedState::SexHash(ref mut m) if !m.is_empty() => {
493500
let index = seed % m.len();
494501
m.swap_remove_index(index)

0 commit comments

Comments
 (0)