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

Commit44e9e34

Browse files
committed
Log the correct ending timestamp in recovery_target_xid mode.
When ending recovery based on recovery_target_xid matching withrecovery_target_inclusive = off, we printed an incorrect timestamp(always 2000-01-01) in the "recovery stopping before ... transaction"log message. This is a consequence of sloppy refactoring inc945af8: the code to fetch recordXtime out of the commit/abortrecord used to be executed unconditionally, but it was changedto get called only in the RECOVERY_TARGET_TIME case. We need onlyflip the order of operations to restore the intended behavior.Per report from Torsten Förtsch. Back-patch to all supportedbranches.Discussion:https://postgr.es/m/CAKkG4_kUevPqbmyOfLajx7opAQk6Cvwkvx0HRcFjSPfRPTXanA@mail.gmail.com
1 parent438e6b7 commit44e9e34

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎src/backend/access/transam/xlogrecovery.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2548,8 +2548,13 @@ recoveryStopsBefore(XLogReaderState *record)
25482548
stopsHere= (recordXid==recoveryTargetXid);
25492549
}
25502550

2551-
if (recoveryTarget==RECOVERY_TARGET_TIME&&
2552-
getRecordTimestamp(record,&recordXtime))
2551+
/*
2552+
* Note: we must fetch recordXtime regardless of recoveryTarget setting.
2553+
* We don't expect getRecordTimestamp ever to fail, since we already know
2554+
* this is a commit or abort record; but test its result anyway.
2555+
*/
2556+
if (getRecordTimestamp(record,&recordXtime)&&
2557+
recoveryTarget==RECOVERY_TARGET_TIME)
25532558
{
25542559
/*
25552560
* There can be many transactions that share the same commit time, so

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp