Advertisement
Guest User

Untitled

a guest
May 24th, 2013
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.91 KB | None | 0 0
  1. Ceph backfilling explained
  2.  
  3. Ceph stores objects in pools which are divided in placement groups.
  4.  
  5. +---------------------------- pool a ----+
  6. |+----- placement group 1 -------------+ |
  7. ||+-------+ +-------+ | |
  8. |||object | |object | | |
  9. ||+-------+ +-------+ | |
  10. |+-------------------------------------+ |
  11. |+----- placement group 2 -------------+ |
  12. ||+-------+ +-------+ | |
  13. |||object | |object | ... | |
  14. ||+-------+ +-------+ | |
  15. |+-------------------------------------+ |
  16. | .... |
  17. | |
  18. +----------------------------------------+
  19.  
  20. +---------------------------- pool b ----+
  21. |+----- placement group 1 -------------+ |
  22. ||+-------+ +-------+ | |
  23. |||object | |object | | |
  24. ||+-------+ +-------+ | |
  25. |+-------------------------------------+ |
  26. |+----- placement group 2 -------------+ |
  27. ||+-------+ +-------+ | |
  28. |||object | |object | ... | |
  29. ||+-------+ +-------+ | |
  30. |+-------------------------------------+ |
  31. | .... |
  32. | |
  33. +----------------------------------------+
  34.  
  35. ...
  36.  
  37. 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.
  38.  
  39. +-------- placement group -------------+
  40. |+----------------+ +----------------+ |
  41. || object A | | object B | |
  42. |+----------------+ +----------------+ |
  43. +---+-------------+-----------+--------+
  44. | | |
  45. | | |
  46. OSD 0 OSD 1 OSD 2
  47. +------+ +------+ +------+
  48. |+---+ | |+---+ | |+---+ |
  49. || A | | || A | | || A | |
  50. |+---+ | |+---+ | |+---+ |
  51. |+---+ | |+---+ | |+---+ |
  52. || B | | || B | | || B | |
  53. |+---+ | |+---+ | |+---+ |
  54. +------+ +------+ +------+
  55.  
  56. 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.
  57.  
  58. 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.
  59.  
  60. OSD 0 OSD 1 ...
  61. +----------------+---- placement group --------+ +------
  62. |+--- object --+ |+--------------------------+ | |
  63. || name : B | || pg_log_entry_t MODIFY | | |
  64. || key : 2 | || pg_log_entry_t DELETE | | |
  65. |+-------------+ |+--------------------------+ | |
  66. |+--- object --+ >------ last_backfill | | ....
  67. || name : A | | | |
  68. || key : 5 | | | |
  69. |+-------------+ | | |
  70. | | | |
  71. | .... | | |
  72. +----------------+-----------------------------+ +-----
  73.  
  74.  
  75. 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.
  76.  
  77. 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.
  78.  
  79. 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.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement