Add recovery vs. recovery isolation test

pull/1696/head
Marco Slot 2017-11-20 11:51:50 +01:00
parent ae47df01ea
commit fe798cf0f9
5 changed files with 44 additions and 12 deletions

View File

@ -98,7 +98,7 @@ step s1-get-current-transaction-id:
row
(0,287)
(0,289)
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,287)
localhost 57637 t (0,289)

View File

@ -29,11 +29,11 @@ step detector-dump-wait-edges:
waiting_transaction_numblocking_transaction_numblocking_transaction_waiting
290 289 f
292 291 f
transactionnumberwaitingtransactionnumbers
289
290 289
291
292 291
step s1-abort:
ABORT;
@ -77,14 +77,14 @@ step detector-dump-wait-edges:
waiting_transaction_numblocking_transaction_numblocking_transaction_waiting
294 293 f
295 293 f
295 294 t
296 295 f
297 295 f
297 296 t
transactionnumberwaitingtransactionnumbers
293
294 293
295 293,294
295
296 295
297 295,296
step s1-abort:
ABORT;

View File

@ -16,7 +16,7 @@ step s1-finish:
COMMIT;
step s2-insert: <... completed>
error in steps s1-finish s2-insert: ERROR: duplicate key value violates unique constraint "test_locking_a_key_102320"
error in steps s1-finish s2-insert: ERROR: duplicate key value violates unique constraint "test_locking_a_key_102321"
step s2-finish:
COMMIT;

View File

@ -19,3 +19,27 @@ step s2-insert:
step s1-commit:
COMMIT;
starting permutation: s1-begin s1-recover s2-recover s1-commit
create_reference_table
step s1-begin:
BEGIN;
step s1-recover:
SELECT recover_prepared_transactions();
recover_prepared_transactions
0
step s2-recover:
SELECT recover_prepared_transactions();
<waiting ...>
step s1-commit:
COMMIT;
step s2-recover: <... completed>
recover_prepared_transactions
0

View File

@ -33,5 +33,13 @@ step "s2-insert"
INSERT INTO test_transaction_recovery VALUES (1,2);
}
step "s2-recover"
{
SELECT recover_prepared_transactions();
}
# Recovery and 2PCs should not block each other
permutation "s1-begin" "s1-recover" "s2-insert" "s1-commit"
# Recovery should not run concurrently
permutation "s1-begin" "s1-recover" "s2-recover" "s1-commit"