Friday, July 23, 2010

Building MariaDB with the InnoDB plugin

This post was inspired by a couple events. But I won't explain them other than to say I think there have been too many subjective comments (or FUD) about quality. This is an attempt to quantify whether the grass is greener on the other side.

Today I tried to build MariaDB with the InnoDB plugin. I was told his is now supported. The last time I checked XtraDB replaced the InnoDB plugin in MariaDB. MPAB had a reasonable reason for doing this as they don't want to test both the InnoDB plugin and XtraDB. But I prefer choice, despite the many great features in XtraDB.

First I tried using the 5.3 release. That failed fast. I prefer fast failures over obscure ones:

./configure --enable-thread-safe-client --with-plugins=partition,csv,blackhole,myisam,heap,innodb_plugin --without-plugin-innobase --with-fast-mutexes --with-extra-charsets=all --with-debug C_EXTRA_FLAGS="-fno-omit-frame-pointer -fno-strict-aliasing -Wall"
...

configure: error: unknown plugin: innodb_plugin

Then I tried the 5.2 MariaDB release. This time the configure command worked. After running make, both XtraDB and the InnoDB were compiled. Time to try a test. There were no failures! Alas, all tests were skipped.
./mysql-test-run.pl --suite=innodb_plugin
...
innodb_plugin.innodb                     [ skipped ]  No innodb support
innodb_plugin.innodb-analyze             [ skipped ]  No innodb support
innodb_plugin.innodb-autoinc             [ skipped ]  No innodb support
innodb_plugin.innodb-autoinc-44030       [ skipped ]  No innodb support
innodb_plugin.innodb-consistent          [ skipped ]  No innodb support
innodb_plugin.innodb-index               [ skipped ]  No innodb support
innodb_plugin.innodb-index_ucs2          [ skipped ]  No innodb support
innodb_plugin.innodb-lock                [ skipped ]  No innodb support
innodb_plugin.innodb-replace             [ skipped ]  No innodb support
innodb_plugin.innodb-semi-consistent     [ skipped ]  No innodb support
innodb_plugin.innodb-timeout             [ skipped ]  No innodb support
innodb_plugin.innodb-use-sys-malloc      [ skipped ]  No innodb support
innodb_plugin.innodb-zip                 [ skipped ]  No innodb support
innodb_plugin.innodb_bug21704            [ skipped ]  No innodb support
innodb_plugin.innodb_bug34053            [ skipped ]  No innodb support
innodb_plugin.innodb_bug34300            [ skipped ]  No innodb support
innodb_plugin.innodb_bug35220            [ skipped ]  No innodb support
innodb_plugin.innodb_bug36169            [ skipped ]  No innodb support
innodb_plugin.innodb_bug36172            [ skipped ]  No innodb support
innodb_plugin.innodb_bug38231            [ skipped ]  No innodb support
innodb_plugin.innodb_bug39438            [ skipped ]  No innodb support
innodb_plugin.innodb_bug40360            [ skipped ]  No innodb support
innodb_plugin.innodb_bug40565            [ skipped ]  No innodb support
innodb_plugin.innodb_bug41904            [ skipped ]  No innodb support
innodb_plugin.innodb_bug42101            [ skipped ]  No innodb support
innodb_plugin.innodb_bug42101-nonzero    [ skipped ]  No innodb support
innodb_plugin.innodb_bug44032            [ skipped ]  No innodb support
innodb_plugin.innodb_bug44369            [ skipped ]  No innodb support
innodb_plugin.innodb_bug44571            [ skipped ]  No innodb support
innodb_plugin.innodb_bug45357            [ skipped ]  No innodb support
innodb_plugin.innodb_bug46000            [ skipped ]  No innodb support
innodb_plugin.innodb_bug46676            [ skipped ]  No innodb support
innodb_plugin.innodb_bug47167            [ skipped ]  No innodb support
innodb_plugin.innodb_bug47621            [ skipped ]  No innodb support
innodb_plugin.innodb_bug47622            [ skipped ]  No innodb support
innodb_plugin.innodb_bug47777            [ skipped ]  No innodb support
innodb_plugin.innodb_bug51378            [ skipped ]  No innodb support
innodb_plugin.innodb_bug51920            [ skipped ]  No innodb support
innodb_plugin.innodb_bug52663            [ skipped ]  No innodb support
innodb_plugin.innodb_bug52745            [ skipped ]  No innodb support
innodb_plugin.innodb_file_format         [ skipped ]  No innodb support
innodb_plugin.innodb_information_schema  [ skipped ]  No innodb support
innodb_plugin.innodb_trx_weight          [ skipped ]  No innodb support

Then I checked for compiler warnings. I really dislike compiler warnings. MySQL has recently done a lot of work to remove them from 5.1 (thanks Davi). I think all of this work was considered one bug, but it was a lot of work and will make MySQL better. They have also begun to do some builds with Werror. See bug 53445 for all of the details.

After compiling storage engines with -Wall, there are no warnings for the official InnoDB plugin (storage/innodb_plugin). There are warnings for XtraDB (storage/xtradb):

btr/btr0btr.c:2871: warning: null argument where non-null required (argument 1)
btr/btr0cur.c:1841: warning: null argument where non-null required (argument 2)
btr/btr0cur.c:1860: warning: null argument where non-null required (argument 1)
btr/btr0cur.c:1967: warning: null argument where non-null required (argument 1)
fil/fil0fil.c:3106: warning: pointer targets in passing argument 2 of ‘dict_table_get_index_on_name’ differ in signedness
ibuf/ibuf0ibuf.c:775: warning: null argument where non-null required (argument 1)
ibuf/ibuf0ibuf.c:950: warning: null argument where non-null required (argument 1)
os/os0file.c:4194: warning: pointer targets in assignment differ in signedness
I want to compare the results from running all regression tests with valgrind. But that might take some time. I am able to run all InnoDB tests without valgrind warnings using the Facebook-patched MySQL 5.1.47. That required a few small changes that are likely in the recent 5.1.49 release. 

