cluster_degraded(false), stopping(false),
purge_queue(g_ceph_context, whoami_,
mdsmap_->get_metadata_pool(), objecter,
- new FunctionContext(
- [this](int r){
- // Purge Queue operates inside mds_lock when we're calling into
- // it, and outside when in background, so must handle both cases.
- if (mds_lock.is_locked_by_me()) {
- handle_write_error(r);
- } else {
- std::lock_guard l(mds_lock);
- handle_write_error(r);
- }
- }
+ new FunctionContext([this](int r) {
+ std::lock_guard l(mds_lock);
+ handle_write_error(r);
+ }
)
),
progress_thread(this), dispatch_depth(0),
if (readonly) return;
dout(1) << "going readonly because internal IO failed: " << strerror(-r) << dendl;
readonly = true;
- on_error->complete(r);
+ finisher.queue(on_error, r);
on_error = nullptr;
journaler.set_readonly();
finish_contexts(g_ceph_context, waiting_for_recovery, r);
// Also do this periodically even if not idle, so that the persisted
// expire_pos doesn't fall too far behind our progress when consuming
// a very long queue.
- if (in_flight.empty() || journaler.write_head_needed()) {
+ if (!readonly &&
+ (in_flight.empty() || journaler.write_head_needed())) {
journaler.write_head(nullptr);
}
}), &finisher));