- Notifications
You must be signed in to change notification settings - Fork28
Commit900429d
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 parentf1c3a41 commit900429d
1 file changed
+12
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
1451 | 1451 | | |
1452 | 1452 | | |
1453 | 1453 | | |
1454 | | - | |
1455 | 1454 | | |
1456 | | - | |
1457 | | - | |
1458 | 1455 | | |
1459 | 1456 | | |
1460 | 1457 | | |
| |||
2932 | 2929 | | |
2933 | 2930 | | |
2934 | 2931 | | |
2935 | | - | |
2936 | 2932 | | |
2937 | | - | |
2938 | | - | |
2939 | 2933 | | |
2940 | 2934 | | |
2941 | 2935 | | |
| |||
3432 | 3426 | | |
3433 | 3427 | | |
3434 | 3428 | | |
3435 | | - | |
3436 | | - | |
3437 | | - | |
3438 | | - | |
| 3429 | + | |
| 3430 | + | |
| 3431 | + | |
| 3432 | + | |
| 3433 | + | |
| 3434 | + | |
| 3435 | + | |
3439 | 3436 | | |
3440 | 3437 | | |
3441 | 3438 | | |
| |||
3450 | 3447 | | |
3451 | 3448 | | |
3452 | 3449 | | |
| 3450 | + | |
| 3451 | + | |
| 3452 | + | |
| 3453 | + | |
3453 | 3454 | | |
3454 | 3455 | | |
3455 | 3456 | | |
| |||
3480 | 3481 | | |
3481 | 3482 | | |
3482 | 3483 | | |
3483 | | - | |
3484 | 3484 | | |
3485 | 3485 | | |
3486 | 3486 | | |
| |||
0 commit comments
Comments
(0)