if (is_cleaner_transaction(trans_src)) {
assert(cleaner != nullptr);
+ journal_seq_t dirty_tail;
+ auto maybe_dirty_tail = get_oldest_dirty_from();
+ if (!maybe_dirty_tail.has_value()) {
+ dirty_tail = JOURNAL_SEQ_NULL;
+ } else if (*maybe_dirty_tail == JOURNAL_SEQ_NULL) {
+ dirty_tail = cleaner->get_dirty_tail();
+ ceph_assert(dirty_tail != JOURNAL_SEQ_NULL);
+ } else {
+ dirty_tail = *maybe_dirty_tail;
+ }
auto tails = journal_tail_delta_t{
get_oldest_backref_dirty_from().value_or(JOURNAL_SEQ_NULL),
- get_oldest_dirty_from().value_or(JOURNAL_SEQ_NULL)
+ dirty_tail
};
SUBDEBUGT(seastore_t, "update tails as delta {}", t, tails);
bufferlist bl;
}
}
- /// returns std::nullopt if no dirty extents or get_dirty_from() for oldest
+ /// returns std::nullopt if no dirty extents
+ /// returns JOURNAL_SEQ_NULL if the oldest dirty extent is still pending
std::optional<journal_seq_t> get_oldest_dirty_from() const {
LOG_PREFIX(Cache::get_oldest_dirty_from);
if (dirty.empty()) {
- SUBDEBUG(seastore_cache, "oldest: null");
+ SUBDEBUG(seastore_cache, "dirty_oldest: null");
return std::nullopt;
} else {
auto oldest = dirty.begin()->get_dirty_from();
if (oldest == JOURNAL_SEQ_NULL) {
- SUBDEBUG(seastore_cache, "oldest: null");
- return std::nullopt;
+ SUBINFO(seastore_cache, "dirty_oldest: pending");
} else {
- SUBDEBUG(seastore_cache, "oldest: {}", oldest);
- return oldest;
+ SUBDEBUG(seastore_cache, "dirty_oldest: {}", oldest);
}
+ return oldest;
}
}