diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index 810397592d7..9fa036ff7df 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -1121,8 +1121,9 @@ void ECBackend::check_recovery_sources(const OSDMapRef osdmap) } } -void ECBackend::_on_change(ObjectStore::Transaction *t) +void ECBackend::on_change() { + dout(10) << __func__ << dendl; writing.clear(); tid_to_op_map.clear(); for (map::iterator i = tid_to_read_map.begin(); diff --git a/src/osd/ECBackend.h b/src/osd/ECBackend.h index 314e2b07f58..28bcf8a5095 100644 --- a/src/osd/ECBackend.h +++ b/src/osd/ECBackend.h @@ -82,7 +82,7 @@ public: /// @see ReadOp below void check_recovery_sources(const OSDMapRef osdmap); - void _on_change(ObjectStore::Transaction *t); + void on_change(); void clear_state(); void on_flushed(); diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 8d3813e956f..52a38394bd0 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -426,6 +426,15 @@ void OSDService::pg_stat_queue_dequeue(PG *pg) osd->pg_stat_queue_dequeue(pg); } +void OSDService::start_shutdown() +{ + { + Mutex::Locker l(agent_timer_lock); + agent_timer.cancel_all_events(); + agent_timer.shutdown(); + } +} + void OSDService::shutdown() { reserver_finisher.stop(); @@ -446,10 +455,6 @@ void OSDService::shutdown() Mutex::Locker l(backfill_request_lock); backfill_request_timer.shutdown(); } - { - Mutex::Locker l(agent_timer_lock); - agent_timer.shutdown(); - } osdmap = OSDMapRef(); next_osdmap = OSDMapRef(); } @@ -1640,6 +1645,8 @@ int OSD::shutdown() cct->_conf->set_val("debug_ms", "100"); cct->_conf->apply_changes(NULL); + service.start_shutdown(); + dispatch_sessions_waiting_on_map(); // Shutdown PGs diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 4bc55864701..2ae77e3523f 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -759,6 +759,7 @@ public: void pg_stat_queue_dequeue(PG *pg); void init(); + void start_shutdown(); void shutdown(); // split diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc index 39e4b7809eb..ad78d1f5526 100644 --- a/src/osd/PGBackend.cc +++ b/src/osd/PGBackend.cc @@ -80,7 +80,7 @@ void PGBackend::rollback( } -void PGBackend::on_change(ObjectStore::Transaction *t) +void PGBackend::on_change_cleanup(ObjectStore::Transaction *t) { dout(10) << __func__ << dendl; // clear temp @@ -94,7 +94,6 @@ void PGBackend::on_change(ObjectStore::Transaction *t) ghobject_t(*i, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard)); } temp_contents.clear(); - _on_change(t); } coll_t PGBackend::get_temp_coll(ObjectStore::Transaction *t) diff --git a/src/osd/PGBackend.h b/src/osd/PGBackend.h index b164872a2ef..59efef1c955 100644 --- a/src/osd/PGBackend.h +++ b/src/osd/PGBackend.h @@ -300,12 +300,16 @@ virtual void check_recovery_sources(const OSDMapRef osdmap) = 0; + + /** + * clean up any temporary on-disk state due to a pg interval change + */ + void on_change_cleanup(ObjectStore::Transaction *t); /** * implementation should clear itself, contexts blessed prior to on_change * won't be called after on_change() */ - void on_change(ObjectStore::Transaction *t); - virtual void _on_change(ObjectStore::Transaction *t) = 0; + virtual void on_change() = 0; virtual void clear_state() = 0; virtual void on_flushed() = 0; diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index c7d8b6b1560..5e079760f72 100644 --- a/src/osd/ReplicatedBackend.cc +++ b/src/osd/ReplicatedBackend.cc @@ -192,8 +192,9 @@ void ReplicatedBackend::clear_state() pull_from_peer.clear(); } -void ReplicatedBackend::_on_change(ObjectStore::Transaction *t) +void ReplicatedBackend::on_change() { + dout(10) << __func__ << dendl; for (map::iterator i = in_progress_ops.begin(); i != in_progress_ops.end(); in_progress_ops.erase(i++)) { diff --git a/src/osd/ReplicatedBackend.h b/src/osd/ReplicatedBackend.h index 26f8f517171..5e1f0ec1266 100644 --- a/src/osd/ReplicatedBackend.h +++ b/src/osd/ReplicatedBackend.h @@ -69,7 +69,7 @@ public: OpRequestRef op ); - void _on_change(ObjectStore::Transaction *t); + void on_change(); void clear_state(); void on_flushed(); diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 373fc0e354d..a14dac81f6d 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -9221,7 +9221,7 @@ void ReplicatedPG::apply_and_flush_repops(bool requeue) while (!repop_queue.empty()) { RepGather *repop = repop_queue.front(); repop_queue.pop_front(); - dout(10) << " applying repop tid " << repop->rep_tid << dendl; + dout(10) << " canceling repop tid " << repop->rep_tid << dendl; repop->rep_aborted = true; if (repop->on_applied) { delete repop->on_applied; @@ -9318,6 +9318,9 @@ void ReplicatedPG::on_shutdown() cancel_copy_ops(false); cancel_flush_ops(false); apply_and_flush_repops(false); + + pgbackend->on_change(); + context_registry_on_change(); osd->remote_reserver.cancel_reservation(info.pgid); @@ -9441,7 +9444,8 @@ void ReplicatedPG::on_change(ObjectStore::Transaction *t) // any dups apply_and_flush_repops(is_primary()); - pgbackend->on_change(t); + pgbackend->on_change_cleanup(t); + pgbackend->on_change(); // clear snap_trimmer state snap_trimmer_machine.process_event(Reset()); diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index 8c27f06840f..9cde9dcfe89 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -1060,8 +1060,56 @@ void pg_pool_t::encode(bufferlist& bl, uint64_t features) const return; } - __u8 encode_compat = 5; - ENCODE_START(15, encode_compat, bl); + if ((features & CEPH_FEATURE_OSD_POOLRESEND) == 0) { + // we simply added last_force_op_resend here, which is a fully + // backward compatible change. however, encoding the same map + // differently between monitors triggers scrub noise (even though + // they are decodable without the feature), so let's be pendantic + // about it. + ENCODE_START(14, 5, bl); + ::encode(type, bl); + ::encode(size, bl); + ::encode(crush_ruleset, bl); + ::encode(object_hash, bl); + ::encode(pg_num, bl); + ::encode(pgp_num, bl); + __u32 lpg_num = 0, lpgp_num = 0; // tell old code that there are no localized pgs. + ::encode(lpg_num, bl); + ::encode(lpgp_num, bl); + ::encode(last_change, bl); + ::encode(snap_seq, bl); + ::encode(snap_epoch, bl); + ::encode(snaps, bl, features); + ::encode(removed_snaps, bl); + ::encode(auid, bl); + ::encode(flags, bl); + ::encode(crash_replay_interval, bl); + ::encode(min_size, bl); + ::encode(quota_max_bytes, bl); + ::encode(quota_max_objects, bl); + ::encode(tiers, bl); + ::encode(tier_of, bl); + __u8 c = cache_mode; + ::encode(c, bl); + ::encode(read_tier, bl); + ::encode(write_tier, bl); + ::encode(properties, bl); + ::encode(hit_set_params, bl); + ::encode(hit_set_period, bl); + ::encode(hit_set_count, bl); + ::encode(stripe_width, bl); + ::encode(target_max_bytes, bl); + ::encode(target_max_objects, bl); + ::encode(cache_target_dirty_ratio_micro, bl); + ::encode(cache_target_full_ratio_micro, bl); + ::encode(cache_min_flush_age, bl); + ::encode(cache_min_evict_age, bl); + ::encode(erasure_code_profile, bl); + ENCODE_FINISH(bl); + return; + } + + ENCODE_START(15, 5, bl); ::encode(type, bl); ::encode(size, bl); ::encode(crush_ruleset, bl); diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 05525ab83b0..ad29f2de815 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -165,7 +165,8 @@ struct RGWObjManifestRule { ::decode(start_ofs, bl); ::decode(part_size, bl); ::decode(stripe_max_size, bl); - ::decode(override_prefix, bl); + if (struct_v >= 2) + ::decode(override_prefix, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const;