diff options
author | Alex Auvolat <alex@adnab.me> | 2022-12-14 12:28:07 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-12-14 12:28:07 +0100 |
commit | 2183518edccadef47cdeaf6476033b52d8832d6e (patch) | |
tree | 8a7d0ce0a622bd512ad6138a90f4bb4604bc38fb /src/model | |
parent | 83c8467e23c1f531ae233766d5dc7244afe57f08 (diff) | |
download | garage-2183518edccadef47cdeaf6476033b52d8832d6e.tar.gz garage-2183518edccadef47cdeaf6476033b52d8832d6e.zip |
Spawn all background workers in a separate step
Diffstat (limited to 'src/model')
-rw-r--r-- | src/model/garage.rs | 21 | ||||
-rw-r--r-- | src/model/index_counter.rs | 4 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/model/garage.rs b/src/model/garage.rs index e34d034f..9ae6af82 100644 --- a/src/model/garage.rs +++ b/src/model/garage.rs @@ -273,6 +273,22 @@ impl Garage { })) } + pub fn spawn_workers(&self) { + self.block_manager.spawn_workers(); + + self.bucket_table.spawn_workers(); + self.bucket_alias_table.spawn_workers(); + self.key_table.spawn_workers(); + + self.object_table.spawn_workers(); + self.object_counter_table.spawn_workers(); + self.version_table.spawn_workers(); + self.block_ref_table.spawn_workers(); + + #[cfg(feature = "k2v")] + self.k2v.spawn_workers(); + } + pub fn bucket_helper(&self) -> helper::bucket::BucketHelper { helper::bucket::BucketHelper(self) } @@ -307,4 +323,9 @@ impl GarageK2V { rpc, } } + + pub fn spawn_workers(&self) { + self.item_table.spawn_workers(); + self.counter_table.spawn_workers(); + } } diff --git a/src/model/index_counter.rs b/src/model/index_counter.rs index 9c8e00c2..d907e947 100644 --- a/src/model/index_counter.rs +++ b/src/model/index_counter.rs @@ -164,6 +164,10 @@ impl<T: CountedItem> IndexCounter<T> { }) } + pub fn spawn_workers(&self) { + self.table.spawn_workers(); + } + pub fn count( &self, tx: &mut db::Transaction, |