Merge remote-tracking branch 'gh/next'

This commit is contained in:
Sage Weil 2014-07-11 14:56:40 -07:00
commit 49e5c8ec88
11 changed files with 83 additions and 17 deletions

View File

@ -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<ceph_tid_t, ReadOp>::iterator i = tid_to_read_map.begin();

View File

@ -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();

View File

@ -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

View File

@ -759,6 +759,7 @@ public:
void pg_stat_queue_dequeue(PG *pg);
void init();
void start_shutdown();
void shutdown();
// split

View File

@ -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)

View File

@ -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;

View File

@ -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<ceph_tid_t, InProgressOp>::iterator i = in_progress_ops.begin();
i != in_progress_ops.end();
in_progress_ops.erase(i++)) {

View File

@ -69,7 +69,7 @@ public:
OpRequestRef op
);
void _on_change(ObjectStore::Transaction *t);
void on_change();
void clear_state();
void on_flushed();

View File

@ -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());

View File

@ -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);

View File

@ -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;