forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit85cb4ec
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 parent4f26932 commit85cb4ec
1 file changed
+16
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| |||
1358 | 1358 | | |
1359 | 1359 | | |
1360 | 1360 | | |
1361 | | - | |
1362 | | - | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
1363 | 1365 | | |
1364 | 1366 | | |
1365 | 1367 | | |
1366 | 1368 | | |
1367 | | - | |
1368 | 1369 | | |
1369 | | - | |
1370 | | - | |
1371 | 1370 | | |
1372 | 1371 | | |
1373 | 1372 | | |
| |||
2917 | 2916 | | |
2918 | 2917 | | |
2919 | 2918 | | |
2920 | | - | |
2921 | 2919 | | |
2922 | | - | |
2923 | | - | |
2924 | 2920 | | |
2925 | 2921 | | |
2926 | 2922 | | |
| |||
3419 | 3415 | | |
3420 | 3416 | | |
3421 | 3417 | | |
3422 | | - | |
3423 | | - | |
3424 | | - | |
3425 | | - | |
| 3418 | + | |
| 3419 | + | |
| 3420 | + | |
| 3421 | + | |
| 3422 | + | |
| 3423 | + | |
| 3424 | + | |
3426 | 3425 | | |
3427 | 3426 | | |
3428 | 3427 | | |
| |||
3437 | 3436 | | |
3438 | 3437 | | |
3439 | 3438 | | |
| 3439 | + | |
| 3440 | + | |
| 3441 | + | |
| 3442 | + | |
3440 | 3443 | | |
3441 | 3444 | | |
3442 | 3445 | | |
| |||
3467 | 3470 | | |
3468 | 3471 | | |
3469 | 3472 | | |
3470 | | - | |
3471 | 3473 | | |
3472 | 3474 | | |
3473 | 3475 | | |
| |||
0 commit comments
Comments
(0)