Skip to content

Commit

Permalink
dataflow-state: Remove locking from an impl Debug
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
rs-sac committed Oct 23, 2024
1 parent e4c5777 commit db7f758
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions dataflow-state/src/persistent_state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,6 @@ impl fmt::Debug for PersistentState {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("PersistentState")
.field("name", &self.name)
.field("indices", &self.db.inner().shared_state.indices)
.field("unique_keys", &self.unique_keys)
.field("seq", &self.seq)
.field("epoch", &self.epoch)
Expand Down Expand Up @@ -1973,12 +1972,10 @@ impl PersistentState {

/// Perform a manual compaction for each column family.
fn compact_all_indices(&mut self) {
let mut threads = Vec::new();
for index in self.db.inner().shared_state.indices.iter().cloned() {
threads.push(self.compact_index(index));
}
for thread in threads {
self.push_compaction_thread(thread);
let indices = self.db.inner().shared_state.indices.to_vec();
for index in indices {
let thr = self.compact_index(index);
self.push_compaction_thread(thr);
}
self.wait_for_compaction();
}
Expand Down

0 comments on commit db7f758

Please sign in to comment.