shard_written(shard_id_t(0));
}
- written_and_present_shards();
+ written_shards();
if (!op.attr_updates.empty()) {
attr_updates();
}
}
-void ECTransaction::Generate::written_and_present_shards() {
+void ECTransaction::Generate::written_shards() {
if (entry) {
if (!rollback_extents.empty()) {
entry->mod_desc.rollback_extents(
entry->written_shards.clear();
written_shards_final = true;
}
- // Calculate set of present shards
- for (auto &&[shard, t]: transactions) {
- entry->present_shards.insert(shard);
- }
- if (entry->present_shards.size() == sinfo.get_k_plus_m()) {
- // More efficient to encode an empty set for all shards
- entry->present_shards.clear();
- }
// Update shard_versions in object_info to record which shards are being
// written
}
ldpp_dout(dpp, 20) << __func__ << " shard_info: oid=" << oid
<< " version=" << entry->version
- << " present=" << entry->present_shards
<< " written=" << entry->written_shards
<< " shard_versions=" << oi.shard_versions << dendl;
}
void truncate();
void overlay_writes();
void appends_and_clone_ranges();
- void written_and_present_shards();
+ void written_shards();
void attr_updates();
public:
auto dpp = get_parent()->get_dpp();
ldpp_dout(dpp, 20) << __func__ << " version=" << entry.version
<< " written_shards=" << entry.written_shards
- << " present_shards=" << entry.present_shards
<< " pwlc=" << info->partial_writes_last_complete
<< " previous_version=" << previous_version
<< dendl;
for (auto&& [pg_shard, pi] : all_info) {
psdout(20) << "version " << p->version
<< " testing osd " << pg_shard
- << " written=" << p->written_shards
- << " present=" << p->present_shards << dendl;
- if (p->is_present_shard(pg_shard.shard) &&
- p->is_written_shard(pg_shard.shard)) {
+ << " written=" << p->written_shards << dendl;
+ if (p->is_written_shard(pg_shard.shard)) {
if (pi.last_update < p->version) {
if (!shards_with_update.contains(pg_shard.shard)) {
shards_without_update.insert(pg_shard.shard);
encode(return_code, bl);
encode(op_returns, bl);
encode(written_shards, bl);
- encode(present_shards, bl);
+ shard_id_set unused;
+ encode(unused, bl);
ENCODE_FINISH(bl);
}
}
if (struct_v >= 15) {
decode(written_shards, bl);
- decode(present_shards, bl);
+ shard_id_set unused;
+ decode(unused, bl);
}
DECODE_FINISH(bl);
}
f->close_section();
}
f->dump_stream("written_shards") << written_shards;
- f->dump_stream("present_shards") << present_shards;
{
f->open_object_section("mod_desc");
mod_desc.dump(f);
ObjectCleanRegions clean_regions;
shard_id_set written_shards; // EC partial writes do not update every shard
- shard_id_set present_shards; // EC partial writes need to know set of present shards
pg_log_entry_t()
: user_version(0), return_code(0), op(0),
bool is_written_shard(const shard_id_t shard) const {
return written_shards.empty() || written_shards.contains(shard);
}
- bool is_present_shard(const shard_id_t shard) const {
- return present_shards.empty() || present_shards.contains(shard);
- }
void encode_with_checksum(ceph::buffer::list& bl) const;
void decode_with_checksum(ceph::buffer::list::const_iterator& p);