And remove the misplaced conditional in ::trim_expiring_segments.
This is necessary as the `flush journal` command gets confused by missing a
wait_for_expiry on a LogSegment that is not actually expired.
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
ceph_assert(ceph_mutex_is_locked_by_me(submit_mutex));
ceph_assert(locker.owns_lock());
- uint64_t const oft_committed_seq = mds->mdcache->open_file_table.get_committed_log_seq();
-
// trim expired segments?
bool trimmed = false;
uint64_t end = 0;
break;
}
- if (!mds_is_shutting_down && ls->seq >= oft_committed_seq) {
- dout(10) << __func__ << " defer expire for open file table committedseq " << oft_committed_seq
- << " <= " << ls->seq << "/" << ls->offset << dendl;
- break;
- }
-
end = seq;
dout(10) << __func__ << ": maybe expiring " << *ls << dendl;
}
committed_log_seq = log_seq;
num_pending_commit--;
+ {
+ auto last = waiting_for_commit.upper_bound(log_seq);
+ for (auto it = waiting_for_commit.begin(); it != last; it++) {
+ finish_contexts(g_ceph_context, it->second);
+ }
+ waiting_for_commit.erase(waiting_for_commit.begin(), last);
+ }
+
if (fin)
fin->complete(r);
}
ceph_assert(!load_done);
waiting_for_load.push_back(c);
}
+ void wait_for_commit(uint64_t seq, Context* c) {
+ waiting_for_commit[seq].push_back(c);
+ }
bool prefetch_inodes();
bool is_prefetched() const { return prefetch_state == DONE; }
std::set<inodeno_t> destroyed_inos_set;
std::unique_ptr<PerfCounters> logger;
+
+ std::map<uint64_t, std::vector<Context*>> waiting_for_commit;
};
#endif
}
}
+ auto const oft_cseq = mds->mdcache->open_file_table.get_committed_log_seq();
+ if (!mds->mdlog->is_capped() && seq >= oft_cseq) {
+ dout(10) << *this << ".try_to_expire"
+ << " defer expire for oft_committed_seq (" << oft_cseq
+ << ") <= seq (" << seq << ")" << dendl;
+ mds->mdcache->open_file_table.wait_for_commit(seq, gather_bld.new_sub());
+ }
+
ceph_assert(g_conf()->mds_kill_journal_expire_at != 3);
std::map<int64_t, std::vector<CInodeCommitOperations>> ops_vec_map;