Skip to content

Commit db7f758

Browse files
committed
dataflow-state: Remove locking from an impl Debug
Locking in an impl Debug is a lurking land mine. The rest is IMO a minor style improvement. Change-Id: I2712ec931e1e4288c67ed4d4a230cad28d956322 Reviewed-on: https://gerrit.readyset.name/c/readyset/+/8156 Tested-by: Buildkite CI Reviewed-by: Jason Brown <[email protected]>
1 parent e4c5777 commit db7f758

File tree

1 file changed

+4
-7
lines changed
  • dataflow-state/src/persistent_state

1 file changed

+4
-7
lines changed

dataflow-state/src/persistent_state/mod.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,6 @@ impl fmt::Debug for PersistentState {
630630
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
631631
fmt.debug_struct("PersistentState")
632632
.field("name", &self.name)
633-
.field("indices", &self.db.inner().shared_state.indices)
634633
.field("unique_keys", &self.unique_keys)
635634
.field("seq", &self.seq)
636635
.field("epoch", &self.epoch)
@@ -1973,12 +1972,10 @@ impl PersistentState {
19731972

19741973
/// Perform a manual compaction for each column family.
19751974
fn compact_all_indices(&mut self) {
1976-
let mut threads = Vec::new();
1977-
for index in self.db.inner().shared_state.indices.iter().cloned() {
1978-
threads.push(self.compact_index(index));
1979-
}
1980-
for thread in threads {
1981-
self.push_compaction_thread(thread);
1975+
let indices = self.db.inner().shared_state.indices.to_vec();
1976+
for index in indices {
1977+
let thr = self.compact_index(index);
1978+
self.push_compaction_thread(thr);
19821979
}
19831980
self.wait_for_compaction();
19841981
}

0 commit comments

Comments
 (0)