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

Commitffc8566

Browse files
committed
[PBCKP-428] read_recovery_info don't need XRecOffIsValid(stop_lsn)
since it uses XLogFindNextRecord, it could use stop_lsn with no validoffset. In fact, it uses truncated stop_lsn with invalid offset always.Also fix getting timestamp from possible record in a future.We could not to not enter the loop since we need record->xl_prev tocorrectly walk backward. So we need to add condition beforegetRecordTimestamp.
1 parent12b8bfb commitffc8566

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

‎src/parsexlog.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -540,10 +540,6 @@ read_recovery_info(const char *archivedir, TimeLineID tli, uint32 wal_seg_size,
540540
elog(ERROR,"Invalid start_lsn value %X/%X",
541541
(uint32) (start_lsn >>32), (uint32) (start_lsn));
542542

543-
if (!XRecOffIsValid(stop_lsn))
544-
elog(ERROR,"Invalid stop_lsn value %X/%X",
545-
(uint32) (stop_lsn >>32), (uint32) (stop_lsn));
546-
547543
xlogreader=InitXLogPageRead(&reader_data,archivedir,tli,wal_seg_size,
548544
false, true, true);
549545

@@ -581,16 +577,16 @@ read_recovery_info(const char *archivedir, TimeLineID tli, uint32 wal_seg_size,
581577
(uint32) (errptr >>32), (uint32) (errptr));
582578
}
583579

584-
/* for compatibility with Pg < 13 */
585-
curpoint=InvalidXLogRecPtr;
586-
587-
if (getRecordTimestamp(xlogreader,&last_time))
580+
if (curpoint<endpoint&&getRecordTimestamp(xlogreader,&last_time))
588581
{
589582
*recovery_time=timestamptz_to_time_t(last_time);
590583

591584
/* Found timestamp in WAL record 'record' */
592585
res= true;
593586
}
587+
588+
/* for compatibility with Pg < 13 */
589+
curpoint=InvalidXLogRecPtr;
594590
}while (xlogreader->EndRecPtr<endpoint);
595591

596592
if (res)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp