20260413_2 并行化架构优化第一阶段,apnic 串行98s->并行74s,传输层任务并行,同repo内发布点串行
This commit is contained in:
@@ -15,6 +15,7 @@ use crate::data_model::router_cert::{
|
||||
};
|
||||
use crate::fetch::rsync::RsyncFetcher;
|
||||
use crate::policy::Policy;
|
||||
use crate::parallel::repo_runtime::{RepoSyncRuntime, RepoSyncRuntimeOutcome};
|
||||
use crate::replay::archive::ReplayArchiveIndex;
|
||||
use crate::replay::delta_archive::ReplayDeltaArchiveIndex;
|
||||
use crate::report::{RfcRef, Warning};
|
||||
@@ -77,9 +78,20 @@ pub struct Rpkiv1PublicationPointRunner<'a> {
|
||||
/// same `rsync_base_uri` (observed in APNIC full sync timing reports).
|
||||
pub rsync_dedup: bool,
|
||||
pub rsync_repo_cache: Mutex<HashMap<String, bool>>, // rsync_base_uri -> rsync_ok
|
||||
pub repo_sync_runtime: Option<Arc<dyn RepoSyncRuntime>>,
|
||||
}
|
||||
|
||||
impl<'a> PublicationPointRunner for Rpkiv1PublicationPointRunner<'a> {
|
||||
fn prefetch_discovered_children(
|
||||
&self,
|
||||
children: &[DiscoveredChildCaInstance],
|
||||
) -> Result<(), String> {
|
||||
if let Some(runtime) = self.repo_sync_runtime.as_ref() {
|
||||
runtime.prefetch_discovered_children(children)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn run_publication_point(
|
||||
&self,
|
||||
ca: &CaInstanceHandle,
|
||||
@@ -174,7 +186,18 @@ impl<'a> PublicationPointRunner for Rpkiv1PublicationPointRunner<'a> {
|
||||
Option<String>,
|
||||
Option<String>,
|
||||
Option<String>,
|
||||
) = if skip_sync_due_to_dedup {
|
||||
) = if let Some(runtime) = self.repo_sync_runtime.as_ref() {
|
||||
let RepoSyncRuntimeOutcome {
|
||||
repo_sync_ok,
|
||||
repo_sync_err,
|
||||
repo_sync_source,
|
||||
repo_sync_phase,
|
||||
repo_sync_duration_ms: _,
|
||||
warnings: repo_warnings,
|
||||
} = runtime.sync_publication_point_repo(ca)?;
|
||||
warnings.extend(repo_warnings);
|
||||
(repo_sync_ok, repo_sync_err, repo_sync_source, repo_sync_phase)
|
||||
} else if skip_sync_due_to_dedup {
|
||||
let source = if effective_notification_uri.is_some() {
|
||||
Some("rrdp_dedup_skip".to_string())
|
||||
} else {
|
||||
@@ -4023,6 +4046,7 @@ authorityKeyIdentifier = keyid:always
|
||||
rrdp_repo_cache: Mutex::new(HashMap::new()),
|
||||
rsync_dedup: false,
|
||||
rsync_repo_cache: Mutex::new(HashMap::new()),
|
||||
repo_sync_runtime: None,
|
||||
};
|
||||
|
||||
// For this fixture-driven smoke, we provide the correct issuer CA certificate (the CA for
|
||||
@@ -4191,6 +4215,7 @@ authorityKeyIdentifier = keyid:always
|
||||
rrdp_repo_cache: Mutex::new(HashMap::new()),
|
||||
rsync_dedup: true,
|
||||
rsync_repo_cache: Mutex::new(HashMap::new()),
|
||||
repo_sync_runtime: None,
|
||||
};
|
||||
|
||||
let first = runner.run_publication_point(&handle).expect("first run ok");
|
||||
@@ -4298,6 +4323,7 @@ authorityKeyIdentifier = keyid:always
|
||||
rrdp_repo_cache: Mutex::new(HashMap::new()),
|
||||
rsync_dedup: true,
|
||||
rsync_repo_cache: Mutex::new(HashMap::new()),
|
||||
repo_sync_runtime: None,
|
||||
};
|
||||
|
||||
let first = runner.run_publication_point(&handle).expect("first run ok");
|
||||
@@ -4408,6 +4434,7 @@ authorityKeyIdentifier = keyid:always
|
||||
rrdp_repo_cache: Mutex::new(HashMap::new()),
|
||||
rsync_dedup: true,
|
||||
rsync_repo_cache: Mutex::new(HashMap::new()),
|
||||
repo_sync_runtime: None,
|
||||
};
|
||||
|
||||
let first = runner.run_publication_point(&handle).expect("first run ok");
|
||||
@@ -4490,6 +4517,7 @@ authorityKeyIdentifier = keyid:always
|
||||
rrdp_repo_cache: Mutex::new(HashMap::new()),
|
||||
rsync_dedup: false,
|
||||
rsync_repo_cache: Mutex::new(HashMap::new()),
|
||||
repo_sync_runtime: None,
|
||||
};
|
||||
let first = ok_runner
|
||||
.run_publication_point(&handle)
|
||||
@@ -4515,6 +4543,7 @@ authorityKeyIdentifier = keyid:always
|
||||
rrdp_repo_cache: Mutex::new(HashMap::new()),
|
||||
rsync_dedup: false,
|
||||
rsync_repo_cache: Mutex::new(HashMap::new()),
|
||||
repo_sync_runtime: None,
|
||||
};
|
||||
let second = bad_runner
|
||||
.run_publication_point(&handle)
|
||||
@@ -5699,6 +5728,7 @@ authorityKeyIdentifier = keyid:always
|
||||
rrdp_repo_cache: Mutex::new(HashMap::new()),
|
||||
rsync_dedup: false,
|
||||
rsync_repo_cache: Mutex::new(HashMap::new()),
|
||||
repo_sync_runtime: None,
|
||||
};
|
||||
let first = runner_rrdp
|
||||
.run_publication_point(&handle)
|
||||
@@ -5727,6 +5757,7 @@ authorityKeyIdentifier = keyid:always
|
||||
rrdp_repo_cache: Mutex::new(HashMap::new()),
|
||||
rsync_dedup: true,
|
||||
rsync_repo_cache: Mutex::new(HashMap::new()),
|
||||
repo_sync_runtime: None,
|
||||
};
|
||||
let third = runner_rsync
|
||||
.run_publication_point(&handle)
|
||||
|
||||
Reference in New Issue
Block a user