mirror of https://github.com/citusdata/citus.git
Add transaction recovery regression tests
parent
3d7f79127d
commit
5923334114
|
@ -98,7 +98,7 @@ step s1-get-current-transaction-id:
|
|||
|
||||
row
|
||||
|
||||
(0,186)
|
||||
(0,189)
|
||||
step s2-get-first-worker-active-transactions:
|
||||
SELECT * FROM run_command_on_workers('SELECT row(initiator_node_identifier, transaction_number)
|
||||
FROM
|
||||
|
@ -109,4 +109,4 @@ step s2-get-first-worker-active-transactions:
|
|||
|
||||
nodename nodeport success result
|
||||
|
||||
localhost 57637 t (0,186)
|
||||
localhost 57637 t (0,189)
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
Parsed test spec with 2 sessions
|
||||
|
||||
starting permutation: s1-begin s1-recover s2-insert s1-commit
|
||||
create_reference_table
|
||||
|
||||
|
||||
step s1-begin:
|
||||
BEGIN;
|
||||
|
||||
step s1-recover:
|
||||
SELECT recover_prepared_transactions();
|
||||
|
||||
recover_prepared_transactions
|
||||
|
||||
0
|
||||
step s2-insert:
|
||||
INSERT INTO test_transaction_recovery VALUES (1,2);
|
||||
<waiting ...>
|
||||
step s1-commit:
|
||||
COMMIT;
|
||||
|
||||
step s2-insert: <... completed>
|
|
@ -8,5 +8,5 @@ test: isolation_cluster_management
|
|||
test: isolation_dml_vs_repair isolation_copy_placement_vs_copy_placement isolation_cancellation
|
||||
test: isolation_concurrent_dml isolation_data_migration
|
||||
test: isolation_drop_shards isolation_copy_placement_vs_modification
|
||||
test: isolation_insert_vs_vacuum
|
||||
test: isolation_insert_vs_vacuum isolation_transaction_recovery
|
||||
test: isolation_distributed_transaction_id
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
setup
|
||||
{
|
||||
CREATE TABLE test_transaction_recovery(column1 int, column2 int);
|
||||
SELECT create_reference_table('test_transaction_recovery');
|
||||
}
|
||||
|
||||
teardown
|
||||
{
|
||||
DROP TABLE test_transaction_recovery;
|
||||
}
|
||||
|
||||
session "s1"
|
||||
|
||||
step "s1-begin"
|
||||
{
|
||||
BEGIN;
|
||||
}
|
||||
|
||||
step "s1-recover"
|
||||
{
|
||||
SELECT recover_prepared_transactions();
|
||||
}
|
||||
|
||||
step "s1-commit"
|
||||
{
|
||||
COMMIT;
|
||||
}
|
||||
|
||||
session "s2"
|
||||
|
||||
step "s2-insert"
|
||||
{
|
||||
INSERT INTO test_transaction_recovery VALUES (1,2);
|
||||
}
|
||||
|
||||
# Recovery and 2PCs should block each other
|
||||
permutation "s1-begin" "s1-recover" "s2-insert" "s1-commit"
|
Loading…
Reference in New Issue