Project

General

Profile

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/ErasureCodePluginInterface.h":https://github.com/dachary/ceph/blob/wip-4929/doc/dev/osd_internals/erasure-code.rst#erasure-code-library-abstract-api 
 ** interface published for plugins to comply to 
 * src/osd/ErasureCodePlugin.h 
 ** ErasureCodePluginInterfaceRef erasure_code_plugin_factory(const std::string &name, const md_config_t *conf); 
 ** it is the function called when a pool is initialized to be erasure encoded 
 * src/osd/ErasureCodePluginImplementation.{h,cc} 
 ** class ErasureCodePluginImplementation 
 *** 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 
 * plugin load 
 ** mimic use ClassHandler https://github.com/ceph/ceph/blob/962b64a83037ff79855c5261325de0cd1541f582/src/osd/ClassHandler.cc#L57

Back