@@ -1642,6 +1642,7 @@ void pg_pool_t::dump(Formatter *f) const
16421642 f->dump_unsigned (" stripe_width" , get_stripe_width ());
16431643 f->dump_unsigned (" expected_num_objects" , expected_num_objects);
16441644 f->dump_bool (" fast_read" , fast_read);
1645+ f->dump_stream (" nonprimary_shards" ) << nonprimary_shards;
16451646 f->open_object_section (" options" );
16461647 opts.dump (f);
16471648 f->close_section (); // options
@@ -1961,7 +1962,7 @@ void pg_pool_t::encode(ceph::buffer::list& bl, uint64_t features) const
19611962 return ;
19621963 }
19631964
1964- uint8_t v = 31 ;
1965+ uint8_t v = 32 ;
19651966 // NOTE: any new encoding dependencies must be reflected by
19661967 // SIGNIFICANT_FEATURES
19671968 if (!HAVE_FEATURE (features, SERVER_TENTACLE)) {
@@ -2080,12 +2081,15 @@ void pg_pool_t::encode(ceph::buffer::list& bl, uint64_t features) const
20802081 auto maybe_peering_crush_data1 = maybe_peering_crush_data ();
20812082 encode (maybe_peering_crush_data1, bl);
20822083 }
2084+ if (v >= 32 ) {
2085+ encode (nonprimary_shards, bl);
2086+ }
20832087 ENCODE_FINISH (bl);
20842088}
20852089
20862090void pg_pool_t::decode (ceph::buffer::list::const_iterator& bl)
20872091{
2088- DECODE_START_LEGACY_COMPAT_LEN (31 , 5 , 5 , bl);
2092+ DECODE_START_LEGACY_COMPAT_LEN (32 , 5 , 5 , bl);
20892093 decode (type, bl);
20902094 decode (size, bl);
20912095 decode (crush_rule, bl);
@@ -2276,6 +2280,11 @@ void pg_pool_t::decode(ceph::buffer::list::const_iterator& bl)
22762280 peering_crush_mandatory_member) = *peering_crush_data;
22772281 }
22782282 }
2283+ if (struct_v >= 32 ) {
2284+ decode (nonprimary_shards, bl);
2285+ } else {
2286+ nonprimary_shards.clear ();
2287+ }
22792288 DECODE_FINISH (bl);
22802289 calc_pg_masks ();
22812290 calc_grade_table ();
@@ -2377,6 +2386,7 @@ void pg_pool_t::generate_test_instances(list<pg_pool_t*>& o)
23772386 a.erasure_code_profile = " profile in osdmap" ;
23782387 a.expected_num_objects = 123456 ;
23792388 a.fast_read = false ;
2389+ a.nonprimary_shards .clear ();
23802390 a.application_metadata = {{" rbd" , {{" key" , " value" }}}};
23812391 o.push_back (new pg_pool_t (a));
23822392
@@ -3617,7 +3627,7 @@ void pg_history_t::generate_test_instances(list<pg_history_t*>& o)
36173627
36183628void pg_info_t::encode (ceph::buffer::list &bl) const
36193629{
3620- ENCODE_START (32 , 26 , bl);
3630+ ENCODE_START (33 , 26 , bl);
36213631 encode (pgid.pgid , bl);
36223632 encode (last_update, bl);
36233633 encode (last_complete, bl);
@@ -3633,12 +3643,13 @@ void pg_info_t::encode(ceph::buffer::list &bl) const
36333643 encode (last_backfill, bl);
36343644 encode (true , bl); // was last_backfill_bitwise
36353645 encode (last_interval_started, bl);
3646+ encode (partial_writes_last_complete, bl);
36363647 ENCODE_FINISH (bl);
36373648}
36383649
36393650void pg_info_t::decode (ceph::buffer::list::const_iterator &bl)
36403651{
3641- DECODE_START (32 , bl);
3652+ DECODE_START (33 , bl);
36423653 decode (pgid.pgid , bl);
36433654 decode (last_update, bl);
36443655 decode (last_complete, bl);
@@ -3667,6 +3678,9 @@ void pg_info_t::decode(ceph::buffer::list::const_iterator &bl)
36673678 } else {
36683679 last_interval_started = last_epoch_started;
36693680 }
3681+ if (struct_v >= 33 ) {
3682+ decode (partial_writes_last_complete, bl);
3683+ }
36703684 DECODE_FINISH (bl);
36713685}
36723686
@@ -3681,6 +3695,16 @@ void pg_info_t::dump(Formatter *f) const
36813695 f->dump_stream (" log_tail" ) << log_tail;
36823696 f->dump_int (" last_user_version" , last_user_version);
36833697 f->dump_stream (" last_backfill" ) << last_backfill;
3698+ f->open_array_section (" partial_writes_last_complete" );
3699+ for (const auto & [shard, versionrange] : partial_writes_last_complete) {
3700+ auto & [from, to] = versionrange;
3701+ f->open_object_section (" shard" );
3702+ f->dump_int (" id" , int (shard));
3703+ f->dump_stream (" from" ) << from;
3704+ f->dump_stream (" to" ) << to;
3705+ f->close_section ();
3706+ }
3707+ f->close_section ();
36843708 f->open_array_section (" purged_snaps" );
36853709 for (interval_set<snapid_t >::const_iterator i=purged_snaps.begin ();
36863710 i != purged_snaps.end ();
@@ -4930,7 +4954,7 @@ void pg_log_entry_t::decode_with_checksum(ceph::buffer::list::const_iterator& p)
49304954
49314955void pg_log_entry_t::encode (ceph::buffer::list &bl) const
49324956{
4933- ENCODE_START (14 , 4 , bl);
4957+ ENCODE_START (15 , 4 , bl);
49344958 encode (op, bl);
49354959 encode (soid, bl);
49364960 encode (version, bl);
@@ -4963,12 +4987,14 @@ void pg_log_entry_t::encode(ceph::buffer::list &bl) const
49634987 if (op != ERROR)
49644988 encode (return_code, bl);
49654989 encode (op_returns, bl);
4990+ encode (written_shards, bl);
4991+ encode (present_shards, bl);
49664992 ENCODE_FINISH (bl);
49674993}
49684994
49694995void pg_log_entry_t::decode (ceph::buffer::list::const_iterator &bl)
49704996{
4971- DECODE_START_LEGACY_COMPAT_LEN (14 , 4 , 4 , bl);
4997+ DECODE_START_LEGACY_COMPAT_LEN (15 , 4 , 4 , bl);
49724998 decode (op, bl);
49734999 if (struct_v < 2 ) {
49745000 sobject_t old_soid;
@@ -5034,6 +5060,10 @@ void pg_log_entry_t::decode(ceph::buffer::list::const_iterator &bl)
50345060 }
50355061 decode (op_returns, bl);
50365062 }
5063+ if (struct_v >= 15 ) {
5064+ decode (written_shards, bl);
5065+ decode (present_shards, bl);
5066+ }
50375067 DECODE_FINISH (bl);
50385068}
50395069
@@ -5083,6 +5113,8 @@ void pg_log_entry_t::dump(Formatter *f) const
50835113 f->dump_unsigned (" snap" , *p);
50845114 f->close_section ();
50855115 }
5116+ f->dump_stream (" written_shards" ) << written_shards;
5117+ f->dump_stream (" present_shards" ) << present_shards;
50865118 {
50875119 f->open_object_section (" mod_desc" );
50885120 mod_desc.dump (f);
@@ -6407,7 +6439,7 @@ void object_info_t::encode(ceph::buffer::list& bl, uint64_t features) const
64076439 for (auto i = watchers.cbegin (); i != watchers.cend (); ++i) {
64086440 old_watchers.insert (make_pair (i->first .second , i->second ));
64096441 }
6410- ENCODE_START (17 , 8 , bl);
6442+ ENCODE_START (18 , 8 , bl);
64116443 encode (soid, bl);
64126444 encode (myoloc, bl); // Retained for compatibility
64136445 encode ((__u32)0 , bl); // was category, no longer used
@@ -6441,13 +6473,14 @@ void object_info_t::encode(ceph::buffer::list& bl, uint64_t features) const
64416473 if (has_manifest ()) {
64426474 encode (manifest, bl);
64436475 }
6476+ encode (shard_versions, bl);
64446477 ENCODE_FINISH (bl);
64456478}
64466479
64476480void object_info_t::decode (ceph::buffer::list::const_iterator& bl)
64486481{
64496482 object_locator_t myoloc;
6450- DECODE_START_LEGACY_COMPAT_LEN (17 , 8 , 8 , bl);
6483+ DECODE_START_LEGACY_COMPAT_LEN (18 , 8 , 8 , bl);
64516484 map<entity_name_t , watch_info_t > old_watchers;
64526485 decode (soid, bl);
64536486 decode (myoloc, bl);
@@ -6533,6 +6566,9 @@ void object_info_t::decode(ceph::buffer::list::const_iterator& bl)
65336566 decode (manifest, bl);
65346567 }
65356568 }
6569+ if (struct_v >= 18 ) {
6570+ decode (shard_versions, bl);
6571+ }
65366572 DECODE_FINISH (bl);
65376573}
65386574
@@ -6572,6 +6608,14 @@ void object_info_t::dump(Formatter *f) const
65726608 f->close_section ();
65736609 }
65746610 f->close_section ();
6611+ f->open_array_section (" shard_versions" );
6612+ for (auto p = shard_versions.cbegin (); p != shard_versions.cend (); ++p) {
6613+ f->open_object_section (" shard" );
6614+ f->dump_int (" id" , int (p->first ));
6615+ f->dump_stream (" version" ) << p->second ;
6616+ f->close_section ();
6617+ }
6618+ f->close_section ();
65756619}
65766620
65776621void object_info_t::generate_test_instances (list<object_info_t *>& o)
0 commit comments