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

Commit9ebcb5f

Browse files
committed
Fix calculation related to temporary WAL segment name in basic_archive
The file name used for its temporary destination, before renaming it tothe real deal, has been using a microseconds in a timestamp aimed to beoriginally in milli-seconds. This is harmless as this is aimed at beinga safeguard against name collisions (note MyProcPid in the name), butlet's be correct with the maths.While on it, add a note in the module's makefile to document whyinstallcheck is not supported.Author: Nathan BossartReviewed-by: Bharath RupireddyDiscussion:https://postgr.es/m/20221014044106.GA1673343@nathanxps13Backpatch-through: 15
1 parentd4abb0b commit9ebcb5f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

‎contrib/basic_archive/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ PGFILEDESC = "basic_archive - basic archive module"
55

66
REGRESS = basic_archive
77
REGRESS_OPTS = --temp-config$(top_srcdir)/contrib/basic_archive/basic_archive.conf
8-
8+
# Disabled because these tests require "shared_preload_libraries=basic_archive",
9+
# which typical installcheck users do not have (e.g. buildfarm clients).
910
NO_INSTALLCHECK = 1
1011

1112
ifdefUSE_PGXS

‎contrib/basic_archive/basic_archive.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ basic_archive_file_internal(const char *file, const char *path)
221221
chartemp[MAXPGPATH+256];
222222
structstatst;
223223
structtimevaltv;
224-
uint64epoch;
224+
uint64epoch;/* milliseconds */
225225

226226
ereport(DEBUG3,
227227
(errmsg("archiving \"%s\" via basic_archive",file)));
@@ -268,7 +268,7 @@ basic_archive_file_internal(const char *file, const char *path)
268268
*/
269269
gettimeofday(&tv,NULL);
270270
if (pg_mul_u64_overflow((uint64)1000, (uint64)tv.tv_sec,&epoch)||
271-
pg_add_u64_overflow(epoch, (uint64)tv.tv_usec,&epoch))
271+
pg_add_u64_overflow(epoch, (uint64)(tv.tv_usec /1000),&epoch))
272272
elog(ERROR,"could not generate temporary file name for archiving");
273273

274274
snprintf(temp,sizeof(temp),"%s/%s.%s.%d."UINT64_FORMAT,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp