mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-18 18:46:17 +00:00
fix(lifecycle): harden manual transition rollout checks (#5344)
Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
@@ -3452,7 +3452,10 @@ impl ManualTransitionRunReport {
|
||||
}
|
||||
|
||||
pub fn has_partial_enqueue(&self) -> bool {
|
||||
self.skipped_queue_full > 0 || self.skipped_queue_closed > 0 || self.skipped_queue_timeout > 0
|
||||
self.skipped_already_in_flight > 0
|
||||
|| self.skipped_queue_full > 0
|
||||
|| self.skipped_queue_closed > 0
|
||||
|| self.skipped_queue_timeout > 0
|
||||
}
|
||||
|
||||
pub fn was_truncated(&self) -> bool {
|
||||
|
||||
@@ -2460,6 +2460,25 @@ mod tests {
|
||||
assert!(record.error.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn manual_transition_job_record_in_flight_skip_report_is_partial() {
|
||||
let options = ManualTransitionRunOptions::default();
|
||||
let mut record = ManualTransitionJobRecord::new(Uuid::new_v4(), "bucket", &options, TEST_OWNER);
|
||||
|
||||
record.complete(
|
||||
ManualTransitionRunReport {
|
||||
eligible: 1,
|
||||
skipped_already_in_flight: 1,
|
||||
..Default::default()
|
||||
},
|
||||
ManualTransitionQueueSnapshot::default(),
|
||||
);
|
||||
|
||||
assert_eq!(record.state, ManualTransitionJobState::Partial);
|
||||
assert_eq!(record.report.skipped_already_in_flight, 1);
|
||||
assert!(record.error.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn manual_transition_job_record_queue_pressure_reports_persist_readback() {
|
||||
let options = ManualTransitionRunOptions {
|
||||
|
||||
Reference in New Issue
Block a user