fix(replication): make resync recovery resilient (#5883)

Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
cxymds
2026-08-09 19:42:06 +08:00
committed by GitHub
parent ec7f5f7b7d
commit 1be636b914
7 changed files with 447 additions and 129 deletions
+3 -4
View File
@@ -12,11 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use crate::startup_runtime_sources;
use crate::storage_api::startup::bucket_metadata::contract::bucket::{BucketOperations, BucketOptions};
use crate::storage_api::startup::bucket_metadata::{
ECStore, init_bucket_metadata_sys, reconcile_bucket_resync_target_intents, try_migrate_bucket_metadata,
try_migrate_iam_config,
ECStore, get_global_replication_pool, init_bucket_metadata_sys, reconcile_bucket_resync_target_intents,
try_migrate_bucket_metadata, try_migrate_iam_config,
};
use std::{
io::{Error, Result},
@@ -60,7 +59,7 @@ pub(crate) async fn init_bucket_metadata_runtime(store: Arc<ECStore>, ctx: Cance
init_bucket_metadata_sys(store, buckets.clone()).await;
reconcile_bucket_resync_target_intents(&buckets).await?;
if let Some(pool) = startup_runtime_sources::replication_pool_handle() {
if let Some(pool) = get_global_replication_pool() {
pool.init_resync(ctx, buckets.clone()).await?;
}
+2 -8
View File
@@ -13,10 +13,8 @@
// limitations under the License.
use crate::config::RustFSBufferConfig;
use crate::runtime_sources::{
current_outbound_tls_generation as runtime_current_outbound_tls_generation, current_replication_pool_handle,
};
use crate::storage_api::startup::runtime_sources::{DynReplicationPool, InstanceContext, set_global_rustfs_port};
use crate::runtime_sources::current_outbound_tls_generation as runtime_current_outbound_tls_generation;
use crate::storage_api::startup::runtime_sources::{InstanceContext, set_global_rustfs_port};
use rustfs_kms::KmsServiceManager;
use rustfs_obs::{GlobalError as ObservabilityError, OtelGuard};
use rustfs_tls_runtime::{OutboundTlsMaterial, TlsGeneration};
@@ -92,10 +90,6 @@ pub(crate) fn init_metrics_runtime(ctx: CancellationToken) {
rustfs_obs::init_metrics_runtime(ctx);
}
pub(crate) fn replication_pool_handle() -> Option<Arc<DynReplicationPool>> {
current_replication_pool_handle()
}
pub(crate) fn set_put_stage_metrics_enabled(enabled: bool) {
rustfs_io_metrics::set_put_stage_metrics_enabled(enabled);
}
+3 -3
View File
@@ -215,8 +215,8 @@ pub(crate) mod startup {
}
pub(crate) use crate::storage::storage_api::{
ECStore, init_bucket_metadata_sys, reconcile_bucket_resync_target_intents, try_migrate_bucket_metadata,
try_migrate_iam_config,
ECStore, get_global_replication_pool, init_bucket_metadata_sys, reconcile_bucket_resync_target_intents,
try_migrate_bucket_metadata, try_migrate_iam_config,
};
}
@@ -263,7 +263,7 @@ pub(crate) mod startup {
}
pub(crate) mod runtime_sources {
pub(crate) use crate::storage::storage_api::{DynReplicationPool, InstanceContext, set_global_rustfs_port};
pub(crate) use crate::storage::storage_api::{InstanceContext, set_global_rustfs_port};
}
pub(crate) mod services {