mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-21 11:56:38 +00:00
Fix: fix add heal_manager into scanner when scanner start
Signed-off-by: junxiang Mu <1948535941@qq.com>
This commit is contained in:
@@ -66,7 +66,7 @@ static GLOBAL_HEAL_CHANNEL_PROCESSOR: OnceLock<Arc<tokio::sync::Mutex<HealChanne
|
|||||||
pub async fn init_heal_manager(
|
pub async fn init_heal_manager(
|
||||||
storage: Arc<dyn heal::storage::HealStorageAPI>,
|
storage: Arc<dyn heal::storage::HealStorageAPI>,
|
||||||
config: Option<heal::manager::HealConfig>,
|
config: Option<heal::manager::HealConfig>,
|
||||||
) -> Result<()> {
|
) -> Result<Arc<HealManager>> {
|
||||||
// Create heal manager
|
// Create heal manager
|
||||||
let heal_manager = Arc::new(HealManager::new(storage, config));
|
let heal_manager = Arc::new(HealManager::new(storage, config));
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ pub async fn init_heal_manager(
|
|||||||
let channel_receiver = rustfs_common::heal_channel::init_heal_channel();
|
let channel_receiver = rustfs_common::heal_channel::init_heal_channel();
|
||||||
|
|
||||||
// Create channel processor
|
// Create channel processor
|
||||||
let channel_processor = HealChannelProcessor::new(heal_manager);
|
let channel_processor = HealChannelProcessor::new(heal_manager.clone());
|
||||||
|
|
||||||
// Store channel processor instance first
|
// Store channel processor instance first
|
||||||
GLOBAL_HEAL_CHANNEL_PROCESSOR
|
GLOBAL_HEAL_CHANNEL_PROCESSOR
|
||||||
@@ -101,7 +101,7 @@ pub async fn init_heal_manager(
|
|||||||
});
|
});
|
||||||
|
|
||||||
info!("Heal manager with channel processor initialized successfully");
|
info!("Heal manager with channel processor initialized successfully");
|
||||||
Ok(())
|
Ok(heal_manager)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get global heal manager instance
|
/// Get global heal manager instance
|
||||||
|
|||||||
+3
-4
@@ -30,8 +30,7 @@ use clap::Parser;
|
|||||||
use license::init_license;
|
use license::init_license;
|
||||||
use rustfs_ahm::scanner::data_scanner::ScannerConfig;
|
use rustfs_ahm::scanner::data_scanner::ScannerConfig;
|
||||||
use rustfs_ahm::{
|
use rustfs_ahm::{
|
||||||
Scanner, create_ahm_services_cancel_token, heal::storage::ECStoreHealStorage, init_heal_manager,
|
Scanner, create_ahm_services_cancel_token, heal::storage::ECStoreHealStorage, init_heal_manager, shutdown_ahm_services,
|
||||||
shutdown_ahm_services,
|
|
||||||
};
|
};
|
||||||
use rustfs_common::globals::set_global_addr;
|
use rustfs_common::globals::set_global_addr;
|
||||||
use rustfs_config::DEFAULT_DELIMITER;
|
use rustfs_config::DEFAULT_DELIMITER;
|
||||||
@@ -191,9 +190,9 @@ async fn run(opt: config::Opt) -> Result<()> {
|
|||||||
|
|
||||||
// Initialize heal manager with channel processor
|
// Initialize heal manager with channel processor
|
||||||
let heal_storage = Arc::new(ECStoreHealStorage::new(store.clone()));
|
let heal_storage = Arc::new(ECStoreHealStorage::new(store.clone()));
|
||||||
init_heal_manager(heal_storage, None).await?;
|
let heal_manager = init_heal_manager(heal_storage, None).await?;
|
||||||
|
|
||||||
let scanner = Scanner::new(Some(ScannerConfig::default()), None);
|
let scanner = Scanner::new(Some(ScannerConfig::default()), Some(heal_manager));
|
||||||
scanner.start().await?;
|
scanner.start().await?;
|
||||||
print_server_info();
|
print_server_info();
|
||||||
init_bucket_replication_pool().await;
|
init_bucket_replication_pool().await;
|
||||||
|
|||||||
Reference in New Issue
Block a user