Subtask #5878
Updated by Loïc Dachary over 10 years ago
"work in progress":https://github.com/dachary/ceph/tree/wip-5878
The "abstract API":https://github.com/dachary/ceph/blob/wip-4929/doc/dev/osd_internals/erasure-code.rst#erasure-code-library-abstract-api is provided by dynamically loaded plugins.
* core change
** add *ceph osd pool erasure-code-set <pool> <key> <value>* where *<key>* and *<value>* are arbitrary strings. ( see "MonCommands.h":https://github.com/ceph/ceph/blob/master/src/mon/MonCommands.h#L494 for an example )
* configuration
** ceph osd pool set-erasure-code <pool> plugin-dir /var/lib/ceph/erasure-code-plugins (mandatory)
** ceph osd pool set-erasure-code <pool> plugin jerasure (mandatory)
** ceph osd pool set-erasure-code <pool> m 10 (optional)
** ceph osd pool set-erasure-code <pool> k 3 (optional)
** ceph osd pool set-erasure-code <pool> algorithm Reed-Solomon (optional)
** ... there can be more, depending on the plugin / algorithm
* src/osd/ErasureCodePlugin.{h,cc}
** class ErasureCodePlugin
*** erasure_coding_t *erasure_coding;
*** ErasureCodePlugin(g_conf) loads the plugin using the g_conf plugin name previously set with *ceph osd pool set-erasure-code <pool> plugin <plugin>* , calls create_erasure_code_context(g_conf) and sets the *erasure_coding* data member with the value returned.
*** ~ErasureCodePlugin() deletes the *erasure_coding* data member
* unit tests
** in the test file ceph osd pool set-erasure-code <pool> plugin-dir src/test/osd/erasure-code-plugin
** simple minded xor based erasure code plugin that only supports M=2,K=1
** the plugin can be directed to trigger errors for tests purposes
** implement the test plugin to be the basis of a documented example to follow when implementing a new plugin