Large row affecting statements failing mid-transaction may not get undone properly by TransactionServices if part of multi-message Transaction
Bug #683147 reported by
David Shrewsbury
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Drizzle |
Fix Released
|
High
|
David Shrewsbury | ||
7.0 |
Fix Released
|
High
|
David Shrewsbury |
Bug Description
This bug report is a reminder for me to investigate this further...
Say you have:
BEGIN;
UPDATE t1;
INSERT INTO t2 ... SELECT FROM t3;
COMMIT;
If all of the row changes from both statements can fit in a single GPB Transaction message, then if the INSERT..SELECT fails, we have no problem as its effects are undone properly by Transaction Services.
However, if the number of rows affected by INSERT..SELECT is large and causes the Transaction message to be split up (as for a bulk insert), then if that statement fails *after* it has been segmented, I believe we'll issue a ROLLBACK for the entire transaction, which is total fail.
Need a test case to confirm this.
Related branches
lp://staging/~stewart/drizzle/enhanced-storage-engine-api-patdown
- Brian Aker: Needs Fixing
-
Diff: 1235 lines (+804/-138)20 files modifieddrizzled/cursor.h (+1/-0)
drizzled/plugin/storage_engine.h (+2/-0)
drizzled/plugin/transactional_storage_engine.h (+1/-0)
plugin/storage_engine_api_tester/cursor_states.cc (+53/-6)
plugin/storage_engine_api_tester/engine_states.cc (+28/-5)
plugin/storage_engine_api_tester/storage_engine_api_tester.cc (+288/-127)
plugin/storage_engine_api_tester/tests/r/multi_stmt_txn.result (+29/-0)
plugin/storage_engine_api_tester/tests/r/rnd_pos.result (+28/-0)
plugin/storage_engine_api_tester/tests/r/select.result (+1/-0)
plugin/storage_engine_api_tester/tests/r/transaction.result (+43/-0)
plugin/storage_engine_api_tester/tests/r/txn_log_insert.result (+44/-0)
plugin/storage_engine_api_tester/tests/r/txn_log_rollback_large_stmt.result (+55/-0)
plugin/storage_engine_api_tester/tests/t/multi_stmt_txn.test (+18/-0)
plugin/storage_engine_api_tester/tests/t/rnd_pos.test (+48/-0)
plugin/storage_engine_api_tester/tests/t/select.test (+1/-0)
plugin/storage_engine_api_tester/tests/t/transaction.test (+56/-0)
plugin/storage_engine_api_tester/tests/t/txn_log_insert-master.opt (+1/-0)
plugin/storage_engine_api_tester/tests/t/txn_log_insert.test (+53/-0)
plugin/storage_engine_api_tester/tests/t/txn_log_rollback_large_stmt-master.opt (+1/-0)
plugin/storage_engine_api_tester/tests/t/txn_log_rollback_large_stmt.test (+53/-0)
lp://staging/~dshrews/drizzle/statement_rollback
- Drizzle Developers: Pending requested
-
Diff: 112381 lines (+681/-111244)20 files modifieddrizzled/message/statement_transform.cc (+4/-0)
drizzled/message/transaction.proto (+1/-0)
drizzled/sql_insert.cc (+0/-9)
drizzled/sql_update.cc (+0/-13)
drizzled/transaction_services.cc (+93/-163)
drizzled/transaction_services.h (+8/-0)
plugin/transaction_log/tests/r/bulk_commit.result (+24/-55753)
plugin/transaction_log/tests/r/bulk_rollback.result (+20/-55205)
plugin/transaction_log/tests/r/rollback_statement.result (+211/-0)
plugin/transaction_log/tests/r/transaction_log_delete.result (+23/-0)
plugin/transaction_log/tests/r/transaction_log_transaction.result (+142/-18)
plugin/transaction_log/tests/r/transaction_log_update.result (+4/-62)
plugin/transaction_log/tests/t/bulk_commit-master.opt (+1/-1)
plugin/transaction_log/tests/t/bulk_commit.test (+9/-4)
plugin/transaction_log/tests/t/bulk_rollback-master.opt (+1/-1)
plugin/transaction_log/tests/t/bulk_rollback.test (+7/-4)
plugin/transaction_log/tests/t/rollback_statement-master.opt (+1/-0)
plugin/transaction_log/tests/t/rollback_statement.test (+85/-0)
plugin/transaction_log/tests/t/transaction_log_update.test (+0/-8)
plugin/transaction_log/utilities/transaction_reader.cc (+47/-3)
To post a comment you must log in.
test in this branch has one for exactly this kind of situation.