shlomi-noach / openarkkit

Automatically exported from code.google.com/p/openarkkit
24 stars 16 forks source link

oak-online-alter-table: Patch to add ability to disable binary logging #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If you have bin log or replication slave filtering rules that disable binary 
logging or replication replay of a table that you wish to ALTER, you can run 
into problems when trying to use oak-online-alter-table on said table.

The main issue is that binary logging/replication playback of the new copy of 
the table (_oak..etc)  will continue, while the main table will not. This 
causes problems with INSERT.., SELECT.

Theoretically one could add in a binlog/replication filter for the _oak_* table 
in advance, however, this is somewhat invasive, since changing bin log or 
replication filter rules actually requires a MySQL server restart. 

I found the best way to deal with this is to have a flag that lets you tell 
oak-online-alter-table to  SET SQL_LOG_BIN=0 for the duration of the online 
alter operation. This simple patch adds a flag to oak-online-alter-table to 
allow you to do exactly that.

The new option is:

  -N or --skip-binlog

The caveat, of course, is that if you need to recover from a backup and use 
logs to roll forward, your table alter will not be logged and you may need to 
perform it again. This is a problem only for people who bin log everything but 
use replication slave filters to exclude playback for specific tables.

Original issue reported on code.google.com by lachlan....@gmail.com on 17 Oct 2011 at 6:09

Attachments:

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r191.

Original comment by shlomi.n...@gmail.com on 13 Jan 2013 at 11:10