departurerb / departure

Percona's pt-online-schema-change runner for ActiveRecord migrations.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Specs fail out of the box on Big Sur

davidenglishmusic opened this issue · comments

I am looking to contribute to the gem but am having trouble getting all the specs to pass for the current master.

In running rake spec, a number of them fail: 249 examples, 59 failures, 3 pending

I expect this is likely a config issue related to the perl libraries and OS X Big Sur. The error message for those is:

Departure::Error: DBI.c: loadable library and perl binaries are mismatched (got handshake key 0xc500080, needed 0xc400080)

I ran the cpan setup in the readme for which the last command install DBD::mysql fails with:

./dbdimp.h:20:10: fatal error: 'DBIXS.h' file not found
#include <DBIXS.h>  /* installed by the DBI module                        */

I would welcome any assistance on this. I have yet to google my way out of it.

OK, so that looks like a problem with pt-online-schema-change and with Perl. How did you install pt-online-schema-change?

I don't have a mac for dev work right now, so I can't help with reproducing this issue directly, but maybe I can help you to isolate it.

Thanks @wyhaines. I installed it via homebrew - version 3.3.0 percona-toolkit--3.3.0.big_sur.bottle.tar.gz. Running pt-find gives the mismatch error.

I'm having a similar issue when trying to run a simple add_column migration.

Departure::Error: DBI.c: loadable library and perl binaries are mismatched (got handshake key 0xc800080, needed 0xc700080)

I just tried uninstalling and then re-installing persona-toolkit (3.3.0) on an M1 with Big Sur 11.3, but that didn't make a difference.

@davidenglishmusic Are you on an M1 mac, or an Intel mac?

Intel

Any other thoughts on this?

I had a similar problem on a M1 laptop

-- add_column(:file_entries, :batch_id, :bigint)

   -> Running pt-online-schema-change -h "127.0.0.1" -P 3306 -u root  --chunk-time=1 --no-drop-old-table --preserve-triggers --critical-load Threads_running=4000 --progress=percentage,1 --recursion-method="none" --set-vars "innodb_lock_wait_timeout=5"  --execute --statistics --alter-foreign-keys-method=auto --no-check-alter D=storm_dev,t=file_entries --alter "ADD \`batch_id\` bigint"


rake aborted!
StandardError: An error has occurred, all later migrations canceled:

Departure::Error: DBI.c: loadable library and perl binaries are mismatched (got handshake key 0xc800080, needed 0xc700080)
/Users/fabioperrella/projects/xyz/db/migrate/20191202135855_add_batch_table.rb:12:in `change'

OK. This is interesting. I will install everything on my powerbook to build Departure there, and see if I can reproduce the problem. If I can reproduce it, I should be able to fix it. I'll update when I get that done, though it may take a few days. My week is pretty busy.

A little late to the party but I ran into the same issue when updating to Big Sur on an intel mac. I think the issue stems from the fact that Big Sur 11.3 changes the OS installed version of perl from 5.17 to 5.30

You should be able to run brew upgrade -s percona-toolkit to install percona toolkit 3.3.1 and rebuild it from source to fix the binary incompatibility. You can verify this by running pt-online-schema-change --version. If it is working you'll get the actual version number, if not you'll get a binary incompatibility error similar to the one above.