mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-20 11:32:19 +00:00
test(replication): add MRF failure-recovery e2e trio (target outage, source restart, delete-marker mtime) (#4858)
test(replication): add MRF failure-recovery e2e trio for target outage, source restart, and delete-marker mtime
This commit is contained in:
@@ -514,6 +514,30 @@ impl RustFSTestEnvironment {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Restart this server in place, preserving its on-disk data directory,
|
||||
/// listen address, and credentials.
|
||||
///
|
||||
/// Failure-recovery tests (backlog#1147 repl-5) need the *same* instance to
|
||||
/// come back up after a crash/stop with its persisted state intact:
|
||||
/// per-object replication status in `xl.meta`, the MRF recovery file, and
|
||||
/// resync metadata all live under `temp_dir`, which this method keeps. The
|
||||
/// address is reused too (the server sets `SO_REUSEADDR`/`SO_REUSEPORT`), so
|
||||
/// existing S3 clients keep working without reconfiguration.
|
||||
///
|
||||
/// The previous process is stopped first. `cleanup_existing` is false so a
|
||||
/// sibling server sharing the harness (e.g. a replication target on another
|
||||
/// port) is left untouched — only this instance is recycled. Pass the same
|
||||
/// `extra_args` / `extra_env` the instance was originally started with;
|
||||
/// background tasks read their env once at startup.
|
||||
pub async fn restart_server_preserving_data(
|
||||
&mut self,
|
||||
extra_args: Vec<&str>,
|
||||
extra_env: &[(&str, &str)],
|
||||
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
self.stop_server();
|
||||
self.start_rustfs_server_inner(extra_args, extra_env, false).await
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for RustFSTestEnvironment {
|
||||
|
||||
Reference in New Issue
Block a user