Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite186f56

Browse files
committed
Close race condition in slot_creation_error.spec.
Use the pattern from detach-partition-concurrently-3.spec. Perbuildfarm member wrasse.Reviewed by Kyotaro Horiguchi and Andres Freund.Discussion:https://postgr.es/m/20220318072837.GC2739027@rfd.leadboat.com
1 parent4a288a3 commite186f56

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

‎contrib/test_decoding/expected/slot_creation_error.out

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ step s1_cancel_s2:
2323
SELECT pg_cancel_backend(pid)
2424
FROM pg_stat_activity
2525
WHERE application_name = 'isolation/slot_creation_error/s2';
26-
26+
<waiting ...>
27+
step s2_init: <... completed>
28+
ERROR: canceling statement due to user request
29+
step s1_cancel_s2: <... completed>
2730
pg_cancel_backend
2831
-----------------
2932
t
3033
(1 row)
3134

32-
step s2_init: <... completed>
33-
ERROR: canceling statement due to user request
3435
step s1_view_slot:
3536
SELECT slot_name, slot_type, active FROM pg_replication_slots WHERE slot_name = 'slot_creation_error'
3637

@@ -90,18 +91,19 @@ step s1_terminate_s2:
9091
SELECT pg_terminate_backend(pid)
9192
FROM pg_stat_activity
9293
WHERE application_name = 'isolation/slot_creation_error/s2';
93-
94-
pg_terminate_backend
95-
--------------------
96-
t
97-
(1 row)
98-
94+
<waiting ...>
9995
step s2_init: <... completed>
10096
FATAL: terminating connection due to administrator command
10197
server closed the connection unexpectedly
10298
This probably means the server terminated abnormally
10399
before or while processing the request.
104100

101+
step s1_terminate_s2: <... completed>
102+
pg_terminate_backend
103+
--------------------
104+
t
105+
(1 row)
106+
105107
step s1_c: COMMIT;
106108
step s1_view_slot:
107109
SELECT slot_name, slot_type, active FROM pg_replication_slots WHERE slot_name = 'slot_creation_error'

‎contrib/test_decoding/specs/slot_creation_error.spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ step s2_init {
3535
# The tests first start a transaction with an xid assigned in s1, then create
3636
# a slot in s2. The slot creation waits for s1's transaction to end. Instead
3737
# we cancel / terminate s2.
38-
permutations1_bs1_xids2_inits1_view_slots1_cancel_s2s1_view_slots1_c
38+
permutations1_bs1_xids2_inits1_view_slots1_cancel_s2(s2_init)s1_view_slots1_c
3939
permutations1_bs1_xids2_inits1_cs1_view_slots1_drop_slot# check slot creation still works
40-
permutations1_bs1_xids2_inits1_terminate_s2s1_cs1_view_slot
40+
permutations1_bs1_xids2_inits1_terminate_s2(s2_init)s1_cs1_view_slot
4141
# can't run tests after this, due to s2's connection failure

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp