f->dump_int("object_hash", get_object_hash());
f->dump_unsigned("pg_num", get_pg_num());
f->dump_unsigned("pg_placement_num", get_pgp_num());
+ f->dump_unsigned("pg_placement_num_target", get_pgp_num_target());
+ f->dump_unsigned("pg_num_target", get_pg_num_target());
+ f->dump_unsigned("pg_num_pending", get_pg_num_pending());
+ f->dump_unsigned("pg_num_pending_dec_epoch", get_pg_num_pending_dec_epoch());
f->dump_stream("last_change") << get_last_change();
f->dump_stream("last_force_op_resend") << get_last_force_op_resend();
f->dump_stream("last_force_op_resend_preluminous")
return;
}
- uint8_t v = 27;
+ uint8_t v = 28;
// NOTE: any new encoding dependencies must be reflected by
// SIGNIFICANT_FEATURES
if (!(features & CEPH_FEATURE_NEW_OSDOP_ENCODING)) {
v = 24;
} else if (!HAVE_FEATURE(features, SERVER_MIMIC)) {
v = 26;
+ } else if (!HAVE_FEATURE(features, SERVER_NAUTILUS)) {
+ v = 27;
}
ENCODE_START(v, 5, bl);
if (v >= 27) {
encode(create_time, bl);
}
+ if (v >= 28) {
+ encode(pg_num_target, bl);
+ encode(pgp_num_target, bl);
+ encode(pg_num_pending, bl);
+ encode(pg_num_pending_dec_epoch, bl);
+ }
ENCODE_FINISH(bl);
}
void pg_pool_t::decode(bufferlist::const_iterator& bl)
{
- DECODE_START_LEGACY_COMPAT_LEN(27, 5, 5, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(28, 5, 5, bl);
decode(type, bl);
decode(size, bl);
decode(crush_rule, bl);
if (struct_v >= 27) {
decode(create_time, bl);
}
+ if (struct_v >= 28) {
+ decode(pg_num_target, bl);
+ decode(pgp_num_target, bl);
+ decode(pg_num_pending, bl);
+ decode(pg_num_pending_dec_epoch, bl);
+ } else {
+ pg_num_target = pg_num;
+ pgp_num_target = pgp_num;
+ pg_num_pending = pg_num;
+ }
DECODE_FINISH(bl);
calc_pg_masks();
calc_grade_table();
a.crush_rule = 3;
a.object_hash = 4;
a.pg_num = 6;
- a.pgp_num = 5;
+ a.pgp_num = 4;
+ a.pgp_num_target = 4;
+ a.pg_num_target = 5;
+ a.pg_num_pending = 5;
+ a.pg_num_pending_dec_epoch = 2;
a.last_change = 9;
a.last_force_op_resend = 123823;
a.last_force_op_resend_preluminous = 123824;
<< " crush_rule " << p.get_crush_rule()
<< " object_hash " << p.get_object_hash_name()
<< " pg_num " << p.get_pg_num()
- << " pgp_num " << p.get_pgp_num()
- << " last_change " << p.get_last_change();
+ << " pgp_num " << p.get_pgp_num();
+ if (p.get_pg_num_target() != p.get_pg_num()) {
+ out << " pg_num_target " << p.get_pg_num_target();
+ }
+ if (p.get_pgp_num_target() != p.get_pgp_num()) {
+ out << " pgp_num_target " << p.get_pgp_num_target();
+ }
+ if (p.get_pg_num_pending() != p.get_pg_num()) {
+ out << " pg_num_pending " << p.get_pg_num_pending()
+ << "(e" << p.get_pg_num_pending_dec_epoch() << ")";
+ }
+ out << " last_change " << p.get_last_change();
if (p.get_last_force_op_resend() ||
p.get_last_force_op_resend_preluminous())
out << " lfor " << p.get_last_force_op_resend() << "/"
__u8 crush_rule; ///< crush placement rule
__u8 object_hash; ///< hash mapping object name to ps
private:
- __u32 pg_num, pgp_num; ///< number of pgs
-
+ __u32 pg_num = 0, pgp_num = 0; ///< number of pgs
+ __u32 pg_num_pending = 0; ///< pg_num we are about to merge down to
+ __u32 pg_num_target = 0; ///< pg_num we should converge toward
+ __u32 pgp_num_target = 0; ///< pgp_num we should converge toward
public:
map<string,string> properties; ///< OBSOLETE
epoch_t last_force_op_resend; ///< last epoch that forced clients to resend
/// last epoch that forced clients to resend (pre-luminous clients only)
epoch_t last_force_op_resend_preluminous;
+ epoch_t pg_num_pending_dec_epoch = 0; ///< epoch pg_num_pending decremented
snapid_t snap_seq; ///< seq for per-pool snapshot
epoch_t snap_epoch; ///< osdmap epoch of last snap
uint64_t auid; ///< who owns the pg
pg_pool_t()
: flags(0), type(0), size(0), min_size(0),
crush_rule(0), object_hash(0),
- pg_num(0), pgp_num(0),
last_change(0),
last_force_op_resend(0),
last_force_op_resend_preluminous(0),
unsigned get_pg_num() const { return pg_num; }
unsigned get_pgp_num() const { return pgp_num; }
+ unsigned get_pg_num_target() const { return pg_num_target; }
+ unsigned get_pgp_num_target() const { return pgp_num_target; }
+ unsigned get_pg_num_pending() const { return pg_num_pending; }
+ epoch_t get_pg_num_pending_dec_epoch() const {
+ return pg_num_pending_dec_epoch;
+ }
unsigned get_pg_num_mask() const { return pg_num_mask; }
unsigned get_pgp_num_mask() const { return pgp_num_mask; }
void set_pg_num(int p) {
pg_num = p;
+ pg_num_pending = p;
calc_pg_masks();
}
void set_pgp_num(int p) {
pgp_num = p;
calc_pg_masks();
}
+ void set_pg_num_pending(int p, epoch_t e) {
+ pg_num_pending = p;
+ pg_num_pending_dec_epoch = e;
+ calc_pg_masks();
+ }
+ void set_pg_num_target(int p) {
+ pg_num_target = p;
+ }
+ void set_pgp_num_target(int p) {
+ pgp_num_target = p;
+ }
+ void dec_pg_num() {
+ --pg_num;
+ calc_pg_masks();
+ }
void set_quota_max_bytes(uint64_t m) {
quota_max_bytes = m;