File tree Expand file tree Collapse file tree 4 files changed +16
-0
lines changed
Expand file tree Collapse file tree 4 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,10 @@ class MapCacher {
8585public:
8686 MapCacher (StoreDriver<K, V> *driver) : driver(driver) {}
8787
88+ void reset () {
89+ in_progress.reset ();
90+ }
91+
8892 // / Fetch first key/value std::pair after specified key
8993 int get_next (
9094 K key, // /< [in] key after which to get next
Original file line number Diff line number Diff line change 1818#include < map>
1919#include < memory>
2020#include " common/ceph_mutex.h"
21+ #include " include/ceph_assert.h"
2122
2223/* *
2324 * Provides a registry of shared_ptr<V> indexed by K while
@@ -61,6 +62,11 @@ class SharedPtrRegistry {
6162 waiting(0 )
6263 {}
6364
65+ void reset () {
66+ ceph_assert (!waiting);
67+ contents.clear ();
68+ }
69+
6470 bool empty () {
6571 std::lock_guard l (lock);
6672 return contents.empty ();
Original file line number Diff line number Diff line change @@ -1626,6 +1626,7 @@ void PG::on_change(ceph::os::Transaction &t) {
16261626 // is save and in time.
16271627 peering_state.state_clear (PG_STATE_SNAPTRIM);
16281628 peering_state.state_clear (PG_STATE_SNAPTRIM_ERROR);
1629+ snap_mapper.reset_backend ();
16291630}
16301631
16311632void PG::context_registry_on_change () {
Original file line number Diff line number Diff line change @@ -356,6 +356,11 @@ class SnapMapper : public Scrub::SnapMapReaderI {
356356 return prefix_itr;
357357 }
358358
359+ // / reset the MapCacher backend, this should be called on pg interval change
360+ void reset_backend () {
361+ backend.reset ();
362+ }
363+
359364 // / Update snaps for oid, empty new_snaps removes the mapping
360365 int update_snaps (
361366 const hobject_t &oid, // /< [in] oid to update
You can’t perform that action at this time.
0 commit comments