Have all regression tests been run under valgrind for MariaDB using either the InnoDB or XtraDB plugin?

Stay tuned for part 2.

9 comments:

  1. I'll reply email style:

    > First I tried using the 5.3 release.
    > That failed fast.
    ...
    > configure: error: unknown plugin: innodb_plugin

    It's because lp:maria/5.3 has not merged
    these changes from 5.2 yet.

    > Then I tried the 5.2 MariaDB release.
    > This time the configure command
    > worked. After running make, both
    > XtraDB and the InnoDB were compiled.
    > Time to try a test. There were no
    > failures! Alas, all tests were
    > skipped.
    >
    > ./mysql-test-run.pl --suite=innodb_plugin
    > ...
    > innodb_plugin.innodb [ skipped ] No innodb support

    It's how mysql-test-run works :(

    It detects the presense of innodb at
    startup, by running mysqld --help. If
    innodb_plugin is not loaded - mtr will
    think that there is no innodb. You can
    preload innodb plugin with

    ./mtr --suite=innodb_plugin --mysqld=--plugin-load=innodb_plugin.so

    you can even run innodb_plugin suite
    with xtradb:

    ./mtr --suite=innodb_plugin --mysqld=--plugin-load=xtradb.so

    (but I never tried that myself :)

    > Have all regression tests been run
    > under valgrind for MariaDB using
    > either the InnoDB or XtraDB plugin?

    No need to guess :)
    http://buildbot.askmonty.org/buildbot/grid?branch=5.1

    ReplyDelete
  2. ./mysql-test-run.pl --force -suite=innodb_plugin --mysqld=--plugin-load=ha_innodb_plugin.so

    A few tests fail, but might be easy to fix:
    innodb_plugin.innodb
    innodb_plugin.innodb-index innodb_plugin.innodb-autoinc-44030

    On my mac I was not able to do the same for xtradb:
    ./mysql-test-run.pl --force -suite=innodb_plugin --mysqld=--plugin-load=ha_xtradb.so
    Logging: ./mysql-test-run.pl --force -suite=innodb_plugin --mysqld=--plugin-load=ha_xtradb.so
    ...
    100723 14:24:41 [ERROR] Can't open shared library '/Users/mcallaghan/bld/5.2opt/mysql-test/var/plugins/ha_xtradb.so' (errno: 2 dlopen(/Users/mcallaghan/bld/5.2opt/mysql-test/var/plugins/ha_xtradb.so, 2): Symbol not found: _my_snprintf_service
    Referenced)

    ReplyDelete
  3. On official InnoDB, this works fine for me:
    ./mysql-test-run.pl --suite=innodb_plugin

    The buildbot support is very nice but I don't see details on the test runs from valgrind -- http://buildbot.askmonty.org/buildbot/builders/work-amd64-valgrind/builds/584/steps/test

    ReplyDelete
  4. in the vanilla mysql you can use

    ./mysql-test-run.pl --suite=innodb_plugin

    because mtr there has a code to treat innodb_plugin specially. In mariadb I've changed that to use a generic approach, this way one can run, for example, innodb tests with either innobase, innodb_plugin, or xtradb depending on command-line options. It can also run mtr with more than one plugin loaded - something that original mtr can never do.

    > Symbol not found:
    > _my_snprintf_service

    that's my fault. I'll fix that. thanks for noticing.

    > I don't see details on the
    > test runs from valgrind

    Try later builds - e.g.
    http://buildbot.askmonty.org/buildbot/builders/work-amd64-valgrind/builds/596
    has the details.

    I am not very familiar with buildbot, but I suppose it purges old logs
    periodically.

    ReplyDelete
  5. http://buildbot.askmonty.org/buildbot/builders/work-amd64-valgrind/builds/636/steps/test/logs/stdio lists test output. There are no entries for innodb_plugin

    ReplyDelete
  6. More things to fix...

    valgrind warnings from the InnoDB variant in MariaDB
    http://bugs.launchpad.net/maria/+bug/609795

    compiler warnings from the InnoDB variant in MariaDB
    http://bugs.launchpad.net/maria/+bug/609803

    All tests skipped for : mtr --suite=innodb_plugin in MariaDB
    http://bugs.launchpad.net/maria/+bug/609813

    ReplyDelete
  7. Then I checked for compiler warnings. I really dislike compiler warnings. MySQL has recently done a lot of work to remove them from 5.1 (thanks Davi).

    So let me get this straight... (I'm just a manager now, I'm allowed to ask questions rather than looking at the source).

    For years (longer than I was around, at least) people complained that MySQL should be stricter about compiler warnings. Then Drizzle forked and spent several man-months cleaning up compiler warnings. Then MariaDB forked and spent man-months cleaning up compiler warnings. And now MySQL has separately cleaned them up again?

    I realize we are having a tough time in this community, but this seems like a lot of wasted energy from some really talented devs :-(

    Next up: don't tell me MySQL is also about to fix all the spuriously failing or inactivated tests in their test suite, even if they could just copy the work we've already done. (There is no reason not to use our GPL'd code for the test suite, even if I understand the problems Oracle has about copyright assignments to server code.)

    ReplyDelete
  8. This is off-topic from the post, but I agree that it is one of many things that will reduce the progress of MySQL. I doubt it will change.

    ReplyDelete
  9. Nice MariaDB. Thanks for the guide.

    ReplyDelete

 
Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.