aboutsummaryrefslogtreecommitdiff
path: root/src/model/block.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-02-24 14:59:49 +0100
committerAlex Auvolat <alex@adnab.me>2022-03-14 10:54:25 +0100
commit2377a92f6b64165be84f53722f30c21e9c8a0b3e (patch)
tree4a45feb7bd73bd541cc5f8552423cb9d46c8e26d /src/model/block.rs
parent203e8d2c345dabee56e31aebf88b706df5aa72e5 (diff)
downloadgarage-2377a92f6b64165be84f53722f30c21e9c8a0b3e.tar.gz
garage-2377a92f6b64165be84f53722f30c21e9c8a0b3e.zip
Add wrapper over sled tree to count items (used for big queues)
Diffstat (limited to 'src/model/block.rs')
-rw-r--r--src/model/block.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/model/block.rs b/src/model/block.rs
index d97e64a8..97e06f0e 100644
--- a/src/model/block.rs
+++ b/src/model/block.rs
@@ -22,6 +22,7 @@ use opentelemetry::{
use garage_util::data::*;
use garage_util::error::*;
use garage_util::metrics::RecordDuration;
+use garage_util::sled_counter::SledCountedTree;
use garage_util::time::*;
use garage_util::tranquilizer::Tranquilizer;
@@ -155,7 +156,7 @@ pub struct BlockManager {
rc: sled::Tree,
- resync_queue: sled::Tree,
+ resync_queue: SledCountedTree,
resync_notify: Notify,
system: Arc<System>,
@@ -184,6 +185,7 @@ impl BlockManager {
let resync_queue = db
.open_tree("block_local_resync_queue")
.expect("Unable to open block_local_resync_queue tree");
+ let resync_queue = SledCountedTree::new(resync_queue);
let endpoint = system
.netapp