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

Commit9f1424b

Browse files
author
Michael Paquier
committed
Remove use of xlog_fname in code
Let's rely on Postgres stuff instead.Based on a patch by YUriy Zhuravlev for the backup part, updated byme for the restore part.
1 parentc5c07d8 commit9f1424b

File tree

4 files changed

+7
-15
lines changed

4 files changed

+7
-15
lines changed

‎backup.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ wait_for_archive(pgBackup *backup, const char *sql)
626626
inttry_count;
627627
XLogRecPtrlsn;
628628
TimeLineIDtli;
629+
XLogSegNotargetSegNo;
629630

630631
reconnect();
631632
res=execute(sql,0,NULL);
@@ -651,12 +652,13 @@ wait_for_archive(pgBackup *backup, const char *sql)
651652
}
652653

653654
/* As well as WAL file name */
654-
xlog_fname(file_name,tli,lsn);
655+
XLByteToSeg(lsn,targetSegNo);
656+
XLogFileName(file_name,tli,targetSegNo+1);
655657

656658
snprintf(ready_path,lengthof(ready_path),
657659
"%s/pg_xlog/archive_status/%s.ready",pgdata,
658660
file_name);
659-
elog(LOG,"%s() wait for %s",__FUNCTION__,ready_path);
661+
elog(LOG,"%s() wait for %s\n",__FUNCTION__,ready_path);
660662

661663
PQclear(res);
662664

‎pg_arman.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,6 @@ extern int pgFileCompareMtimeDesc(const void *f1, const void *f2);
287287

288288
/* in xlog.c */
289289
externboolxlog_is_complete_wal(constpgFile*file);
290-
externvoidxlog_fname(char*fname,TimeLineIDtli,XLogRecPtrlsn);
291290

292291
/* in data.c */
293292
externboolbackup_data_file(constchar*from_root,constchar*to_root,

‎restore.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,8 +772,10 @@ search_next_wal(const char *path, XLogRecPtr *need_lsn, parray *timelines)
772772
for (i=0;i<parray_num(timelines);i++)
773773
{
774774
pgTimeLine*timeline= (pgTimeLine*)parray_get(timelines,i);
775+
XLogSegNotargetSegNo;
775776

776-
xlog_fname(xlogfname,timeline->tli,*need_lsn);
777+
XLByteToSeg(*need_lsn,targetSegNo);
778+
XLogFileName(xlogfname,timeline->tli,targetSegNo);
777779
join_path_components(xlogpath,path,xlogfname);
778780

779781
if (stat(xlogpath,&st)==0)

‎xlog.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,3 @@ xlog_is_complete_wal(const pgFile *file)
6868

6969
return true;
7070
}
71-
72-
/*
73-
* based on XLogFileName() in xlog_internal.h
74-
*/
75-
void
76-
xlog_fname(char*fname,TimeLineIDtli,XLogRecPtrlsn)
77-
{
78-
snprintf(fname,MAXFNAMELEN,"%08X%08X%08X",tli,
79-
(uint32) (lsn >>32),
80-
(uint32) (lsn /XLogSegSize));
81-
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp