forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb8fd4e0
committed
Adjust max_slot_wal_keep_size behavior per review
In pg_replication_slot, change output from normal/reserved/lost toreserved/extended/unreserved/ lost, which better expresses the possiblestates particularly near the time where segments are no longer safe butcheckpoint has not run yet.Under the new definition, reserved means the slot is consuming WALthat's still under the normal WAL size constraints; extended means it'sconsuming WAL that's being protected by wal_keep_segments or the slotitself, whose size is below max_slot_wal_keep_size; unreserved means theWAL is no longer safe, but checkpoint has not yet removed those files.Such as slot is in imminent danger, but can still continue for a littlewhile and may catch up to the reserved WAL space.Also, there were some bugs in the calculations used to report thestatus; fixed those.Backpatch to 13.Reported-by: Fujii Masao <masao.fujii@oss.nttdata.com>Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com>Reviewed-by: Fujii Masao <masao.fujii@oss.nttdata.com>Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org>Discussion:https://postgr.es/m/20200616.120236.1809496990963386593.horikyota.ntt@gmail.com1 parent0188bb8 commitb8fd4e0
File tree
5 files changed
+96
-53
lines changed- doc/src/sgml
- src
- backend
- access/transam
- replication
- include/access
- test/recovery/t
5 files changed
+96
-53
lines changedLines changed: 17 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11239 | 11239 |
| |
11240 | 11240 |
| |
11241 | 11241 |
| |
11242 |
| - | |
| 11242 | + | |
11243 | 11243 |
| |
11244 | 11244 |
| |
11245 | 11245 |
| |
11246 |
| - | |
| 11246 | + | |
11247 | 11247 |
| |
11248 |
| - | |
11249 |
| - | |
| 11248 | + | |
| 11249 | + | |
| 11250 | + | |
11250 | 11251 |
| |
11251 | 11252 |
| |
11252 |
| - | |
11253 |
| - | |
11254 |
| - | |
| 11253 | + | |
| 11254 | + | |
| 11255 | + | |
| 11256 | + | |
| 11257 | + | |
| 11258 | + | |
| 11259 | + | |
| 11260 | + | |
| 11261 | + | |
| 11262 | + | |
| 11263 | + | |
| 11264 | + | |
11255 | 11265 |
| |
11256 | 11266 |
| |
11257 | 11267 |
| |
|
Lines changed: 31 additions & 26 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9488 | 9488 |
| |
9489 | 9489 |
| |
9490 | 9490 |
| |
9491 |
| - | |
9492 |
| - | |
9493 | 9491 |
| |
9494 |
| - | |
| 9492 | + | |
| 9493 | + | |
| 9494 | + | |
| 9495 | + | |
9495 | 9496 |
| |
9496 | 9497 |
| |
9497 | 9498 |
| |
9498 |
| - | |
9499 |
| - | |
| 9499 | + | |
| 9500 | + | |
| 9501 | + | |
| 9502 | + | |
| 9503 | + | |
| 9504 | + | |
9500 | 9505 |
| |
9501 | 9506 |
| |
9502 | 9507 |
| |
| |||
9512 | 9517 |
| |
9513 | 9518 |
| |
9514 | 9519 |
| |
9515 |
| - | |
| 9520 | + | |
| 9521 | + | |
| 9522 | + | |
9516 | 9523 |
| |
9517 | 9524 |
| |
9518 | 9525 |
| |
9519 | 9526 |
| |
9520 | 9527 |
| |
9521 |
| - | |
| 9528 | + | |
| 9529 | + | |
| 9530 | + | |
| 9531 | + | |
9522 | 9532 |
| |
9523 | 9533 |
| |
9524 | 9534 |
| |
| |||
9529 | 9539 |
| |
9530 | 9540 |
| |
9531 | 9541 |
| |
9532 |
| - | |
| 9542 | + | |
9533 | 9543 |
| |
9534 |
| - | |
9535 |
| - | |
| 9544 | + | |
9536 | 9545 |
| |
9537 | 9546 |
| |
9538 | 9547 |
| |
9539 | 9548 |
| |
9540 | 9549 |
| |
9541 | 9550 |
| |
9542 | 9551 |
| |
9543 |
| - | |
9544 |
| - | |
9545 |
| - | |
9546 |
| - | |
| 9552 | + | |
| 9553 | + | |
9547 | 9554 |
| |
9548 |
| - | |
| 9555 | + | |
9549 | 9556 |
| |
9550 |
| - | |
9551 |
| - | |
9552 |
| - | |
9553 |
| - | |
9554 |
| - | |
9555 |
| - | |
9556 |
| - | |
9557 |
| - | |
9558 |
| - | |
9559 |
| - | |
9560 |
| - | |
| 9557 | + | |
| 9558 | + | |
9561 | 9559 |
| |
| 9560 | + | |
| 9561 | + | |
| 9562 | + | |
9562 | 9563 |
| |
9563 | 9564 |
| |
| 9565 | + | |
| 9566 | + | |
| 9567 | + | |
| 9568 | + | |
9564 | 9569 |
| |
9565 | 9570 |
| |
9566 | 9571 |
| |
|
Lines changed: 31 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
359 | 359 |
| |
360 | 360 |
| |
361 | 361 |
| |
362 |
| - | |
363 |
| - | |
364 |
| - | |
365 |
| - | |
366 | 362 |
| |
367 | 363 |
| |
368 | 364 |
| |
369 | 365 |
| |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
370 | 374 |
| |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
371 | 397 |
| |
372 | 398 |
| |
373 |
| - | |
374 |
| - | |
375 |
| - | |
376 | 399 |
| |
377 | 400 |
| |
378 | 401 |
| |
379 |
| - | |
| 402 | + | |
380 | 403 |
| |
381 | 404 |
| |
382 | 405 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
270 | 270 |
| |
271 | 271 |
| |
272 | 272 |
| |
273 |
| - | |
274 |
| - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
275 | 277 |
| |
276 | 278 |
| |
277 | 279 |
| |
|
Lines changed: 13 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
56 | 56 |
| |
57 | 57 |
| |
58 | 58 |
| |
59 |
| - | |
| 59 | + | |
60 | 60 |
| |
61 | 61 |
| |
62 | 62 |
| |
| |||
66 | 66 |
| |
67 | 67 |
| |
68 | 68 |
| |
69 |
| - | |
| 69 | + | |
| 70 | + | |
70 | 71 |
| |
71 | 72 |
| |
72 | 73 |
| |
| |||
75 | 76 |
| |
76 | 77 |
| |
77 | 78 |
| |
78 |
| - | |
| 79 | + | |
79 | 80 |
| |
80 | 81 |
| |
81 | 82 |
| |
| |||
99 | 100 |
| |
100 | 101 |
| |
101 | 102 |
| |
102 |
| - | |
| 103 | + | |
103 | 104 |
| |
104 | 105 |
| |
105 | 106 |
| |
| |||
108 | 109 |
| |
109 | 110 |
| |
110 | 111 |
| |
111 |
| - | |
| 112 | + | |
112 | 113 |
| |
113 | 114 |
| |
114 | 115 |
| |
| |||
125 | 126 |
| |
126 | 127 |
| |
127 | 128 |
| |
128 |
| - | |
| 129 | + | |
129 | 130 |
| |
130 | 131 |
| |
131 | 132 |
| |
| |||
143 | 144 |
| |
144 | 145 |
| |
145 | 146 |
| |
146 |
| - | |
| 147 | + | |
147 | 148 |
| |
148 | 149 |
| |
149 | 150 |
| |
150 | 151 |
| |
151 | 152 |
| |
152 | 153 |
| |
153 | 154 |
| |
154 |
| - | |
| 155 | + | |
155 | 156 |
| |
156 | 157 |
| |
157 | 158 |
| |
158 |
| - | |
| 159 | + | |
| 160 | + | |
159 | 161 |
| |
160 | 162 |
| |
161 | 163 |
| |
| |||
186 | 188 |
| |
187 | 189 |
| |
188 | 190 |
| |
189 |
| - | |
| 191 | + | |
| 192 | + | |
190 | 193 |
| |
191 | 194 |
| |
192 | 195 |
| |
|
0 commit comments
Comments
(0)