- Notifications
You must be signed in to change notification settings - Fork5
Commit4a9c30a
committed
Fix management of pendingOpsTable in auxiliary processes.
mdinit() was misusing IsBootstrapProcessingMode() to decide whether tocreate an fsync pending-operations table in the current process. This ledto creating a table not only in the startup and checkpointer processes asintended, but also in the bgwriter process, not to mention other auxiliaryprocesses such as walwriter and walreceiver. Creation of the table in thebgwriter is fatal, because it absorbs fsync requests that should have goneto the checkpointer; instead they just sit in bgwriter local memory and arenever acted on. So writes performed by the bgwriter were not being fsync'dwhich could result in data loss after an OS crash. I think there is nolive bug with respect to walwriter and walreceiver because those neverperform any writes of shared buffers; but the potential is there forfuture breakage in those processes too.To fix, make AuxiliaryProcessMain() export the current process'sAuxProcType as a global variable, and then make mdinit() test directly forthe types of aux process that should have a pendingOpsTable. Having donethat, we might as well also get rid of the random bool flags such asam_walreceiver that some of the aux processes had grown. (Note that wecould not have fixed the bug by examining those variables in mdinit(),because it's called from BaseInit() which is run by AuxiliaryProcessMain()before entering any of the process-type-specific code.)Back-patch to 9.2, where the problem was introduced by the split-up ofbgwriter and checkpointer processes. The bogus pendingOpsTable existsin walwriter and walreceiver processes in earlier branches, but absentany evidence that it causes actual problems there, I'll leave the olderbranches alone.1 parent3855968 commit4a9c30a
File tree
11 files changed
+62
-57
lines changed- src
- backend
- access/transam
- bootstrap
- postmaster
- replication
- storage
- ipc
- smgr
- include
- bootstrap
- replication
11 files changed
+62
-57
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8946 | 8946 |
| |
8947 | 8947 |
| |
8948 | 8948 |
| |
8949 |
| - | |
| 8949 | + | |
8950 | 8950 |
| |
8951 | 8951 |
| |
8952 | 8952 |
| |
|
Lines changed: 12 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
63 | 63 |
| |
64 | 64 |
| |
65 | 65 |
| |
| 66 | + | |
| 67 | + | |
66 | 68 |
| |
67 | 69 |
| |
68 | 70 |
| |
| |||
187 | 189 |
| |
188 | 190 |
| |
189 | 191 |
| |
190 |
| - | |
191 | 192 |
| |
192 | 193 |
| |
193 | 194 |
| |
| |||
228 | 229 |
| |
229 | 230 |
| |
230 | 231 |
| |
| 232 | + | |
| 233 | + | |
| 234 | + | |
231 | 235 |
| |
232 | 236 |
| |
233 | 237 |
| |
| |||
258 | 262 |
| |
259 | 263 |
| |
260 | 264 |
| |
261 |
| - | |
| 265 | + | |
262 | 266 |
| |
263 | 267 |
| |
264 | 268 |
| |
| |||
308 | 312 |
| |
309 | 313 |
| |
310 | 314 |
| |
311 |
| - | |
| 315 | + | |
312 | 316 |
| |
313 | 317 |
| |
314 | 318 |
| |
| |||
374 | 378 |
| |
375 | 379 |
| |
376 | 380 |
| |
377 |
| - | |
378 |
| - | |
| 381 | + | |
| 382 | + | |
379 | 383 |
| |
380 | 384 |
| |
381 | 385 |
| |
382 | 386 |
| |
383 | 387 |
| |
384 | 388 |
| |
385 |
| - | |
| 389 | + | |
386 | 390 |
| |
387 | 391 |
| |
388 | 392 |
| |
| |||
396 | 400 |
| |
397 | 401 |
| |
398 | 402 |
| |
399 |
| - | |
| 403 | + | |
400 | 404 |
| |
401 | 405 |
| |
402 | 406 |
| |
| |||
436 | 440 |
| |
437 | 441 |
| |
438 | 442 |
| |
439 |
| - | |
| 443 | + | |
440 | 444 |
| |
441 | 445 |
| |
442 | 446 |
| |
|
Lines changed: 2 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
77 |
| - | |
78 |
| - | |
79 |
| - | |
80 |
| - | |
81 |
| - | |
82 | 77 |
| |
83 | 78 |
| |
84 | 79 |
| |
| |||
90 | 85 |
| |
91 | 86 |
| |
92 | 87 |
| |
93 |
| - | |
94 |
| - | |
| 88 | + | |
| 89 | + | |
95 | 90 |
| |
96 | 91 |
| |
97 | 92 |
| |
| |||
100 | 95 |
| |
101 | 96 |
| |
102 | 97 |
| |
103 |
| - | |
104 |
| - | |
105 | 98 |
| |
106 | 99 |
| |
107 | 100 |
| |
|
Lines changed: 5 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
153 | 153 |
| |
154 | 154 |
| |
155 | 155 |
| |
156 |
| - | |
157 |
| - | |
158 | 156 |
| |
159 | 157 |
| |
160 | 158 |
| |
| |||
185 | 183 |
| |
186 | 184 |
| |
187 | 185 |
| |
188 |
| - | |
189 |
| - | |
| 186 | + | |
| 187 | + | |
190 | 188 |
| |
191 | 189 |
| |
192 | 190 |
| |
| |||
195 | 193 |
| |
196 | 194 |
| |
197 | 195 |
| |
198 |
| - | |
199 | 196 |
| |
200 | 197 |
| |
201 | 198 |
| |
| |||
685 | 682 |
| |
686 | 683 |
| |
687 | 684 |
| |
688 |
| - | |
| 685 | + | |
689 | 686 |
| |
690 | 687 |
| |
691 | 688 |
| |
| |||
1129 | 1126 |
| |
1130 | 1127 |
| |
1131 | 1128 |
| |
1132 |
| - | |
| 1129 | + | |
1133 | 1130 |
| |
1134 | 1131 |
| |
1135 | 1132 |
| |
| |||
1306 | 1303 |
| |
1307 | 1304 |
| |
1308 | 1305 |
| |
1309 |
| - | |
| 1306 | + | |
1310 | 1307 |
| |
1311 | 1308 |
| |
1312 | 1309 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
89 | 89 |
| |
90 | 90 |
| |
91 | 91 |
| |
92 |
| - | |
93 |
| - | |
| 92 | + | |
| 93 | + | |
94 | 94 |
| |
95 | 95 |
| |
96 | 96 |
| |
|
Lines changed: 1 addition & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
52 | 52 |
| |
53 | 53 |
| |
54 | 54 |
| |
55 |
| - | |
56 |
| - | |
57 | 55 |
| |
58 |
| - | |
| 56 | + | |
59 | 57 |
| |
60 | 58 |
| |
61 | 59 |
| |
| |||
176 | 174 |
| |
177 | 175 |
| |
178 | 176 |
| |
179 |
| - | |
180 |
| - | |
181 | 177 |
| |
182 | 178 |
| |
183 | 179 |
| |
|
Lines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
20 |
| - | |
21 | 20 |
| |
22 | 21 |
| |
23 | 22 |
| |
|
Lines changed: 3 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
196 | 196 |
| |
197 | 197 |
| |
198 | 198 |
| |
199 |
| - | |
200 |
| - | |
201 |
| - | |
| 199 | + | |
| 200 | + | |
202 | 201 |
| |
203 |
| - | |
| 202 | + | |
204 | 203 |
| |
205 | 204 |
| |
206 | 205 |
| |
|
Lines changed: 0 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
19 |
| - | |
20 |
| - | |
21 |
| - | |
22 |
| - | |
23 |
| - | |
24 |
| - | |
25 |
| - | |
26 |
| - | |
27 |
| - | |
28 |
| - | |
29 |
| - | |
30 |
| - | |
31 | 19 |
| |
32 | 20 |
| |
33 | 21 |
| |
|
Lines changed: 36 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
328 | 328 |
| |
329 | 329 |
| |
330 | 330 |
| |
331 |
| - | |
332 |
| - | |
| 331 | + | |
| 332 | + | |
333 | 333 |
| |
334 | 334 |
| |
335 | 335 |
| |
| |||
341 | 341 |
| |
342 | 342 |
| |
343 | 343 |
| |
344 |
| - | |
345 |
| - | |
346 |
| - | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
347 | 349 |
| |
348 | 350 |
| |
349 | 351 |
| |
| |||
353 | 355 |
| |
354 | 356 |
| |
355 | 357 |
| |
356 |
| - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
357 | 387 |
| |
358 | 388 |
| |
359 | 389 |
| |
|
Lines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
20 |
| - | |
21 | 20 |
| |
22 | 21 |
| |
23 | 22 |
| |
|
0 commit comments
Comments
(0)