1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
5 // the './' includes are marked this way to affect clang-format
6 #include "./pg_scrubber.h"
14 #include "common/errno.h"
15 #include "common/scrub_types.h"
16 #include "messages/MOSDOp.h"
17 #include "messages/MOSDRepScrub.h"
18 #include "messages/MOSDRepScrubMap.h"
19 #include "messages/MOSDScrub.h"
20 #include "messages/MOSDScrubReserve.h"
23 #include "scrub_machine.h"
28 * The derivative of PgScrubber that is used by PrimaryLogPG.
30 class PrimaryLogScrub
: public PgScrubber
{
32 explicit PrimaryLogScrub(PrimaryLogPG
* pg
);
34 void _scrub_finish() final
;
36 bool get_store_errors(const scrub_ls_arg_t
& arg
,
37 scrub_ls_result_t
& res_inout
) const final
;
40 * should we requeue blocked ops?
41 * Yes - if our 'subset_last_applied' is less up-to-date than the
42 * new recovery_state.get_last_update_applied().
43 * (used by PrimaryLogPG::op_applied())
45 [[nodiscard
]] bool should_requeue_blocked_ops(
46 eversion_t last_recovery_applied
) const final
;
48 void stats_of_handled_objects(const object_stat_sum_t
& delta_stats
,
49 const hobject_t
& soid
) final
;
52 // we know our PG is actually a PrimaryLogPG. Let's alias the pointer to that object:
53 PrimaryLogPG
* const m_pl_pg
;
56 * Validate consistency of the object info and snap sets.
58 void scrub_snapshot_metadata(ScrubMap
& map
, const missing_map_t
& missing_digest
) final
;
60 void log_missing(int missing
,
61 const std::optional
<hobject_t
>& head
,
65 bool allow_incomplete_clones
);
67 int process_clones_to(const std::optional
<hobject_t
>& head
,
68 const std::optional
<SnapSet
>& snapset
,
71 bool allow_incomplete_clones
,
72 std::optional
<snapid_t
> target
,
73 std::vector
<snapid_t
>::reverse_iterator
* curclone
,
74 inconsistent_snapset_wrapper
& snap_error
);
77 // handle our part in stats collection
78 object_stat_collection_t m_scrub_cstat
;
79 void _scrub_clear_state() final
; // which just clears the stats