forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7f580aa
committed
Improve contrib/amcheck's tests for CREATE INDEX CONCURRENTLY.
Commitsfdd965d and3cd9c3b tested CREATE INDEX CONCURRENTLY bylaunching two separate pgbench runs concurrently. This was needed sothat only a single client thread would run CREATE INDEX CONCURRENTLY,avoiding deadlock between two CICs. However, there's a better way,which is to use an advisory lock to prevent concurrent CICs. That'sbetter in part because the test code is shorter and more readable, butmostly because it automatically scales things to launch an appropriatenumber of CICs relative to the number of INSERT transactions.As committed, typically half to three-quarters of the CIC transactionswere pointless because the INSERT transactions had already stopped.In passing, remove background_pgbench, which was added to supportthese tests and isn't needed anymore. We can always put it backif we find a use for it later.Back-patch to v12; older pgbench versions lack theconditional-execution features needed for this method.Tom Lane and Andrey BorodinDiscussion:https://postgr.es/m/139687.1635277318@sss.pgh.pa.us1 parent46dea24 commit7f580aa
File tree
3 files changed
+41
-108
lines changed- contrib/amcheck/t
- src/test/perl/PostgreSQL/Test
3 files changed
+41
-108
lines changedLines changed: 17 additions & 31 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
12 |
| - | |
| 12 | + | |
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| |||
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
28 |
| - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 |
| |
30 |
| - | |
31 |
| - | |
32 |
| - | |
33 |
| - | |
34 |
| - | |
35 |
| - | |
36 |
| - | |
37 |
| - | |
38 |
| - | |
39 |
| - | |
40 |
| - | |
41 |
| - | |
42 |
| - | |
43 |
| - | |
44 |
| - | |
45 |
| - | |
46 |
| - | |
47 |
| - | |
48 | 34 |
| |
49 |
| - | |
| 35 | + | |
50 | 36 |
| |
51 | 37 |
| |
52 | 38 |
| |
53 |
| - | |
| 39 | + | |
54 | 40 |
| |
55 | 41 |
| |
56 | 42 |
| |
| |||
62 | 48 |
| |
63 | 49 |
| |
64 | 50 |
| |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
65 | 60 |
| |
66 | 61 |
| |
67 | 62 |
| |
68 |
| - | |
69 |
| - | |
70 |
| - | |
71 |
| - | |
72 |
| - | |
73 |
| - | |
74 |
| - | |
75 |
| - | |
76 |
| - | |
77 | 63 |
| |
78 | 64 |
|
Lines changed: 24 additions & 29 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
12 |
| - | |
| 12 | + | |
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| |||
132 | 132 |
| |
133 | 133 |
| |
134 | 134 |
| |
| 135 | + | |
| 136 | + | |
| 137 | + | |
135 | 138 |
| |
136 | 139 |
| |
137 | 140 |
| |
138 | 141 |
| |
139 |
| - | |
140 |
| - | |
141 |
| - | |
142 |
| - | |
143 |
| - | |
144 |
| - | |
145 |
| - | |
146 |
| - | |
147 |
| - | |
148 |
| - | |
149 |
| - | |
150 |
| - | |
151 |
| - | |
152 |
| - | |
153 |
| - | |
154 |
| - | |
155 | 142 |
| |
156 | 143 |
| |
157 | 144 |
| |
158 | 145 |
| |
159 | 146 |
| |
160 | 147 |
| |
161 |
| - | |
| 148 | + | |
162 | 149 |
| |
163 |
| - | |
| 150 | + | |
164 | 151 |
| |
165 | 152 |
| |
166 | 153 |
| |
167 | 154 |
| |
168 | 155 |
| |
169 |
| - | |
| 156 | + | |
170 | 157 |
| |
171 | 158 |
| |
172 | 159 |
| |
173 | 160 |
| |
174 | 161 |
| |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
175 | 179 |
| |
176 | 180 |
| |
177 | 181 |
| |
178 |
| - | |
179 |
| - | |
180 |
| - | |
181 |
| - | |
182 |
| - | |
183 |
| - | |
184 |
| - | |
185 |
| - | |
186 |
| - | |
187 | 182 |
| |
188 | 183 |
|
Lines changed: 0 additions & 48 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2070 | 2070 |
| |
2071 | 2071 |
| |
2072 | 2072 |
| |
2073 |
| - | |
2074 |
| - | |
2075 |
| - | |
2076 |
| - | |
2077 |
| - | |
2078 |
| - | |
2079 |
| - | |
2080 |
| - | |
2081 |
| - | |
2082 |
| - | |
2083 |
| - | |
2084 |
| - | |
2085 |
| - | |
2086 |
| - | |
2087 |
| - | |
2088 |
| - | |
2089 |
| - | |
2090 |
| - | |
2091 |
| - | |
2092 |
| - | |
2093 |
| - | |
2094 |
| - | |
2095 |
| - | |
2096 |
| - | |
2097 |
| - | |
2098 |
| - | |
2099 |
| - | |
2100 |
| - | |
2101 |
| - | |
2102 |
| - | |
2103 |
| - | |
2104 |
| - | |
2105 |
| - | |
2106 |
| - | |
2107 |
| - | |
2108 |
| - | |
2109 |
| - | |
2110 |
| - | |
2111 |
| - | |
2112 |
| - | |
2113 |
| - | |
2114 |
| - | |
2115 |
| - | |
2116 |
| - | |
2117 |
| - | |
2118 |
| - | |
2119 |
| - | |
2120 |
| - | |
2121 | 2073 |
| |
2122 | 2074 |
| |
2123 | 2075 |
| |
|
0 commit comments
Comments
(0)