mirror of
https://github.com/ceph/ceph
synced 2025-01-03 09:32:43 +00:00
osd: Add tracking of acting_features and upacting_features
Use most appropriate feature intersection depending on context Signed-off-by: David Zafman <dzafman@redhat.com>
This commit is contained in:
parent
6d28cb9465
commit
de041241ad
@ -217,7 +217,9 @@ PG::PG(OSDService *o, OSDMapRef curmap,
|
|||||||
active_pushes(0),
|
active_pushes(0),
|
||||||
recovery_state(this),
|
recovery_state(this),
|
||||||
pg_id(p),
|
pg_id(p),
|
||||||
peer_features(CEPH_FEATURES_SUPPORTED_DEFAULT)
|
peer_features(CEPH_FEATURES_SUPPORTED_DEFAULT),
|
||||||
|
acting_features(CEPH_FEATURES_SUPPORTED_DEFAULT),
|
||||||
|
upacting_features(CEPH_FEATURES_SUPPORTED_DEFAULT)
|
||||||
{
|
{
|
||||||
#ifdef PG_DEBUG_REFS
|
#ifdef PG_DEBUG_REFS
|
||||||
osd->add_pgid(p, this);
|
osd->add_pgid(p, this);
|
||||||
@ -4000,7 +4002,7 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle)
|
|||||||
osd->clog->info(oss);
|
osd->clog->info(oss);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peer_features & CEPH_FEATURE_OSD_OBJECT_DIGEST)
|
if (get_min_acting_features() & CEPH_FEATURE_OSD_OBJECT_DIGEST)
|
||||||
scrubber.seed = -1; // better, and enables oi digest checks
|
scrubber.seed = -1; // better, and enables oi digest checks
|
||||||
else
|
else
|
||||||
scrubber.seed = 0; // compat
|
scrubber.seed = 0; // compat
|
||||||
@ -4249,7 +4251,7 @@ void PG::scrub_compare_maps()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// can we relate scrub digests to oi digests?
|
// can we relate scrub digests to oi digests?
|
||||||
bool okseed = (get_min_peer_features() & CEPH_FEATURE_OSD_OBJECT_DIGEST);
|
bool okseed = (get_min_upacting_features() & CEPH_FEATURE_OSD_OBJECT_DIGEST);
|
||||||
assert(okseed == (scrubber.seed == 0xffffffff));
|
assert(okseed == (scrubber.seed == 0xffffffff));
|
||||||
|
|
||||||
get_pgbackend()->be_compare_scrubmaps(
|
get_pgbackend()->be_compare_scrubmaps(
|
||||||
@ -6905,7 +6907,7 @@ PG::RecoveryState::GetInfo::GetInfo(my_context ctx)
|
|||||||
if (!prior_set.get())
|
if (!prior_set.get())
|
||||||
pg->build_prior(prior_set);
|
pg->build_prior(prior_set);
|
||||||
|
|
||||||
pg->reset_peer_features();
|
pg->reset_all_min_features();
|
||||||
get_infos();
|
get_infos();
|
||||||
if (peer_info_requested.empty() && !prior_set->pg_down) {
|
if (peer_info_requested.empty() && !prior_set->pg_down) {
|
||||||
post_event(GotInfo());
|
post_event(GotInfo());
|
||||||
@ -6981,10 +6983,22 @@ boost::statechart::result PG::RecoveryState::GetInfo::react(const MNotifyRec& in
|
|||||||
}
|
}
|
||||||
get_infos();
|
get_infos();
|
||||||
}
|
}
|
||||||
dout(20) << "Adding osd: " << infoevt.from.osd << " features: "
|
dout(20) << "Adding osd: " << infoevt.from.osd << " peer features: "
|
||||||
<< hex << infoevt.features << dec << dendl;
|
<< hex << infoevt.features << dec << dendl;
|
||||||
pg->apply_peer_features(infoevt.features);
|
pg->apply_peer_features(infoevt.features);
|
||||||
|
|
||||||
|
if (std::find(pg->acting.begin(), pg->acting.end(), infoevt.from.osd) != pg->acting.end()) {
|
||||||
|
dout(20) << "Adding osd: " << infoevt.from.osd << " acting features: "
|
||||||
|
<< hex << infoevt.features << dec << dendl;
|
||||||
|
pg->apply_acting_features(infoevt.features);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (std::find(pg->up.begin(), pg->up.end(), infoevt.from.osd) != pg->up.end()) {
|
||||||
|
dout(20) << "Adding osd: " << infoevt.from.osd << " upacting features: "
|
||||||
|
<< hex << infoevt.features << dec << dendl;
|
||||||
|
pg->apply_upacting_features(infoevt.features);
|
||||||
|
}
|
||||||
|
|
||||||
// are we done getting everything?
|
// are we done getting everything?
|
||||||
if (peer_info_requested.empty() && !prior_set->pg_down) {
|
if (peer_info_requested.empty() && !prior_set->pg_down) {
|
||||||
/*
|
/*
|
||||||
@ -7042,7 +7056,9 @@ boost::statechart::result PG::RecoveryState::GetInfo::react(const MNotifyRec& in
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dout(20) << "Common features: " << hex << pg->get_min_peer_features() << dec << dendl;
|
dout(20) << "Common peer features: " << hex << pg->get_min_peer_features() << dec << dendl;
|
||||||
|
dout(20) << "Common acting features: " << hex << pg->get_min_acting_features() << dec << dendl;
|
||||||
|
dout(20) << "Common upacting features: " << hex << pg->get_min_upacting_features() << dec << dendl;
|
||||||
post_event(GotInfo());
|
post_event(GotInfo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
12
src/osd/PG.h
12
src/osd/PG.h
@ -2012,14 +2012,24 @@ public:
|
|||||||
PG& operator=(const PG& rhs);
|
PG& operator=(const PG& rhs);
|
||||||
const spg_t pg_id;
|
const spg_t pg_id;
|
||||||
uint64_t peer_features;
|
uint64_t peer_features;
|
||||||
|
uint64_t acting_features;
|
||||||
|
uint64_t upacting_features;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
const spg_t& get_pgid() const { return pg_id; }
|
const spg_t& get_pgid() const { return pg_id; }
|
||||||
int get_nrep() const { return acting.size(); }
|
int get_nrep() const { return acting.size(); }
|
||||||
|
|
||||||
void reset_peer_features() { peer_features = CEPH_FEATURES_SUPPORTED_DEFAULT; }
|
void reset_all_min_features() {
|
||||||
|
peer_features = CEPH_FEATURES_SUPPORTED_DEFAULT;
|
||||||
|
acting_features = CEPH_FEATURES_SUPPORTED_DEFAULT;
|
||||||
|
upacting_features = CEPH_FEATURES_SUPPORTED_DEFAULT;
|
||||||
|
}
|
||||||
uint64_t get_min_peer_features() const { return peer_features; }
|
uint64_t get_min_peer_features() const { return peer_features; }
|
||||||
|
uint64_t get_min_acting_features() const { return acting_features; }
|
||||||
|
uint64_t get_min_upacting_features() const { return upacting_features; }
|
||||||
void apply_peer_features(uint64_t f) { peer_features &= f; }
|
void apply_peer_features(uint64_t f) { peer_features &= f; }
|
||||||
|
void apply_acting_features(uint64_t f) { acting_features &= f; }
|
||||||
|
void apply_upacting_features(uint64_t f) { upacting_features &= f; }
|
||||||
|
|
||||||
void init_primary_up_acting(
|
void init_primary_up_acting(
|
||||||
const vector<int> &newup,
|
const vector<int> &newup,
|
||||||
|
@ -4118,7 +4118,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
|
|||||||
++ctx->num_write;
|
++ctx->num_write;
|
||||||
{
|
{
|
||||||
tracepoint(osd, do_osd_op_pre_setallochint, soid.oid.name.c_str(), soid.snap.val, op.alloc_hint.expected_object_size, op.alloc_hint.expected_write_size);
|
tracepoint(osd, do_osd_op_pre_setallochint, soid.oid.name.c_str(), soid.snap.val, op.alloc_hint.expected_object_size, op.alloc_hint.expected_write_size);
|
||||||
if (!(get_min_peer_features() & CEPH_FEATURE_OSD_SET_ALLOC_HINT)) {
|
if (!(get_min_upacting_features() & CEPH_FEATURE_OSD_SET_ALLOC_HINT)) {
|
||||||
result = -EOPNOTSUPP;
|
result = -EOPNOTSUPP;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -452,7 +452,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool transaction_use_tbl() {
|
bool transaction_use_tbl() {
|
||||||
uint64_t min_features = get_min_peer_features();
|
uint64_t min_features = get_min_upacting_features();
|
||||||
return !(min_features & CEPH_FEATURE_OSD_TRANSACTION_MAY_LAYOUT);
|
return !(min_features & CEPH_FEATURE_OSD_TRANSACTION_MAY_LAYOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user