Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf8795d2

Browse files
committed
Fix oversight from9e149c8 with spin-lock handling
Calling an external function while a pin-lock is held is a bad idea asthose are designed to be short-lived. The stress of a first commit intoa large git history may contribute to that.Reported-by: Andres FreundDiscussion:https://postgr.es/m/20180611164952.vmxdpdpirdtkdsz6@alap3.anarazel.de
1 parent69025c5 commitf8795d2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎src/backend/replication/slot.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -999,6 +999,7 @@ ReplicationSlotReserveWal(void)
999999
while (true)
10001000
{
10011001
XLogSegNosegno;
1002+
XLogRecPtrrestart_lsn;
10021003

10031004
/*
10041005
* For logical slots log a standby snapshot and start logical decoding
@@ -1016,8 +1017,9 @@ ReplicationSlotReserveWal(void)
10161017
XLogRecPtrflushptr;
10171018

10181019
/* start at current insert position */
1020+
restart_lsn=GetXLogInsertRecPtr();
10191021
SpinLockAcquire(&slot->mutex);
1020-
slot->data.restart_lsn=GetXLogInsertRecPtr();
1022+
slot->data.restart_lsn=restart_lsn;
10211023
SpinLockRelease(&slot->mutex);
10221024

10231025
/* make sure we have enough information to start */
@@ -1028,8 +1030,9 @@ ReplicationSlotReserveWal(void)
10281030
}
10291031
else
10301032
{
1033+
restart_lsn=GetRedoRecPtr();
10311034
SpinLockAcquire(&slot->mutex);
1032-
slot->data.restart_lsn=GetRedoRecPtr();
1035+
slot->data.restart_lsn=restart_lsn;
10331036
SpinLockRelease(&slot->mutex);
10341037
}
10351038

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp