diff options
Diffstat (limited to 'src/backend/replication/logical/logical.c')
-rw-r--r-- | src/backend/replication/logical/logical.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/replication/logical/logical.c b/src/backend/replication/logical/logical.c index 48ae02ca386..a53d42e88a6 100644 --- a/src/backend/replication/logical/logical.c +++ b/src/backend/replication/logical/logical.c @@ -1680,6 +1680,7 @@ LogicalIncreaseRestartDecodingForSlot(XLogRecPtr current_lsn, XLogRecPtr restart /* don't overwrite if have a newer restart lsn */ if (restart_lsn <= slot->data.restart_lsn) { + SpinLockRelease(&slot->mutex); } /* @@ -1690,6 +1691,7 @@ LogicalIncreaseRestartDecodingForSlot(XLogRecPtr current_lsn, XLogRecPtr restart { slot->candidate_restart_valid = current_lsn; slot->candidate_restart_lsn = restart_lsn; + SpinLockRelease(&slot->mutex); /* our candidate can directly be used */ updated_lsn = true; @@ -1700,7 +1702,7 @@ LogicalIncreaseRestartDecodingForSlot(XLogRecPtr current_lsn, XLogRecPtr restart * might never end up updating if the receiver acks too slowly. A missed * value here will just cause some extra effort after reconnecting. */ - if (slot->candidate_restart_valid == InvalidXLogRecPtr) + else if (slot->candidate_restart_valid == InvalidXLogRecPtr) { slot->candidate_restart_valid = current_lsn; slot->candidate_restart_lsn = restart_lsn; |