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

Commit8c46f0c

Browse files
committed
Don't fsync() files when --no-sync is specified
Michael Paquier
1 parent10c064c commit8c46f0c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎src/bin/pg_basebackup/walmethods.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,9 @@ tar_sync(Walfile f)
611611
Assert(f!=NULL);
612612
tar_clear_error();
613613

614+
if (!tar_data->sync)
615+
return0;
616+
614617
/*
615618
* Always sync the whole tarfile, because that's all we can do. This makes
616619
* no sense on compressed files, so just ignore those.
@@ -842,7 +845,8 @@ tar_finish(void)
842845
#endif
843846

844847
/* sync the empty blocks as well, since they're after the last file */
845-
fsync(tar_data->fd);
848+
if (tar_data->sync)
849+
fsync(tar_data->fd);
846850

847851
if (close(tar_data->fd)!=0)
848852
return false;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp