PGLog API : missing
Hi Sam,
I tried to consider the part of the API of PGLog related to pg_missing_t, looking at what it currently is and what it should be. At the moment it is ( not considering the methods that have a side effect on both missing and log ):
Accessor:
const pg_missing_t& get_missing() const { return missing; }
Actors:
void missing_add(const hobject_t& oid, eversion_t need, eversion_t have)
void revise_need(hobject_t oid, eversion_t need) void revise_have(hobject_t oid, eversion_t have)
void missing_got(map<hobject_t, pg_missing_t::item>::const_iterator m) void missing_rm(map<hobject_t, pg_missing_t::item>::const_iterator m)
The get_missing read only accessor is used in PG.{cc,h}, OSD.{cc,h}, Replicated.{cc,h} It is used in dozen of different ways and I'm not sure if it would make sense to define an API to replace them. I fail to see a pattern that would be useful.
The missing_add method is used by ReplicatedPG::recover_object_replicas and PG::repair_object The revise_have method is used by ReplicatedPG::submit_push_data The revise_need method is used by ReplicatedPG::mark_all_unfound_lost when handling pg_log_entry_t::LOST_REVERT
The missing_got method is used by ReplicatedPG::mark_all_unfound_lost when handling pg_log_entry_t::LOST_MARK
The missing_rm method is used by ReplicatedPG::mark_all_unfound_lost when handling pg_log_entry_t::LOST_DELETE
All these make sense to me. But I'm looking at what is currently in place rather than thinking about what it should become to accomodate for erasure coding.
With erasure_coding one OSD contains a chunk. If it is lost, it will not be copied from another OSD, it will be repaired by using the content of other OSDs. For instance; if the chunk object 4 version 1,2 is not in OSD 3 the other chunks objects will be fetched from the remaining OSDs, the repair function will then be called using their content to create the chunk object 4 version 1,2. Instead of fetching a copy of the missing object from one OSD, the code would fetch chunk objects from multiple OSDs to be able to repair. Because pg_missing_t is dealing with the missing objects for a single OSD, it may not need to be modified when used in the context of erasure coding.
Am I making any sense ? I'm not sure ;-)
Signature · 2 lines
Loïc Dachary, Artisan Logiciel Libre All that is necessary for the triumph of evil is that good people do nothing.
For the record:
Quoted 6 lines · Samuel Just
That seems like a reasonable break down for the missing set. Rather than representing a full object, the missing set could be understood to represent whether an OSD has or is missing it's own piece of an object, whether that is a full copy or an erasure coded chunk. The primary would use the missing sets to determine which osds are missing which chunks.
Quoted 30 lines · Loic Dachary
Hi Sam,
I tried to consider the part of the API of PGLog related to
pg_missing_t, looking at what it currently is and what it should be. At the moment it is ( not considering the methods that have a side effect on both missing and log ):Accessor:
const pg_missing_t&
get_missing()const { return missing; }Actors:
void
missing_add(const hobject_t& oid, eversion_t need, eversion_t have)
voidrevise_need(hobject_t oid, eversion_t need)voidrevise_have(hobject_t oid, eversion_t have)void
missing_got(map<hobject_t, pg_missing_t::item>::const_iterator m)voidmissing_rm(map<hobject_t, pg_missing_t::item>::const_iterator m)The
get_missingread only accessor is used in PG.{cc,h}, OSD.{cc,h}, Replicated.{cc,h} It is used in dozen of different ways and I'm not sure if it would make sense to define an API to replace them. I fail to see a pattern that would be useful.The
missing_addmethod is used byReplicatedPG::recover_object_replicasandPG::repair_objectTherevise_havemethod is used byReplicatedPG::submit_push_dataTherevise_needmethod is used byReplicatedPG::mark_all_unfound_lostwhen handlingpg_log_entry_t::LOST_REVERT
Themissing_gotmethod is used byReplicatedPG::mark_all_unfound_lostwhen handlingpg_log_entry_t::LOST_MARK
Themissing_rmmethod is used byReplicatedPG::mark_all_unfound_lostwhen handlingpg_log_entry_t::LOST_DELETEAll these make sense to me. But I'm looking at what is currently in place rather than thinking about what it should become to accomodate for erasure coding.
With
erasure_codingone OSD contains a chunk. If it is lost, it will not be copied from another OSD, it will be repaired by using the content of other OSDs. For instance; if the chunk object 4 version 1,2 is not in OSD 3 the other chunks objects will be fetched from the remaining OSDs, the repair function will then be called using their content to create the chunk object 4 version 1,2. Instead of fetching a copy of the missing object from one OSD, the code would fetch chunk objects from multiple OSDs to be able to repair. Becausepg_missing_tis dealing with the missing objects for a single OSD, it may not need to be modified when used in the context of erasure coding.Am I making any sense ? I'm not sure ;-)
Signature · 2 lines
Loïc Dachary, Artisan Logiciel Libre All that is necessary for the triumph of evil is that good people do nothing.