Fix isolation_add_remove_node test

We shouldn't be able to disable the first node in the cluster.
Isolation test doesn't handle cache invalidations/concurrency
very well, they are NOT real client backends.
It is possible that they improved isolation tester with PG16.

So, we fix the test here such that it doesn't disable the first node.
onder_pg16_outer_crash
naisila 2023-08-16 13:31:43 +03:00
parent f76f0b99f2
commit dbfcb69d57
3 changed files with 48 additions and 26 deletions

View File

@ -698,9 +698,17 @@ master_remove_node
(1 row)
starting permutation: s1-add-node-1 s1-begin s1-disable-node-1 s2-disable-node-1 s1-abort s1-show-nodes
starting permutation: s1-add-node-1 s1-add-node-2 s1-begin s1-disable-node-2 s2-disable-node-2 s1-abort s1-show-nodes
step s1-add-node-1:
SELECT 1 FROM master_add_node('localhost', 57637);
SELECT 1 FROM master_add_node('localhost', 57637);
?column?
---------------------------------------------------------------------
1
(1 row)
step s1-add-node-2:
SELECT 1 FROM master_add_node('localhost', 57638);
?column?
---------------------------------------------------------------------
@ -708,11 +716,11 @@ step s1-add-node-1:
(1 row)
step s1-begin:
BEGIN;
BEGIN;
step s1-disable-node-1:
SELECT 1 FROM master_disable_node('localhost', 57637);
SELECT public.wait_until_metadata_sync();
step s1-disable-node-2:
SELECT 1 FROM master_disable_node('localhost', 57638);
SELECT public.wait_until_metadata_sync();
?column?
---------------------------------------------------------------------
@ -724,14 +732,14 @@ wait_until_metadata_sync
(1 row)
step s2-disable-node-1:
SELECT 1 FROM master_disable_node('localhost', 57637);
SELECT public.wait_until_metadata_sync();
step s2-disable-node-2:
SELECT 1 FROM master_disable_node('localhost', 57638);
SELECT public.wait_until_metadata_sync(60000);
<waiting ...>
step s1-abort:
ABORT;
ABORT;
step s2-disable-node-1: <... completed>
step s2-disable-node-2: <... completed>
?column?
---------------------------------------------------------------------
1
@ -743,15 +751,17 @@ wait_until_metadata_sync
(1 row)
step s1-show-nodes:
SELECT nodename, nodeport, isactive FROM pg_dist_node ORDER BY nodename, nodeport;
SELECT nodename, nodeport, isactive FROM pg_dist_node ORDER BY nodename, nodeport;
nodename |nodeport|isactive
---------------------------------------------------------------------
localhost| 57637|f
(1 row)
localhost| 57637|t
localhost| 57638|f
(2 rows)
master_remove_node
---------------------------------------------------------------------
(1 row)
(2 rows)

View File

@ -3,8 +3,8 @@ Parsed test spec with 3 sessions
starting permutation: s1-begin s1-update-node-1 s2-update-node-2 s1-commit s1-show-nodes s3-update-node-1-back s3-update-node-2-back s3-manually-fix-metadata
nodeid|nodename |nodeport
---------------------------------------------------------------------
22|localhost| 57638
21|localhost| 57637
23|localhost| 57638
22|localhost| 57637
(2 rows)
step s1-begin:
@ -43,8 +43,8 @@ step s1-show-nodes:
nodeid|nodename |nodeport|isactive
---------------------------------------------------------------------
21|localhost| 58637|t
22|localhost| 58638|t
22|localhost| 58637|t
23|localhost| 58638|t
(2 rows)
step s3-update-node-1-back:
@ -93,8 +93,8 @@ nodeid|nodename|nodeport
starting permutation: s1-begin s1-update-node-1 s2-begin s2-update-node-1 s1-commit s2-abort s1-show-nodes s3-update-node-1-back s3-manually-fix-metadata
nodeid|nodename |nodeport
---------------------------------------------------------------------
24|localhost| 57638
23|localhost| 57637
25|localhost| 57638
24|localhost| 57637
(2 rows)
step s1-begin:
@ -139,8 +139,8 @@ step s1-show-nodes:
nodeid|nodename |nodeport|isactive
---------------------------------------------------------------------
24|localhost| 57638|t
23|localhost| 58637|t
25|localhost| 57638|t
24|localhost| 58637|t
(2 rows)
step s3-update-node-1-back:
@ -178,8 +178,8 @@ nodeid|nodename|nodeport
starting permutation: s2-create-table s1-begin s1-update-node-nonexistent s1-prepare-transaction s2-cache-prepared-statement s1-commit-prepared s2-execute-prepared s1-update-node-existent s3-manually-fix-metadata
nodeid|nodename |nodeport
---------------------------------------------------------------------
26|localhost| 57638
25|localhost| 57637
27|localhost| 57638
26|localhost| 57637
(2 rows)
step s2-create-table:

View File

@ -45,6 +45,12 @@ step "s1-disable-node-1"
SELECT public.wait_until_metadata_sync();
}
step "s1-disable-node-2"
{
SELECT 1 FROM master_disable_node('localhost', 57638);
SELECT public.wait_until_metadata_sync();
}
step "s1-remove-node-1"
{
SELECT * FROM master_remove_node('localhost', 57637);
@ -88,6 +94,12 @@ step "s2-disable-node-1"
SELECT public.wait_until_metadata_sync();
}
step "s2-disable-node-2"
{
SELECT 1 FROM master_disable_node('localhost', 57638);
SELECT public.wait_until_metadata_sync(60000);
}
step "s2-remove-node-1"
{
SELECT * FROM master_remove_node('localhost', 57637);
@ -135,4 +147,4 @@ permutation "s1-add-inactive-1" "s1-begin" "s1-disable-node-1" "s2-activate-node
permutation "s1-add-inactive-1" "s1-begin" "s1-activate-node-1" "s2-disable-node-1" "s1-commit" "s1-show-nodes"
// disable an active node from 2 transactions, one aborts
permutation "s1-add-node-1" "s1-begin" "s1-disable-node-1" "s2-disable-node-1" "s1-abort" "s1-show-nodes"
permutation "s1-add-node-1" "s1-add-node-2" "s1-begin" "s1-disable-node-2" "s2-disable-node-2" "s1-abort" "s1-show-nodes"