Loading dynamic plugins at start-up in drizzle

The re-enabling of the dlopen()-based dynamic plugin loading has hit the Drizzle trunk. This means that plugins can now be built as shared modules and loaded at will on server startup. We still do not support dynamically loading a plugin in a running server via the LOAD PLUGIN command, nor will we until this can be done without re-introducing global mutexes.

Since this is a feature we turned off a while ago, but that was there before, why mention it? There have been several changes to the system that I thought would be handy to mention.

First of all, Drizzle has a crap-ton of plugins and the numbers are only growing. In the tree now, the default is to build any of them we are able to, and to build them all as shared modules, rather than statically linking them into the server.  Then, from the list of built and available plugins, there is a default list of plugins that should be loaded if no other options are given.

But say you do want to load an optional plugin at server start. Do you need to list all of the standard plugins in addition to yours? NO! That would be silly.

There are two options related to plugin loading now, --plugin-load and --plugin-add. Both take comma separated lists of plugin names. --plugin-load overrides the default list of plugins and will only load the list of plugins specified. --plugin-add loads the default list of plugins in addition to any plugins given as a parameter. Any plugin that is requested that cannot load will result in the server not starting. (And yes, it will spit out an error ot that effect)

If you wanted to load the crc32 plugin, for instance, you'd simply do:

drizzled --datadir=/my/data/dir --plugin-add=crc32

If, on the other hand, you wanted to only load a few plugins you care about, you'd do:

drizzled --datadir=/my/data/dir --plugin-load=crc32,md5,transaction_log,console,multi_thread,information_engine,info_schema,errmsg_stderr

Make sure you get a scheduler in there - they're all plugins. :)

As you can probably tell, --plugin-load is almost never what you actually want. I'm also going to add a --plugin-skip in case you want to load all of the defaults except one - but I haven't gotten to that yet.

 

4 Comments

  1. [1]   http://wdtoolkit.com/2009/12/18/loading-dynamic-plugins-at-start-up-in-drizzle/
    December 18, 2009 at 02:24 PM

  2. [2]   mdaems
    December 18, 2009 at 11:07 PM

    No plans to allow reading plugin names from a config file (apart from some comma separated list in the main drizzle config file)? Seems like a simple plain text file in the plugins dir might do the job? Or is something like that already available?
  3. [3]   Jobin Augustine
    December 20, 2009 at 01:28 AM

    This is for sure a great news. this is something which needs to be celebrated because pluggablity is born officially. really a christmas news. This is one of the major milestone in Drizzles. isn't monty? Since now it works only in startup what difference we can see compared to using flag like "--transaction-log-enable"?
  4. [4]   Jobin Augustine
    December 20, 2009 at 01:29 AM

    This is for sure a great news. this is something which needs to be celebrated because pluggablity is born officially. really a christmas news. This is one of the major milestone in Drizzles. isn't monty? Since now it works only in startup what difference we can see compared to using flag like "--transaction-log-enable"?
Comment on this post