Closed GoogleCodeExporter closed 9 years ago
A note on reproducing this case. There is a general problem with the
ColumnNameFilter (and probably PrimaryKeyFilter), namely that they fail if the
table being looked up cannot be found.
I had trouble reproducing this error until I turned off replication (e.g.,
issue 'trepctl offline') before running pt-online-schema-change, then ran
'trepctl online' once everything finished. If you do this you will easily get
the failure, because when you turn on the replicator it will not be able to
find _salaries_new since it has been cleaned up.
Original comment by robert.h...@continuent.com
on 29 May 2014 at 10:22
This bug is now corrected. The implementation is as follows:
1. The colnames filter has been extended to include a boolean field
ignoreMissingTables. This is set true in the .tpl file for the filter as well
as the class, as shown by the following example:
# Column name filter. Adds column name metadata to row updates. This is
# required for MySQL row replication if you have logic that requires column
# names.
replicator.filter.colnames=com.continuent.tungsten.replicator.filter.ColumnNameF
ilter
# Heterogeneous topologies need signed/unsigned information.
replicator.filter.colnames.addSignedFlag=true
# If true, ignore tables that have no metadata and generate automatic column
# names. This can happen when reading an old DBMS log in which case current
# metadata is not accessible if tables have sinc been deleted. If false,
# the filter will stop with an exception.
replicator.filter.colnames.ignoreMissingTables=true
When this parameter is true, the filter generates dummy names of the form
col_1, col_2, ..., col_N for any change that has missing fields.
2. The enumtostring filter now avoids making changes if it cannot find table
metadata.
You can prove that the problems are corrected by setting up a Tungsten master
enabled for heterogeneous replication and running the following script on the
master host:
#!/bin/bash
# Reproduce Issue 924.
set -x
trepctl offline
mysql -uroot <<SQL
drop table if exists test.no_schema;
create table test.no_schema (id int primary key, data1 varchar(20));
insert into test.no_schema values(1, 'one');
update test.no_schema set data1 = 'two' where id=1;
delete from test.no_schema where id=1;
drop table if exists test.no_schema;
SQL
trepctl online
Original comment by robert.h...@continuent.com
on 30 May 2014 at 7:11
Initial tests show that this fix is working fine. We no longer get a trip up of
the replicator when the structure changes, and the updated CSV files match the
updated structure as follows.
Original comment by mc.br...@continuent.com
on 2 Jun 2014 at 10:48
Confirmed the fix using two different methods (the initial one used when
reporting the issue and the one suggested by Robert).
The issue is solved. A permanent test is needed.
Original comment by g.maxia
on 19 Sep 2014 at 3:16
The documentation has been updated, and an entry has been added to the 3.0
release notes.
Original comment by mc.br...@continuent.com
on 13 Oct 2014 at 10:49
Original issue reported on code.google.com by
g.maxia
on 23 May 2014 at 5:03