Transaction_log not properly capturing relevant data for UPDATE statements
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Drizzle |
Fix Released
|
High
|
Joe Daly | ||
7.0 |
Fix Released
|
High
|
Joe Daly |
Bug Description
The transaction_log is somehow missing data from certain UPDATE statements.
Up until this query, we have been successfully replicating from the transaction_log via transaction_reader output.
However, the query below causes problems.
Query:
UPDATE `bb` SET `col_bigint` = 0 WHERE `col_bigint_key` != 8 ORDER BY `col_bigint`
This affects two rows:
drizzle> select pk, col_bigint from bb where col_bigint = 0;
+----+------------+
| pk | col_bigint |
+----+------------+
| 3 | 0 |
| 11 | 0 |
+----+------------+
2 rows in set (0 sec)
The transaction_log looks borked:
Note how there is no value for pk=11. And despite the fact that the log contains an 'after' value for pk=3, we still get this output from transaction_reader after calling it against the log (no value to SET to)
START TRANSACTION;
UPDATE `test`.`bb` SET WHERE `pk`=11;
UPDATE `test`.`bb` SET WHERE `pk`=3;
COMMIT;
Transaction_log output
drizzle> select print_transacti
+------
| print_transacti
+------
| transaction_context {
server_id: 1
transaction_id: 86
start_timestamp: 1285087911494163
end_timestamp: 1285087911553174
}
statement {
type: UPDATE
start_timestamp: 1285087911494166
end_timestamp: 1285087911553173
update_header {
table_metadata {
schema_name: "test"
table_name: "bb"
}
key_
type: INTEGER
name: "pk"
}
}
update_data {
segment_id: 1
end_segment: true
record {
key_value: "11"
}
record {
key_value: "3"
after_value: "0"
is_null: false
}
}
}
|
+------
Related branches
- Drizzle Merge Team: Pending requested
-
Diff: 385 lines (+251/-26)6 files modifieddrizzled/transaction_services.cc (+43/-21)
drizzled/transaction_services.h (+15/-1)
plugin/transaction_log/tests/r/null_values.result (+24/-2)
plugin/transaction_log/tests/r/transaction_log_update.result (+136/-0)
plugin/transaction_log/tests/t/null_values.inc (+7/-2)
plugin/transaction_log/tests/t/transaction_log_update.test (+26/-0)
Changed in drizzle: | |
status: | New → Confirmed |
importance: | Undecided → High |
assignee: | nobody → David Shrewsbury (dshrews) |
tags: | added: replication |
Changed in drizzle: | |
assignee: | David Shrewsbury (dshrews) → Joe Daly (skinny.moey) |
Changed in drizzle: | |
status: | Confirmed → Fix Committed |
Changed in drizzle: | |
status: | Fix Committed → Fix Released |
Linked branch contains a test case for this in plugin/ transaction_ log/tests/ t/bug644529.test
There is a .result file recorded, but it is incorrect.
./test-run --suite= transaction_ log bug644529
The test case only has the state of table 'bb' just before the UPDATE that causes bad logs. All queries up to that point had passed / master and slave matched.
If you would like the full list of queries executed against the server from the randgen run, just let me know and I'll provide it (it is a bit verbose though)