zxs / tungsten-replicator

Automatically exported from code.google.com/p/tungsten-replicator
0 stars 0 forks source link

MySQLDrizzleApplier can corrupt datetime values when there are several applier threads (fan-in, parallel apply ?) #1053

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
This is not easy to reproduce (succeeded by running JVM in debug)
1.Using fan-in topology
2.set global binlog_format=row on both masters
3.run a test that inserts datetime into a column and check consistency from 
time to time.

What is the expected output?
No issue when running checks

What do you see instead?
Consistency check fails

What is the possible cause?
The MySQLDrizzleApplier uses a SimpleDateFormat object which is not thread safe.
As a result, when multiple threads access it concurrently, they can mix dates

What is the proposed solution?
Fix the applier

Additional information
None

Use labels and text to provide additional information.

Original issue reported on code.google.com by stephane...@continuent.com on 29 Oct 2014 at 11:54

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r2658.

Reomved static declaration of date formatter (in order to avoid race conditions 
which are possible as SimpleDateFormat is not thread safe)

Original comment by stephane...@continuent.com on 4 Nov 2014 at 12:43

GoogleCodeExporter commented 9 years ago
Fixed in trunk

Original comment by stephane...@continuent.com on 4 Nov 2014 at 12:44

GoogleCodeExporter commented 9 years ago
The issue is resolved. 
Tested with parallel streams of increasing size, from 10 to 20,000 records.
The behavior that was detected using the above method does not show up anymore.
A test will be added to the test suite.

Original comment by g.maxia on 4 Nov 2014 at 2:25

GoogleCodeExporter commented 9 years ago

Original comment by mc.br...@continuent.com on 11 Dec 2014 at 4:38