mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-29 16:37:07 +00:00
fix(heal): coalesce duplicate MRF intents (#6425)
Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
@@ -50,11 +50,12 @@ pub(super) enum CorruptMetadataRecording {
|
||||
ImmediateAndLedger,
|
||||
}
|
||||
|
||||
pub(super) fn corrupt_metadata_recording(mrf_accepted: bool) -> CorruptMetadataRecording {
|
||||
if mrf_accepted {
|
||||
CorruptMetadataRecording::LedgerOnly
|
||||
} else {
|
||||
CorruptMetadataRecording::ImmediateAndLedger
|
||||
pub(super) fn corrupt_metadata_recording(result: rustfs_common::mrf_channel::MrfIngressResult) -> CorruptMetadataRecording {
|
||||
match result {
|
||||
rustfs_common::mrf_channel::MrfIngressResult::Enqueued | rustfs_common::mrf_channel::MrfIngressResult::Coalesced => {
|
||||
CorruptMetadataRecording::LedgerOnly
|
||||
}
|
||||
rustfs_common::mrf_channel::MrfIngressResult::Dropped(_) => CorruptMetadataRecording::ImmediateAndLedger,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,8 +48,20 @@ fn scanner_alert_wire_names_match_canonical_event_names() {
|
||||
/// the backstop survives regardless of delivery.
|
||||
#[test]
|
||||
fn corrupt_metadata_recording_maps_delivery_to_backstop() {
|
||||
assert_eq!(corrupt_metadata_recording(true), CorruptMetadataRecording::LedgerOnly);
|
||||
assert_eq!(corrupt_metadata_recording(false), CorruptMetadataRecording::ImmediateAndLedger);
|
||||
assert_eq!(
|
||||
corrupt_metadata_recording(rustfs_common::mrf_channel::MrfIngressResult::Enqueued),
|
||||
CorruptMetadataRecording::LedgerOnly
|
||||
);
|
||||
assert_eq!(
|
||||
corrupt_metadata_recording(rustfs_common::mrf_channel::MrfIngressResult::Coalesced),
|
||||
CorruptMetadataRecording::LedgerOnly
|
||||
);
|
||||
assert_eq!(
|
||||
corrupt_metadata_recording(rustfs_common::mrf_channel::MrfIngressResult::Dropped(
|
||||
rustfs_common::mrf_channel::MrfDropReason::Full
|
||||
)),
|
||||
CorruptMetadataRecording::ImmediateAndLedger
|
||||
);
|
||||
}
|
||||
|
||||
fn cooldown_map_len() -> usize {
|
||||
|
||||
Reference in New Issue
Block a user