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

Commit1865fb6

Browse files
committed
Add missing ControlFile.checkPointCopy.ThisTimeLineID line for 'guess'
pg_resetxlog.Simon
1 parent0a646e8 commit1865fb6

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

‎src/bin/pg_resetxlog/pg_resetxlog.c

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ RestoreControlValues(int mode)
565565
{
566566
structtimevaltv;
567567
char*localeptr;
568-
boolsuccessed=true;
568+
boolsuccessed=true;
569569

570570
/*
571571
* Set up a completely default set of pg_control values.
@@ -579,27 +579,30 @@ RestoreControlValues(int mode)
579579
* update the checkpoint value in control file,by searching
580580
* xlog segment file, or just guessing it.
581581
*/
582-
if (mode==WAL)
583-
{
582+
if (mode==WAL)
583+
{
584584
intresult=SearchLastCheckpoint();
585-
if (result>0 )/* The last checkpoint had been found. */
585+
586+
if (result>0)/* The last checkpoint had been found. */
586587
{
587588
ControlFile.checkPointCopy=lastcheckpoint;
589+
ControlFile.checkPointCopy.ThisTimeLineID=LastXLogFile->tli;
588590
ControlFile.checkPoint=lastchkp;
589591
ControlFile.prevCheckPoint=prevchkp;
592+
590593
ControlFile.logId=LastXLogFile->logid;
591594
ControlFile.logSeg=LastXLogFile->seg+1;
592-
ControlFile.checkPointCopy.ThisTimeLineID=LastXLogFile->tli;
593595
ControlFile.state=state;
594-
}elsesuccessed= false;
596+
}
597+
else
598+
successed= false;
595599

596600
/* Clean up the list. */
597601
CleanUpList(xlogfilelist);
598-
599-
}
600-
601-
if (mode==GUESS)
602+
}
603+
else/* GUESS */
602604
{
605+
ControlFile.checkPointCopy.ThisTimeLineID=2;
603606
ControlFile.checkPointCopy.redo.xlogid=0;
604607
ControlFile.checkPointCopy.redo.xrecoff=SizeOfXLogLongPHD;
605608
ControlFile.checkPointCopy.undo=ControlFile.checkPointCopy.redo;
@@ -609,6 +612,7 @@ RestoreControlValues(int mode)
609612
ControlFile.checkPointCopy.nextMultiOffset=0;
610613
ControlFile.checkPointCopy.time=time(NULL);
611614
ControlFile.checkPoint=ControlFile.checkPointCopy.redo;
615+
612616
/*
613617
* Create a new unique installation identifier, since we can no longer
614618
* use any old XLOG records. See notes in xlog.c about the algorithm.
@@ -644,6 +648,7 @@ RestoreControlValues(int mode)
644648
exit(1);
645649
}
646650
StrNCpy(ControlFile.lc_collate,localeptr,LOCALE_NAME_BUFLEN);
651+
647652
localeptr=setlocale(LC_CTYPE,"");
648653
if (!localeptr)
649654
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp