1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
Parsed test spec with 3 sessions
starting permutation: listenc notify1 notify2 notify3 notifyf
step listenc: LISTEN c1; LISTEN c2;
step notify1: NOTIFY c1;
notifier: NOTIFY "c1" with payload "" from notifier
step notify2: NOTIFY c2, 'payload';
notifier: NOTIFY "c2" with payload "payload" from notifier
step notify3: NOTIFY c3, 'payload3';
step notifyf: SELECT pg_notify('c2', NULL);
pg_notify
---------
(1 row)
notifier: NOTIFY "c2" with payload "" from notifier
starting permutation: listenc notifyd1 notifyd2 notifys1
step listenc: LISTEN c1; LISTEN c2;
step notifyd1: NOTIFY c2, 'payload'; NOTIFY c1; NOTIFY "c2", 'payload';
notifier: NOTIFY "c2" with payload "payload" from notifier
notifier: NOTIFY "c1" with payload "" from notifier
step notifyd2: NOTIFY c1; NOTIFY c1; NOTIFY c1, 'p1'; NOTIFY c1, 'p2';
notifier: NOTIFY "c1" with payload "" from notifier
notifier: NOTIFY "c1" with payload "p1" from notifier
notifier: NOTIFY "c1" with payload "p2" from notifier
step notifys1:
BEGIN;
NOTIFY c1, 'payload'; NOTIFY "c2", 'payload';
NOTIFY c1, 'payload'; NOTIFY "c2", 'payload';
SAVEPOINT s1;
NOTIFY c1, 'payload'; NOTIFY "c2", 'payload';
NOTIFY c1, 'payloads'; NOTIFY "c2", 'payloads';
NOTIFY c1, 'payload'; NOTIFY "c2", 'payload';
NOTIFY c1, 'payloads'; NOTIFY "c2", 'payloads';
RELEASE SAVEPOINT s1;
SAVEPOINT s2;
NOTIFY c1, 'rpayload'; NOTIFY "c2", 'rpayload';
NOTIFY c1, 'rpayloads'; NOTIFY "c2", 'rpayloads';
NOTIFY c1, 'rpayload'; NOTIFY "c2", 'rpayload';
NOTIFY c1, 'rpayloads'; NOTIFY "c2", 'rpayloads';
ROLLBACK TO SAVEPOINT s2;
COMMIT;
notifier: NOTIFY "c1" with payload "payload" from notifier
notifier: NOTIFY "c2" with payload "payload" from notifier
notifier: NOTIFY "c1" with payload "payloads" from notifier
notifier: NOTIFY "c2" with payload "payloads" from notifier
starting permutation: llisten notify1 notify2 notify3 notifyf lcheck
step llisten: LISTEN c1; LISTEN c2;
step notify1: NOTIFY c1;
step notify2: NOTIFY c2, 'payload';
step notify3: NOTIFY c3, 'payload3';
step notifyf: SELECT pg_notify('c2', NULL);
pg_notify
---------
(1 row)
step lcheck: SELECT 1 AS x;
x
-
1
(1 row)
listener: NOTIFY "c1" with payload "" from notifier
listener: NOTIFY "c2" with payload "payload" from notifier
listener: NOTIFY "c2" with payload "" from notifier
starting permutation: listenc llisten notify1 notify2 notify3 notifyf lcheck
step listenc: LISTEN c1; LISTEN c2;
step llisten: LISTEN c1; LISTEN c2;
step notify1: NOTIFY c1;
notifier: NOTIFY "c1" with payload "" from notifier
step notify2: NOTIFY c2, 'payload';
notifier: NOTIFY "c2" with payload "payload" from notifier
step notify3: NOTIFY c3, 'payload3';
step notifyf: SELECT pg_notify('c2', NULL);
pg_notify
---------
(1 row)
notifier: NOTIFY "c2" with payload "" from notifier
step lcheck: SELECT 1 AS x;
x
-
1
(1 row)
listener: NOTIFY "c1" with payload "" from notifier
listener: NOTIFY "c2" with payload "payload" from notifier
listener: NOTIFY "c2" with payload "" from notifier
starting permutation: l2listen l2begin notify1 lbegins llisten lcommit l2commit l2stop
step l2listen: LISTEN c1;
step l2begin: BEGIN;
step notify1: NOTIFY c1;
step lbegins: BEGIN ISOLATION LEVEL SERIALIZABLE;
step llisten: LISTEN c1; LISTEN c2;
step lcommit: COMMIT;
step l2commit: COMMIT;
listener2: NOTIFY "c1" with payload "" from notifier
step l2stop: UNLISTEN *;
starting permutation: llisten lbegin usage bignotify usage
step llisten: LISTEN c1; LISTEN c2;
step lbegin: BEGIN;
step usage: SELECT pg_notification_queue_usage() > 0 AS nonzero;
nonzero
-------
f
(1 row)
step bignotify: SELECT count(pg_notify('c1', s::text)) FROM generate_series(1, 1000) s;
count
-----
1000
(1 row)
step usage: SELECT pg_notification_queue_usage() > 0 AS nonzero;
nonzero
-------
t
(1 row)
|