void pg_log_entry_t::encode(ceph::buffer::list &bl) const
{
- ENCODE_START(14, 4, bl);
+ ENCODE_START(15, 4, bl);
encode(op, bl);
encode(soid, bl);
encode(version, bl);
if (op != ERROR)
encode(return_code, bl);
encode(op_returns, bl);
+ encode(written_shards, bl);
+ encode(present_shards, bl);
ENCODE_FINISH(bl);
}
void pg_log_entry_t::decode(ceph::buffer::list::const_iterator &bl)
{
- DECODE_START_LEGACY_COMPAT_LEN(14, 4, 4, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(15, 4, 4, bl);
decode(op, bl);
if (struct_v < 2) {
sobject_t old_soid;
}
decode(op_returns, bl);
}
+ if (struct_v >= 15) {
+ decode(written_shards, bl);
+ decode(present_shards, bl);
+ }
DECODE_FINISH(bl);
}
f->dump_unsigned("snap", *p);
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);
bool invalid_pool; // only when decoding pool-less hobject based entries
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),
invalid_hash(false), invalid_pool(false) {
}
std::string get_key_name() const;
+
+ /// EC partial writes: test if a shard was written
+ 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);