When removing a directory path from mirroring, cephfs-mirror records
this state in a thread-local storage. The replayer thread backs-off
in midst of mirroring the directory snapshots for this directory path.
However, the state (canceled state) is never cleared causing the thread
to incorrectly assume that other directory paths (which are picked up
by this thread) need backing-off, hence, marking these directory paths
as failed (to synchronize snapshots).
Fix is to store this state in the directory specific store which is
allocated when a thread picks up a directory path for synchronization.
Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit
1a956be9baf0f21e64d81a684cd8f90cb6481f6a)
if (it1 == m_registered.end()) {
m_snap_sync_stats.erase(_dir_root);
} else {
- it1->second.replayer->cancel();
+ it1->second.canceled = true;
}
m_cond.notify_all();
}
return 0;
}
- void cancel() {
- canceled = true;
- }
-
- bool is_canceled() const {
- return canceled;
- }
-
private:
PeerReplayer *m_peer_replayer;
- bool canceled = false;
};
struct DirRegistry {
int fd;
+ bool canceled = false;
SnapshotReplayerThread *replayer;
};
return true;
}
auto &dr = m_registered.at(dir_root);
- if (dr.replayer->is_canceled()) {
+ if (dr.canceled) {
*retval = -ECANCELED;
return true;
}