When MDS is readonly, keep metadata objects (not include the journal) of
cephfs unchanged. This allows us to submit new entries to the log while
MDS is readonly. (Log entries submitted after MDS becomes readonly can
be safely dropped)
Signed-off-by: Yan, Zheng <zyan@redhat.com>
if (m >= 0)
max_events = m;
+ if (mds->mdcache->is_readonly()) {
+ dout(10) << "trim, ignoring read-only FS" << dendl;
+ return;
+ }
+
submit_mutex.Lock();
// trim!
void MDLog::_maybe_expired(LogSegment *ls, int op_prio)
{
+ if (mds->mdcache->is_readonly()) {
+ dout(10) << "_maybe_expired, ignoring read-only FS" << dendl;
+ return;
+ }
+
dout(10) << "_maybe_expired segment " << ls->seq << "/" << ls->offset
<< ", " << ls->num_events << " events" << dendl;
try_expire(ls, op_prio);