All of lore.kernel.org
 help / color / mirror / Atom feed
* ISA erasure code plugin and cache
@ 2014-08-04 11:56 Loic Dachary
  2014-08-04 12:15 ` Andreas Joachim Peters
  0 siblings, 1 reply; 12+ messages in thread
From: Loic Dachary @ 2014-08-04 11:56 UTC (permalink / raw)
  To: Andreas-Joachim Peters; +Cc: Ma, Jianpeng, Ceph Development

[-- Attachment #1: Type: text/plain, Size: 2073 bytes --]

Hi,

Here is how I understand the current code:

When an OSD is missing, recovery is required and the primary OSD will collect the available chunks to do so. It will then call the decode method via ECUtil::decode which is a small wrapper around the corresponding ErasureCodeInterface::decode method.

   https://github.com/ceph/ceph/blob/master/src/osd/ECBackend.cc#L361

The ISA plugin will then use the isa_decode method to perform the work

   https://github.com/ceph/ceph/blob/master/src/erasure-code/isa/ErasureCodeIsa.cc#L212

and will be repeatedly called until all objects in the PGs that were relying on the missing OSD are recovered. To avoid computing the decoding table for each object, it is stored in a LRU cache

   https://github.com/ceph/ceph/blob/master/src/erasure-code/isa/ErasureCodeIsa.cc#L480

and copied in the stack if already there:

   https://github.com/ceph/ceph/blob/master/src/erasure-code/isa/ErasureCodeIsa.cc#L433

Each PG has a separate instance of ErasureCodeIsa, obtained when it is created:

   https://github.com/ceph/ceph/blob/master/src/osd/PGBackend.cc#L292

It means that data members of each ErasureCodeIsa are copied as many times as there are PGs. If an OSD handles participates in 200 PG that belong to an erasure coded pool configured to use ErasureCodeIsa, the data members will be duplicated 200 times.

It is good practice to make it so that the encode/decode methods of ErasureCodeIsa are thread safe. In the jerasure plugin these methods have no side effect on the object. In the isa plugin the LRU cache storing the decode tables is modified by the decode method and guarded by a mutex:

   get https://github.com/ceph/ceph/blob/master/src/erasure-code/isa/ErasureCodeIsa.cc#L281
   put https://github.com/ceph/ceph/blob/master/src/erasure-code/isa/ErasureCodeIsa.cc#L310

Please correct me if I'm mistaken ;-) I've not reviewed the code yet and try to find problems, I just wanted to make sure I get the intention before doing so.

Cheers
-- 
Loïc Dachary, Artisan Logiciel Libre


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-08-04 21:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-04 11:56 ISA erasure code plugin and cache Loic Dachary
2014-08-04 12:15 ` Andreas Joachim Peters
2014-08-04 12:37   ` Loic Dachary
2014-08-04 12:43     ` Andreas Joachim Peters
2014-08-04 12:50     ` Ma, Jianpeng
2014-08-04 12:56       ` Loic Dachary
2014-08-04 13:19         ` Andreas Joachim Peters
2014-08-04 14:22           ` Sage Weil
2014-08-04 15:22             ` Andreas Joachim Peters
2014-08-04 17:04               ` Loic Dachary
2014-08-04 20:07                 ` Andreas Joachim Peters
2014-08-04 21:26                   ` Loic Dachary

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.