1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Metadata cleanup script after a delete completes.
//!
//! Reproduces `redis_clear_repair_md_for_key` from the reference
//! engine. The cleanup script removes the per-key entries from the
//! add-set / rem-set metadata once a delete has been confirmed by
//! every replica. This module ports the predicate that decides
//! whether a cleanup script is needed; emitting the script bytes
//! lands once Stage 9's dispatcher exercises the workflow.
use crate;
use ;
/// Decide whether `req` warrants a metadata cleanup.
///
/// Returns [`RepairOutcome::NoOp`] when the originating request is
/// not a delete-shaped command. Returns
/// [`RepairError::Invariant`] when the originating message is
/// missing.
///
/// # Examples
///
/// ```
/// use dynomite::msg::{Msg, MsgType};
/// use dynomite::proto::redis::redis_clear_repair_md_for_key;
///
/// let mut req = Msg::new(0, MsgType::ReqRedisDel, true);
/// let outcome = redis_clear_repair_md_for_key(&mut req).unwrap();
/// matches!(outcome, dynomite::proto::redis::RepairOutcome::NoOp);
/// ```