Thursday, September 16, 2010

MySQL 5.1 federated engine fix

In 5.1.50 version of MySQL if you attempt to install the "federated" plugin you get this:

mysql> install plugin federated soname 'ha_federated.so';
ERROR 1126 (HY000): Can't open shared library '/usr/lib/mysql/plugin/ha_federated.so' (errno: 2 undefined symbol: dynstr_append_mem)
mysql>
Apparently dynstr_append_menu is not used anywhere else in mysqld. But it is defined in libmysqlclient. So, we can try to build a frankestein library like this:

levi plugin # cd /usr/lib/mysql/plugin
levi plugin # gcc -shared -o ha_federated_am.so ha_federated.so ../libmysqlclient.so

Now trying to load the federated engine plugin:

mysql> install plugin federated soname 'ha_federated_am.so';
Query OK, 0 rows affected, 1 warning (0.00 sec)
It works.

In the end I still abandoned the idea of splitting off a part of the database to a separate server using the federated engine. I could not make it use correct indexes and it kept trying to pull in huge datasets over the network, even if the query itself is very direct on a unique index.

This just looked like a neat trick, so here it goes. I could not google up any other easy solution at least.

Andrew.

Monday, September 13, 2010

Amazon S3 curiosity

In preparation for some changes coming to isbndb.com soon I've been moving MARC data to Amazon S3 storage. Loaded 10+ million records just fine, but when I checked the status this morning here is what I saw in the log:

STORAGE_PUT: marc_record/soap/113.mrc
MethodNotAllowed: The specified method is not allowed against this resource.

The unlucky culprit is this book.

As it turns out, you can't place an object with a key that is either equal to "soap" or starts with "soap/". Not using REST API at least. I did not try using SOAP, it might work -- since the problem is likely that S3 considers that URI a SOAP entry point.

Who would have thought that S3 storage is not URI transparent. I re-read the documentation about what's allowed in keys and I don't see that restriction.


Andrew.