forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd81387d
committed
walsnd: Don't set waiting_for_ping_response spuriously
Ashutosh Bapat noticed that when logical walsender needs to wait forWAL, and it realizes that it must send a keepalive message towalreceiver to update the sent-LSN, which *does not* request a replyfrom walreceiver, it wrongly sets the flag that it's going to wait forthat reply. That means that any future would-be sender of feedbackmessages ends up not sending a feedback message, because they allbelieve that a reply is expected.With built-in logical replication there's not much harm in this, becauseWalReceiverMain will send a ping-back every wal_receiver_timeout/2anyway; but with other logical replication systems (e.g. pglogical) itcan cause significant pain.This problem was introduced in commit41d5f8a, where therequest-reply flag was changed from true to false to WalSndKeepalive,without at the same time removing the line that setswaiting_for_ping_response.Just removing that line would be a sufficient fix, but it seems betterto shift the responsibility of setting the flag to WalSndKeepaliveitself instead of requiring caller to do it; this is clearly lesserror-prone.Author: Álvaro Herrera <alvherre@alvh.no-ip.org>Reported-by: Ashutosh Bapat <ashutosh.bapat@2ndquadrant.com>Backpatch: 9.5 and upDiscussion:https://postgr.es/m/20200806225558.GA22401@alvherre.pgsql1 parent1ed7b43 commitd81387d
1 file changed
+16
-14
lines changedLines changed: 16 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
155 | 155 |
| |
156 | 156 |
| |
157 | 157 |
| |
158 |
| - | |
| 158 | + | |
159 | 159 |
| |
160 | 160 |
| |
161 | 161 |
| |
| |||
1348 | 1348 |
| |
1349 | 1349 |
| |
1350 | 1350 |
| |
1351 |
| - | |
1352 |
| - | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
1353 | 1355 |
| |
1354 | 1356 |
| |
1355 | 1357 |
| |
1356 | 1358 |
| |
1357 |
| - | |
1358 | 1359 |
| |
1359 |
| - | |
1360 |
| - | |
1361 | 1360 |
| |
1362 | 1361 |
| |
1363 | 1362 |
| |
| |||
2858 | 2857 |
| |
2859 | 2858 |
| |
2860 | 2859 |
| |
2861 |
| - | |
2862 | 2860 |
| |
2863 |
| - | |
2864 |
| - | |
2865 | 2861 |
| |
2866 | 2862 |
| |
2867 | 2863 |
| |
| |||
3357 | 3353 |
| |
3358 | 3354 |
| |
3359 | 3355 |
| |
3360 |
| - | |
3361 |
| - | |
3362 |
| - | |
3363 |
| - | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
3364 | 3363 |
| |
3365 | 3364 |
| |
3366 | 3365 |
| |
| |||
3375 | 3374 |
| |
3376 | 3375 |
| |
3377 | 3376 |
| |
| 3377 | + | |
| 3378 | + | |
| 3379 | + | |
| 3380 | + | |
3378 | 3381 |
| |
3379 | 3382 |
| |
3380 | 3383 |
| |
| |||
3405 | 3408 |
| |
3406 | 3409 |
| |
3407 | 3410 |
| |
3408 |
| - | |
3409 | 3411 |
| |
3410 | 3412 |
| |
3411 | 3413 |
| |
|
0 commit comments
Comments
(0)