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

Commitcd12323

Browse files
committed
Fix single-record reads to use restore_command if available in pg_rewind
readOneRecord() is used now when looking for a checkpoint record tocheck if the target server is an ancestor of the source across multipletimelines, and using a restore_command if available improves thestability of the operation. This part was missed ina7e8ece.Reported-by: Kyotaro HoriguchiDiscussion:https://postgr.es/m/20200421.150830.1410714948345179794.horikyota.ntt@gmail.com
1 parentc33869c commitcd12323

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

‎src/bin/pg_rewind/parsexlog.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ extractPageMap(const char *datadir, XLogRecPtr startpoint, int tliIndex,
106106
* doing anything with the record itself.
107107
*/
108108
XLogRecPtr
109-
readOneRecord(constchar*datadir,XLogRecPtrptr,inttliIndex)
109+
readOneRecord(constchar*datadir,XLogRecPtrptr,inttliIndex,
110+
constchar*restoreCommand)
110111
{
111112
XLogRecord*record;
112113
XLogReaderState*xlogreader;
@@ -115,6 +116,7 @@ readOneRecord(const char *datadir, XLogRecPtr ptr, int tliIndex)
115116
XLogRecPtrendptr;
116117

117118
private.tliIndex=tliIndex;
119+
private.restoreCommand=restoreCommand;
118120
xlogreader=XLogReaderAllocate(WalSegSz,datadir,&SimpleXLogPageRead,
119121
&private);
120122
if (xlogreader==NULL)

‎src/bin/pg_rewind/pg_rewind.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ main(int argc, char **argv)
339339
/* Read the checkpoint record on the target to see where it ends. */
340340
chkptendrec=readOneRecord(datadir_target,
341341
ControlFile_target.checkPoint,
342-
targetNentries-1);
342+
targetNentries-1,
343+
restore_command);
343344

344345
/*
345346
* If the histories diverged exactly at the end of the shutdown

‎src/bin/pg_rewind/pg_rewind.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ extern void findLastCheckpoint(const char *datadir, XLogRecPtr searchptr,
5050
XLogRecPtr*lastchkptredo,
5151
constchar*restoreCommand);
5252
externXLogRecPtrreadOneRecord(constchar*datadir,XLogRecPtrptr,
53-
inttliIndex);
53+
inttliIndex,constchar*restoreCommand);
5454

5555
/* in pg_rewind.c */
5656
externvoidprogress_report(boolforce);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp