Ceph backfilling explained ( maybe )
Hi,
Here is a draft of my current understanding of backfilling. Disclaimer : it is possible that I completely misunderstood ;-)
Cheers
Ceph stores objects in pools which are divided in placement groups.
+---------------------------- pool a ----+ |+----- placement group 1 -------------+ | ||+-------+ +-------+ | | |||object | |object | | | ||+-------+ +-------+ | | |+-------------------------------------+ | |+----- placement group 2 -------------+ | ||+-------+ +-------+ | | |||object | |object | ... | | ||+-------+ +-------+ | | |+-------------------------------------+ | | .... | | | +----------------------------------------+
+---------------------------- pool b ----+ |+----- placement group 1 -------------+ | ||+-------+ +-------+ | | |||object | |object | | | ||+-------+ +-------+ | | |+-------------------------------------+ | |+----- placement group 2 -------------+ | ||+-------+ +-------+ | | |||object | |object | ... | | ||+-------+ +-------+ | | |+-------------------------------------+ | | .... | | | +----------------------------------------+
...
The placement group is supported by OSDs to store the objects. They are daemons running on machines where storage For instance, a placement group supporting three replicates will have three OSDs at his disposal : one OSDs is the primary and the two other store copies of each object.
+-------- placement group -------------+
|+----------------+ +----------------+ |
|| object A | | object B | |
|+----------------+ +----------------+ |
+---+-------------+-----------+--------+
| | |
| | |
OSD 0 OSD 1 OSD 2
+------+ +------+ +------+
|+---+ | |+---+ | |+---+ |
|| A | | || A | | || A | |
|+---+ | |+---+ | |+---+ |
|+---+ | |+---+ | |+---+ |
|| B | | || B | | || B | |
|+---+ | |+---+ | |+---+ |
+------+ +------+ +------+The OSDs are not for the exclusive use of the placement group : multiple placement groups can use the same OSDs to store their objects. However, the collocation of objects from various placement groups in the same OSD is transparent and is not discussed here.
The placement group does not run as a single daemon as suggested above. Instead it os distributed and resides within each OSD. Whenever an OSD dies, the placement group for this OSD is gone and needs to be reconstructed using another OSD.
OSD 0 OSD 1 ...
+----------------+---- placement group --------+ +------
|+--- object --+ |+--------------------------+ | |
|| name : B | || pg_log_entry_t MODIFY | | |
|| key : 2 | || pg_log_entry_t DELETE | | |
|+-------------+ |+--------------------------+ | |
|+--- object --+ >------ last_backfill | | ....
|| name : A | | | |
|| key : 5 | | | |
|+-------------+ | | |
| | | |
| .... | | |
+----------------+-----------------------------+ +-----When an object is deleted or modified in the placement group, it is recorded in a log to be replayed if needed. In the simplest case, if an OSD gets disconnected, reconnects and needs to catch up with the other OSDs, copies of the log entries will be sent to it. However, the logs have a limited size and it may be more efficient, in some cases, to just copy the objects over instead of replaying the logs.
Each object name is hashed into an integer that can be used to order them. For instance, the object B above has been hashed to key 2 and the object A above has been hashed to key 5. The last_backfill pointer of the placement group draws the limit separating the objects that have already been copied from other OSDs and those in the process of being copied. The objects that are lower than last_backfill have been copied ( that would be object B above ) and the objects that are greater than last_backfill are going to be copied.
It may take time for an OSD to catch up and it is useful to allow replaying the logs while backfilling. log entries related to objects lower than last_backfill are applied. However, log entries related to objects greater than last_backfill are discarded because it is scheduled to be copied at a later time anyway.
Signature · 2 lines
Loïc Dachary, Artisan Logiciel Libre All that is necessary for the triumph of evil is that good people do nothing.
Quoted 2 lines · Loic Dachary
Hi,
Hi Loic,
Quoted 2 lines
Here is a draft of my current understanding of backfilling. Disclaimer : it is possible that I completely misunderstood ;-)
Maybe I'm wrong, but I think there are some flaws in your explanation.
Disclaimer: I'm not a Ceph developer, but a fellow Ceph tester/user.
I would think almost any explanation of how Ceph works would use words like hash or algorithm.
Because the RADOS algorithm determines where data ends up.
It is used to calculate how to balance the data over the different placement groups, osds and machines.
I believe/assumed it works like this:
- an OSD belongs to one pool
- an OSD can serve many placement groups
- a placement group belongs to one pool
- the monitors know which OSD's exist in each pool and which are up
- this is sometimes called the topology, usually the osdmap and pgmap
- the monitors need to have quorum to be authoritive for their data before making changes.
- the list of monitors is called the monmap.
- when storing/retrieving a client will have to do a RADOS-calculation
- to do this calculation it will first need to talk to one of the monitor which has quorum
to get the osdmap and pgmap. They serve as input for the RADOS-algorithm
- one OSD is the master for one piece of data and serves as the contact-point for clients
- that master OSD for a piece of data also runs the RADOS-calculation to talk to the other OSDs
when replicating data changes
- a piece of data is called an object. Ceph is an Object Storage system/Object Store.
- the Ceph Object Store is not the same as a Swift or RADOS-GW object store.
- a Cehp object can store keys/values, not just data
- when using RBD the RBD client will create a 'directory' object which contains general information
like the version/type of RBD-image and a list of names of the image parts. Each part is the same
size, I think it was 4MB ?
- when an OSD or client connects to an OSD they also communicate information about atleast the osdmap and monmap.
- when one OSD or monitor can't reach an other mon or OSD, they will use a gossip protocol to communicate that to connected clients, OSDs or mons.
- when a new OSD comes online the other OSD's talk to it to know what data they might need to exchange
this is called peering.
- the RADOS-algorithm works similair to consistent hashing, so a client can talk directly to the OSD where the data is or should be stored.
- backfilling is what a master OSD does when it is checking if the other OSD's that should have a copy actaully has a copy. It will send a copy of missing objects.
How the RADOS-algoritm calculates based on the osdmap and pgmap what pg and master-osd an object belongs to I'm not a 100% sure.
Does that help ?
Quoted 74 lines
Cheers
Ceph stores objects in pools which are divided in placement groups.
+---------------------------- pool a ----+ |+----- placement group 1 -------------+ | ||+-------+ +-------+ | | |||object | |object | | | ||+-------+ +-------+ | | |+-------------------------------------+ | |+----- placement group 2 -------------+ | ||+-------+ +-------+ | | |||object | |object | ... | | ||+-------+ +-------+ | | |+-------------------------------------+ | | .... | | | +----------------------------------------++---------------------------- pool b ----+ |+----- placement group 1 -------------+ | ||+-------+ +-------+ | | |||object | |object | | | ||+-------+ +-------+ | | |+-------------------------------------+ | |+----- placement group 2 -------------+ | ||+-------+ +-------+ | | |||object | |object | ... | | ||+-------+ +-------+ | | |+-------------------------------------+ | | .... | | | +----------------------------------------+...The placement group is supported by OSDs to store the objects. They are daemons running on machines where storage For instance, a placement group supporting three replicates will have three OSDs at his disposal : one OSDs is the primary and the two other store copies of each object.
+-------- placement group -------------+ |+----------------+ +----------------+ | || object A | | object B | | |+----------------+ +----------------+ | +---+-------------+-----------+--------+ | | | | | | OSD 0 OSD 1 OSD 2 +------+ +------+ +------+ |+---+ | |+---+ | |+---+ | || A | | || A | | || A | | |+---+ | |+---+ | |+---+ | |+---+ | |+---+ | |+---+ | || B | | || B | | || B | | |+---+ | |+---+ | |+---+ | +------+ +------+ +------+The OSDs are not for the exclusive use of the placement group : multiple placement groups can use the same OSDs to store their objects. However, the collocation of objects from various placement groups in the same OSD is transparent and is not discussed here.
The placement group does not run as a single daemon as suggested above. Instead it os distributed and resides within each OSD. Whenever an OSD dies, the placement group for this OSD is gone and needs to be reconstructed using another OSD.
OSD 0 OSD 1 ... +----------------+---- placement group --------+ +------ |+--- object --+ |+--------------------------+ | | || name : B | || pg_log_entry_t MODIFY | | | || key : 2 | || pg_log_entry_t DELETE | | | |+-------------+ |+--------------------------+ | | |+--- object --+ >------ last_backfill | | .... || name : A | | | | || key : 5 | | | | |+-------------+ | | | | | | | | .... | | | +----------------+-----------------------------+ +-----
Quoted 11 lines
When an object is deleted or modified in the placement group, it is recorded in a log to be replayed if needed. In the simplest case, if an OSD gets disconnected, reconnects and needs to catch up with the other OSDs, copies of the log entries will be sent to it. However, the logs have a limited size and it may be more efficient, in some cases, to just copy the objects over instead of replaying the logs.
Each object name is hashed into an integer that can be used to order them. For instance, the object B above has been hashed to key 2 and the object A above has been hashed to key 5. The
last_backfillpointer of the placement group draws the limit separating the objects that have already been copied from other OSDs and those in the process of being copied. The objects that are lower thanlast_backfillhave been copied ( that would be object B above ) and the objects that are greater thanlast_backfillare going to be copied.It may take time for an OSD to catch up and it is useful to allow replaying the logs while backfilling. log entries related to objects lower than
last_backfillare applied. However, log entries related to objects greater thanlast_backfillare discarded because it is scheduled to be copied at a later time anyway.Signature · 2 lines
Loïc Dachary, Artisan Logiciel Libre All that is necessary for the triumph of evil is that good people do nothing.
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
On 05/25/2013 02:33 PM, Leen Besselink wrote:
Hi Leen,
Quoted 1 line
- a Cehp object can store keys/values, not just data
I did not know that. Could you explain or give me the URL ?
Quoted 3 lines
- when using RBD the RBD client will create a 'directory' object which contains general information like the version/type of RBD-image and a list of names of the image parts. Each part is the same size, I think it was 4MB ?
That's also my understanding : 4MB is the default.
Quoted 6 lines
- when an OSD or client connects to an OSD they also communicate information about atleast the osdmap and monmap.
- when one OSD or monitor can't reach an other mon or OSD, they will use a gossip protocol to communicate that to connected clients, OSDs or mons.
- when a new OSD comes online the other OSD's talk to it to know what data they might need to exchange
this is called peering.
- the RADOS-algorithm works similair to consistent hashing, so a client can talk directly to the OSD where the data is or should be stored.
- backfilling is what a master OSD does when it is checking if the other OSD's that should have a copy actaully has a copy. It will send a copy of missing objects.
I guess that's the area where I'm still unsure how it goes. I should look into the state machine of PG.{h,cc} to figure out how backfill related messages are exchanged.
Thanks for taking the time to explain :-)
Cheers
Quoted 95 lines
How the RADOS-algoritm calculates based on the osdmap and pgmap what pg and master-osd an object belongs to I'm not a 100% sure.
Does that help ?
Quoted 74 lines
Cheers
Ceph stores objects in pools which are divided in placement groups.
+---------------------------- pool a ----+ |+----- placement group 1 -------------+ | ||+-------+ +-------+ | | |||object | |object | | | ||+-------+ +-------+ | | |+-------------------------------------+ | |+----- placement group 2 -------------+ | ||+-------+ +-------+ | | |||object | |object | ... | | ||+-------+ +-------+ | | |+-------------------------------------+ | | .... | | | +----------------------------------------++---------------------------- pool b ----+ |+----- placement group 1 -------------+ | ||+-------+ +-------+ | | |||object | |object | | | ||+-------+ +-------+ | | |+-------------------------------------+ | |+----- placement group 2 -------------+ | ||+-------+ +-------+ | | |||object | |object | ... | | ||+-------+ +-------+ | | |+-------------------------------------+ | | .... | | | +----------------------------------------+...The placement group is supported by OSDs to store the objects. They are daemons running on machines where storage For instance, a placement group supporting three replicates will have three OSDs at his disposal : one OSDs is the primary and the two other store copies of each object.
+-------- placement group -------------+ |+----------------+ +----------------+ | || object A | | object B | | |+----------------+ +----------------+ | +---+-------------+-----------+--------+ | | | | | | OSD 0 OSD 1 OSD 2 +------+ +------+ +------+ |+---+ | |+---+ | |+---+ | || A | | || A | | || A | | |+---+ | |+---+ | |+---+ | |+---+ | |+---+ | |+---+ | || B | | || B | | || B | | |+---+ | |+---+ | |+---+ | +------+ +------+ +------+The OSDs are not for the exclusive use of the placement group : multiple placement groups can use the same OSDs to store their objects. However, the collocation of objects from various placement groups in the same OSD is transparent and is not discussed here.
The placement group does not run as a single daemon as suggested above. Instead it os distributed and resides within each OSD. Whenever an OSD dies, the placement group for this OSD is gone and needs to be reconstructed using another OSD.
OSD 0 OSD 1 ... +----------------+---- placement group --------+ +------ |+--- object --+ |+--------------------------+ | | || name : B | || pg_log_entry_t MODIFY | | | || key : 2 | || pg_log_entry_t DELETE | | | |+-------------+ |+--------------------------+ | | |+--- object --+ >------ last_backfill | | .... || name : A | | | | || key : 5 | | | | |+-------------+ | | | | | | | | .... | | | +----------------+-----------------------------+ +-----Quoted 11 lines
When an object is deleted or modified in the placement group, it is recorded in a log to be replayed if needed. In the simplest case, if an OSD gets disconnected, reconnects and needs to catch up with the other OSDs, copies of the log entries will be sent to it. However, the logs have a limited size and it may be more efficient, in some cases, to just copy the objects over instead of replaying the logs.
Each object name is hashed into an integer that can be used to order them. For instance, the object B above has been hashed to key 2 and the object A above has been hashed to key 5. The
last_backfillpointer of the placement group draws the limit separating the objects that have already been copied from other OSDs and those in the process of being copied. The objects that are lower thanlast_backfillhave been copied ( that would be object B above ) and the objects that are greater thanlast_backfillare going to be copied.It may take time for an OSD to catch up and it is useful to allow replaying the logs while backfilling. log entries related to objects lower than
last_backfillare applied. However, log entries related to objects greater thanlast_backfillare discarded because it is scheduled to be copied at a later time anyway.Signature · 2 lines
Loïc Dachary, Artisan Logiciel Libre All that is necessary for the triumph of evil is that good people do nothing.--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Loïc Dachary, Artisan Logiciel Libre All that is necessary for the triumph of evil is that good people do nothing.
Quoted 9 lines · Loic Dachary
On 05/25/2013 02:33 PM, Leen Besselink wrote:
Hi Leen,Quoted 1 line
- a Cehp object can store keys/values, not just data
I did not know that. Could you explain or give me the URL ?
Well, I got that impression from some of the earlier talks and from this blog post:
http://ceph.com/community/my-first-impressions-of-ceph-as-a-summer-intern/
But I haven't read it in while.
But at this time I only see something like:
http://ceph.com/docs/master/rados/api/librados/?highlight=rados_getxattr#rados_getxattr
Which looks like it is storing it in filesystem attributes.
So maybe an object can be a piece of data or a key/value store.
Quoted 6 lines
Quoted 3 lines
- when using RBD the RBD client will create a 'directory' object which contains general information like the version/type of RBD-image and a list of names of the image parts. Each part is the same size, I think it was 4MB ?
That's also my understanding : 4MB is the default.
Quoted 9 lines
Quoted 6 lines
- when an OSD or client connects to an OSD they also communicate information about atleast the osdmap and monmap.
- when one OSD or monitor can't reach an other mon or OSD, they will use a gossip protocol to communicate that to connected clients, OSDs or mons.
- when a new OSD comes online the other OSD's talk to it to know what data they might need to exchange
this is called peering.
- the RADOS-algorithm works similair to consistent hashing, so a client can talk directly to the OSD where the data is or should be stored.
- backfilling is what a master OSD does when it is checking if the other OSD's that should have a copy actaully has a copy. It will send a copy of missing objects.I guess that's the area where I'm still unsure how it goes. I should look into the state machine of PG.{h,cc} to figure out how backfill related messages are exchanged.
Well, I assume the master of an object knows it is the master.
When it knows an OSD has left the cluster it knows it has to store a new copy.
When changes happen in the cluster, all placement groups/object locations in the pool will have to be re-calculated.
I assumed this might mean an OSD which was master of an object before isn't master anymore, the new master is now resposible for the object and the number of copies.
Quoted 2 lines
Thanks for taking the time to explain :-)
This was just from memory, that is why I left some things unanswered.
My idea was when I transfer my knowledge to you, you can use it to search the source and documentation. :-)
Quoted 93 lines
Cheers
Quoted 91 lines
How the RADOS-algoritm calculates based on the osdmap and pgmap what pg and master-osd an object belongs to I'm not a 100% sure.
Does that help ?
Quoted 85 lines
Cheers
Ceph stores objects in pools which are divided in placement groups.
+---------------------------- pool a ----+ |+----- placement group 1 -------------+ | ||+-------+ +-------+ | | |||object | |object | | | ||+-------+ +-------+ | | |+-------------------------------------+ | |+----- placement group 2 -------------+ | ||+-------+ +-------+ | | |||object | |object | ... | | ||+-------+ +-------+ | | |+-------------------------------------+ | | .... | | | +----------------------------------------++---------------------------- pool b ----+ |+----- placement group 1 -------------+ | ||+-------+ +-------+ | | |||object | |object | | | ||+-------+ +-------+ | | |+-------------------------------------+ | |+----- placement group 2 -------------+ | ||+-------+ +-------+ | | |||object | |object | ... | | ||+-------+ +-------+ | | |+-------------------------------------+ | | .... | | | +----------------------------------------+...The placement group is supported by OSDs to store the objects. They are daemons running on machines where storage For instance, a placement group supporting three replicates will have three OSDs at his disposal : one OSDs is the primary and the two other store copies of each object.
+-------- placement group -------------+ |+----------------+ +----------------+ | || object A | | object B | | |+----------------+ +----------------+ | +---+-------------+-----------+--------+ | | | | | | OSD 0 OSD 1 OSD 2 +------+ +------+ +------+ |+---+ | |+---+ | |+---+ | || A | | || A | | || A | | |+---+ | |+---+ | |+---+ | |+---+ | |+---+ | |+---+ | || B | | || B | | || B | | |+---+ | |+---+ | |+---+ | +------+ +------+ +------+The OSDs are not for the exclusive use of the placement group : multiple placement groups can use the same OSDs to store their objects. However, the collocation of objects from various placement groups in the same OSD is transparent and is not discussed here.
The placement group does not run as a single daemon as suggested above. Instead it os distributed and resides within each OSD. Whenever an OSD dies, the placement group for this OSD is gone and needs to be reconstructed using another OSD.
OSD 0 OSD 1 ... +----------------+---- placement group --------+ +------ |+--- object --+ |+--------------------------+ | | || name : B | || pg_log_entry_t MODIFY | | | || key : 2 | || pg_log_entry_t DELETE | | | |+-------------+ |+--------------------------+ | | |+--- object --+ >------ last_backfill | | .... || name : A | | | | || key : 5 | | | | |+-------------+ | | | | | | | | .... | | | +----------------+-----------------------------+ +-----When an object is deleted or modified in the placement group, it is recorded in a log to be replayed if needed. In the simplest case, if an OSD gets disconnected, reconnects and needs to catch up with the other OSDs, copies of the log entries will be sent to it. However, the logs have a limited size and it may be more efficient, in some cases, to just copy the objects over instead of replaying the logs.
Each object name is hashed into an integer that can be used to order them. For instance, the object B above has been hashed to key 2 and the object A above has been hashed to key 5. The
last_backfillpointer of the placement group draws the limit separating the objects that have already been copied from other OSDs and those in the process of being copied. The objects that are lower thanlast_backfillhave been copied ( that would be object B above ) and the objects that are greater thanlast_backfillare going to be copied.It may take time for an OSD to catch up and it is useful to allow replaying the logs while backfilling. log entries related to objects lower than
last_backfillare applied. However, log entries related to objects greater thanlast_backfillare discarded because it is scheduled to be copied at a later time anyway.Signature · 2 lines
Loïc Dachary, Artisan Logiciel Libre All that is necessary for the triumph of evil is that good people do nothing.
Quoted 9 lines
Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.htmlSignature · 2 lines
Loïc Dachary, Artisan Logiciel Libre All that is necessary for the triumph of evil is that good people do nothing.
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 17 lines · Leen Besselink
Quoted 9 lines · Loic Dachary
On 05/25/2013 02:33 PM, Leen Besselink wrote:
Hi Leen,Quoted 1 line
- a Cehp object can store keys/values, not just data
I did not know that. Could you explain or give me the URL ?
Well, I got that impression from some of the earlier talks and from this blog post:
http://ceph.com/community/my-first-impressions-of-ceph-as-a-summer-intern/
But I haven't read it in while.
Quoted 7 lines
But at this time I only see something like:
http://ceph.com/docs/master/rados/api/librados/?highlight=rados_getxattr#rados_getxattr
Which looks like it is storing it in filesystem attributes.
So maybe an object can be a piece of data or a key/value store.
Thanks for explaining: I did not know about the works of Eleanor Cawthon. I knew about the objects xattributes but I thought you meant that the data inside of the object could be structured as key/value pairs. My bad :-)
Cheers
Signature · 2 lines
Loïc Dachary, Artisan Logiciel Libre All that is necessary for the triumph of evil is that good people do nothing.
Hi, thanks for taking the time to try to get all this documented!
Placement groups are assigned to a set of OSDs by crush.
(4.1, osdmap(e 1)) --CRUSH--> [3,1,2]
where the primary is 3. When 3 dies, the osdmap is updated to reflect this and we get a new mapping for pg 4.1:
(4,1, osdmap(e 2)) --CRUSH--> [1,2,4]
Here, 1 and 2 already have up-to-date copies of 4.1. osd 4, however, needs to be brought up to date. During peering, osd 1 will learn that osd 4 falls into
1 of 2 cases.
Case 1 is that osd 4 already had an old copy of pg 4.1 AND its pg log for pg 4.1 happens to overlap osd 1's pg log for pg 4.1. In that case, by running through the log of operations, we can determine exactly which objects need to be copied over. We usually refer to this as just "recovery" (or log based recovery).
In case 2, either osd 4's pg log does not overlap that of osd 1. In this case, we cannot determine from the log which objects need to be copied over. To bring osd 4 up to date, we therefore need to backfill.
Backfill involves the primary and the backfill peer (there is only ever one in the acting set at a time, see PG::choose_acting) scanning over their pg stores and copying the objects which are different or missing from the primary to the backfill peer. Because this may take a long time, we track the a last_backfill attribute for each local pg copy indicating how far the local copy has been backfilled. In the case that the copy is complete, last_backfill is hobject_t::max().
More exactly, a local pg copy is described by a few pieces of information:
1) the local pg log
2) the local last_backfill
3) the local last_complete
4) the local missing set
The local pg store reflects all updates up to version last_complete on all hobject_ts hoid such that hoid < last_backfill AND hoid is not in the missing set. Comparing the pg logs is used to fill in the missing set for OSDs which were only down for a brief period thus avoiding a costly backfill in many cases.
This is a bit of a rough brain dump and may be somewhat misleading/wrong. I'll get it cleaned up and put it into doc/dev/osd_internals/pg_recovery.rst next
week.
Also, rados objects currently have three pieces:
1) data - read, write, writefull, etc.
2) xattrs
3) omap
The omap is much like the xattrs except that it can generally store a much larger number of keys and support efficient scans. It's used at the moment for a few things including rgw bucket indices. The omap entries are copied over along with the rest of the object in recovery. Behind the scenes, all omap entries for all objects stored on an OSD are stored prefixed in a single big leveldb instance.
omap operations probably shouldn't be supported on objects in an ErasureCodedPG :)
-Sam
Quoted 28 lines · Loic Dachary
Quoted 17 lines · Leen Besselink
Quoted 9 lines · Loic Dachary
On 05/25/2013 02:33 PM, Leen Besselink wrote:
Hi Leen,Quoted 1 line
- a Cehp object can store keys/values, not just data
I did not know that. Could you explain or give me the URL ?
Well, I got that impression from some of the earlier talks and from this blog post:
http://ceph.com/community/my-first-impressions-of-ceph-as-a-summer-intern/
But I haven't read it in while.
Quoted 7 lines
But at this time I only see something like:
http://ceph.com/docs/master/rados/api/librados/?highlight=rados_getxattr#rados_getxattr
Which looks like it is storing it in filesystem attributes.
So maybe an object can be a piece of data or a key/value store.
Quoted 8 lines
Thanks for explaining: I did not know about the works of Eleanor Cawthon. I knew about the objects xattributes but I thought you meant that the data inside of the object could be structured as key/value pairs. My bad :-)
Cheers
--
Loïc Dachary, Artisan Logiciel Libre
All that is necessary for the triumph of evil is that good people do nothing.
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi !
Quoted 26 lines · Samuel Just
Hi, thanks for taking the time to try to get all this documented!
Placement groups are assigned to a set of OSDs by crush.
(4.1, osdmap(e 1)) --CRUSH--> [3,1,2]
where the primary is 3. When 3 dies, the osdmap is updated to reflect this and we get a new mapping for pg 4.1:
(4,1, osdmap(e 2)) --CRUSH--> [1,2,4]
Here, 1 and 2 already have up-to-date copies of 4.1. osd 4, however, needs to be brought up to date. During peering, osd 1 will learn that osd 4 falls into
1 of 2 cases.Case 1 is that osd 4 already had an old copy of pg 4.1 AND its pg log for pg 4.1 happens to overlap osd 1's pg log for pg 4.1. In that case, by running through the log of operations, we can determine exactly which objects need to be copied over. We usually refer to this as just "recovery" (or log based recovery).
In case 2, either osd 4's pg log does not overlap that of osd 1. In this case, we cannot determine from the log which objects need to be copied over. To bring osd 4 up to date, we therefore need to backfill.
Quoted 7 lines
Backfill involves the primary and the backfill peer (there is only ever one in the acting set at a time, see
PG::choose_acting) scanning over their pg stores and copying the objects which are different or missing from the primary to the backfill peer. Because this may take a long time, we track the alast_backfillattribute for each local pg copy indicating how far the local copy has been backfilled. In the case that the copy is complete,last_backfillishobject_t::max().
Is it true that if two osd briefly disconnect while backfilling, they may be in the case 1 above (i.e. log based recovery ) and then backfilling again when done, starting from last_backfill and up ?
Quoted 2 lines
More exactly, a local pg copy is described by a few pieces of information:
1) the local pg log
pg_log_t https://github.com/ceph/ceph/blob/master/src/osd/osd_types.h#L1371pg_log_entry_t https://github.com/ceph/ceph/blob/master/src/osd/osd_types.h#L1277
Quoted 1 line
2) the local
last_backfill
pg_info_t::last_backfill https://github.com/ceph/ceph/blob/master/src/osd/osd_types.h#L1102
Quoted 1 line
3) the local
last_complete
pg_info_t::last_complete https://github.com/ceph/ceph/blob/master/src/osd/osd_types.h#L1089
Quoted 1 line
4) the local missing set
pg_missing_t https://github.com/ceph/ceph/blob/master/src/osd/osd_types.h#L1468
Quoted 1 line
The local pg store reflects all updates up to version
last_completeon all
I assume you mean 'local pg log' instead of 'local pg log'.
Quoted 3 lines
hobject_tshoid such that hoid <last_backfillAND hoid is not in the missing set. Comparing the pg logs is used to fill in the missing set for OSDs which were only down for a brief period thus avoiding a costly backfill in many cases.
The pg logs are trimmed ( https://github.com/ceph/ceph/blob/master/src/osd/PG.cc#L216 ), this is why the pg logs of two OSDs that have been disconnected for too long are unlikely to overlap ? And therefore require a backfill because the two pg logs cannot be compared ?
Quoted 1 line
This is a bit of a rough brain dump and may be somewhat misleading/wrong.
It is very helpful as it is, thanks :-)
Quoted 4 lines
I'll get it cleaned up and put it into
doc/dev/osd_internals/pg_recovery.rstnext
week.
That would be great.
Quoted 11 lines
Also, rados objects currently have three pieces:
1) data - read, write, writefull, etc.
2) xattrs
3) omap
The omap is much like the xattrs except that it can generally store a much larger number of keys and support efficient scans. It's used at the moment for a few things including rgw bucket indices. The omap entries are copied over along with the rest of the object in recovery. Behind the scenes, all omap entries for all objects stored on an OSD are stored prefixed in a single big leveldb instance.
Quoted 2 lines
omap operations probably shouldn't be supported on objects in an ErasureCodedPG :)
I thought omap / xattrs were mutually exclusive. I did not realize both could be used at the same time.
Cheers
Quoted 39 lines
-Sam
Quoted 36 lines · Loic Dachary
Quoted 17 lines · Leen Besselink
Quoted 9 lines · Loic Dachary
On 05/25/2013 02:33 PM, Leen Besselink wrote:
Hi Leen,Quoted 1 line
- a Cehp object can store keys/values, not just data
I did not know that. Could you explain or give me the URL ?
Well, I got that impression from some of the earlier talks and from this blog post:
http://ceph.com/community/my-first-impressions-of-ceph-as-a-summer-intern/
But I haven't read it in while.
Quoted 7 lines
But at this time I only see something like:
http://ceph.com/docs/master/rados/api/librados/?highlight=rados_getxattr#rados_getxattr
Which looks like it is storing it in filesystem attributes.
So maybe an object can be a piece of data or a key/value store.
Thanks for explaining: I did not know about the works of Eleanor Cawthon. I knew about the objects xattributes but I thought you meant that the data inside of the object could be structured as key/value pairs. My bad :-)
Cheers
--
Loïc Dachary, Artisan Logiciel Libre
All that is necessary for the triumph of evil is that good people do nothing.
Signature · 2 lines
Loïc Dachary, Artisan Logiciel Libre All that is necessary for the triumph of evil is that good people do nothing.
Hi,
Although I am yet to fully understand the logic of the placement group recovery ( I'm eager to read Sam's doc/dev/osd_internals/pg_recovery.rst :-), I wrote down my understanding of backfilling : http://dachary.org/?p=2009 .
Cheers
Quoted 136 lines · Loic Dachary
Hi !
Quoted 26 lines · Samuel Just
Hi, thanks for taking the time to try to get all this documented!
Placement groups are assigned to a set of OSDs by crush.
(4.1, osdmap(e 1)) --CRUSH--> [3,1,2]
where the primary is 3. When 3 dies, the osdmap is updated to reflect this and we get a new mapping for pg 4.1:
(4,1, osdmap(e 2)) --CRUSH--> [1,2,4]
Here, 1 and 2 already have up-to-date copies of 4.1. osd 4, however, needs to be brought up to date. During peering, osd 1 will learn that osd 4 falls into
1 of 2 cases.Case 1 is that osd 4 already had an old copy of pg 4.1 AND its pg log for pg 4.1 happens to overlap osd 1's pg log for pg 4.1. In that case, by running through the log of operations, we can determine exactly which objects need to be copied over. We usually refer to this as just "recovery" (or log based recovery).
In case 2, either osd 4's pg log does not overlap that of osd 1. In this case, we cannot determine from the log which objects need to be copied over. To bring osd 4 up to date, we therefore need to backfill.
Quoted 7 lines
Backfill involves the primary and the backfill peer (there is only ever one in the acting set at a time, see
PG::choose_acting) scanning over their pg stores and copying the objects which are different or missing from the primary to the backfill peer. Because this may take a long time, we track the alast_backfillattribute for each local pg copy indicating how far the local copy has been backfilled. In the case that the copy is complete,last_backfillishobject_t::max().Is it true that if two osd briefly disconnect while backfilling, they may be in the case 1 above (i.e. log based recovery ) and then backfilling again when done, starting from
last_backfilland up ?Quoted 2 lines
More exactly, a local pg copy is described by a few pieces of information:
1) the local pg log
pg_log_thttps://github.com/ceph/ceph/blob/master/src/osd/osd_types.h#L1371pg_log_entry_thttps://github.com/ceph/ceph/blob/master/src/osd/osd_types.h#L1277Quoted 1 line
2) the local
last_backfill
pg_info_t::last_backfillhttps://github.com/ceph/ceph/blob/master/src/osd/osd_types.h#L1102Quoted 1 line
3) the local
last_complete
pg_info_t::last_completehttps://github.com/ceph/ceph/blob/master/src/osd/osd_types.h#L1089Quoted 1 line
4) the local missing set
pg_missing_thttps://github.com/ceph/ceph/blob/master/src/osd/osd_types.h#L1468Quoted 1 line
The local pg store reflects all updates up to version
last_completeon allI assume you mean 'local pg log' instead of 'local pg log'.
Quoted 3 lines
hobject_tshoid such that hoid <last_backfillAND hoid is not in the missing set. Comparing the pg logs is used to fill in the missing set for OSDs which were only down for a brief period thus avoiding a costly backfill in many cases.The pg logs are trimmed ( https://github.com/ceph/ceph/blob/master/src/osd/PG.cc#L216 ), this is why the pg logs of two OSDs that have been disconnected for too long are unlikely to overlap ? And therefore require a backfill because the two pg logs cannot be compared ?
Quoted 1 line
This is a bit of a rough brain dump and may be somewhat misleading/wrong.
It is very helpful as it is, thanks :-)
Quoted 4 lines
I'll get it cleaned up and put it into
doc/dev/osd_internals/pg_recovery.rstnext
week.That would be great.
Quoted 11 lines
Also, rados objects currently have three pieces:
1) data - read, write, writefull, etc.
2) xattrs
3) omap
The omap is much like the xattrs except that it can generally store a much larger number of keys and support efficient scans. It's used at the moment for a few things including rgw bucket indices. The omap entries are copied over along with the rest of the object in recovery. Behind the scenes, all omap entries for all objects stored on an OSD are stored prefixed in a single big leveldb instance.Quoted 2 lines
omap operations probably shouldn't be supported on objects in an ErasureCodedPG :)
I thought omap / xattrs were mutually exclusive. I did not realize both could be used at the same time.
Cheers
Quoted 39 lines
-Sam
Quoted 36 lines · Loic Dachary
Quoted 17 lines · Leen Besselink
Quoted 9 lines · Loic Dachary
On 05/25/2013 02:33 PM, Leen Besselink wrote:
Hi Leen,Quoted 1 line
- a Cehp object can store keys/values, not just data
I did not know that. Could you explain or give me the URL ?
Well, I got that impression from some of the earlier talks and from this blog post:
http://ceph.com/community/my-first-impressions-of-ceph-as-a-summer-intern/
But I haven't read it in while.
Quoted 7 lines
But at this time I only see something like:
http://ceph.com/docs/master/rados/api/librados/?highlight=rados_getxattr#rados_getxattr
Which looks like it is storing it in filesystem attributes.
So maybe an object can be a piece of data or a key/value store.
Thanks for explaining: I did not know about the works of Eleanor Cawthon. I knew about the objects xattributes but I thought you meant that the data inside of the object could be structured as key/value pairs. My bad :-)
Cheers
--
Loïc Dachary, Artisan Logiciel Libre
All that is necessary for the triumph of evil is that good people do nothing.
Signature · 2 lines
Loïc Dachary, Artisan Logiciel Libre All that is necessary for the triumph of evil is that good people do nothing.
Quoted 4 lines · Samuel Just
Hi, thanks for taking the time to try to get all this documented!
Placement groups are assigned to a set of OSDs by crush.
Darn, silly me.
I made a stupid mistake, I meant it is CRUSH-algoritm and RADOS is the protocol.
Quoted 56 lines
(4.1, osdmap(e 1)) --CRUSH--> [3,1,2]
where the primary is 3. When 3 dies, the osdmap is updated to reflect this and we get a new mapping for pg 4.1:
(4,1, osdmap(e 2)) --CRUSH--> [1,2,4]
Here, 1 and 2 already have up-to-date copies of 4.1. osd 4, however, needs to be brought up to date. During peering, osd 1 will learn that osd 4 falls into
1 of 2 cases.Case 1 is that osd 4 already had an old copy of pg 4.1 AND its pg log for pg 4.1 happens to overlap osd 1's pg log for pg 4.1. In that case, by running through the log of operations, we can determine exactly which objects need to be copied over. We usually refer to this as just "recovery" (or log based recovery).
In case 2, either osd 4's pg log does not overlap that of osd 1. In this case, we cannot determine from the log which objects need to be copied over. To bring osd 4 up to date, we therefore need to backfill.
Backfill involves the primary and the backfill peer (there is only ever one in the acting set at a time, see
PG::choose_acting) scanning over their pg stores and copying the objects which are different or missing from the primary to the backfill peer. Because this may take a long time, we track the alast_backfillattribute for each local pg copy indicating how far the local copy has been backfilled. In the case that the copy is complete,last_backfillishobject_t::max().More exactly, a local pg copy is described by a few pieces of information:
1) the local pg log
2) the locallast_backfill
3) the locallast_complete
4) the local missing set
The local pg store reflects all updates up to versionlast_completeon allhobject_tshoid such that hoid <last_backfillAND hoid is not in the missing set. Comparing the pg logs is used to fill in the missing set for OSDs which were only down for a brief period thus avoiding a costly backfill in many cases.This is a bit of a rough brain dump and may be somewhat misleading/wrong. I'll get it cleaned up and put it into
doc/dev/osd_internals/pg_recovery.rstnext
week.Also, rados objects currently have three pieces:
1) data - read, write, writefull, etc.
2) xattrs
3) omap
The omap is much like the xattrs except that it can generally store a much larger number of keys and support efficient scans. It's used at the moment for a few things including rgw bucket indices. The omap entries are copied over along with the rest of the object in recovery. Behind the scenes, all omap entries for all objects stored on an OSD are stored prefixed in a single big leveldb instance.
Quoted 41 lines
omap operations probably shouldn't be supported on objects in an ErasureCodedPG :)
-SamQuoted 36 lines · Loic Dachary
Quoted 17 lines · Leen Besselink
Quoted 9 lines · Loic Dachary
On 05/25/2013 02:33 PM, Leen Besselink wrote:
Hi Leen,Quoted 1 line
- a Cehp object can store keys/values, not just data
I did not know that. Could you explain or give me the URL ?
Well, I got that impression from some of the earlier talks and from this blog post:
http://ceph.com/community/my-first-impressions-of-ceph-as-a-summer-intern/
But I haven't read it in while.
Quoted 7 lines
But at this time I only see something like:
http://ceph.com/docs/master/rados/api/librados/?highlight=rados_getxattr#rados_getxattr
Which looks like it is storing it in filesystem attributes.
So maybe an object can be a piece of data or a key/value store.
Thanks for explaining: I did not know about the works of Eleanor Cawthon. I knew about the objects xattributes but I thought you meant that the data inside of the object could be structured as key/value pairs. My bad :-)
Cheers
--
Loïc Dachary, Artisan Logiciel Libre
All that is necessary for the triumph of evil is that good people do nothing.
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html