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

Commit25d1ed0

Browse files
committed
Revert initdb --sync-only patch that had incorrect commit messages.
1 parent4d88bc8 commit25d1ed0

File tree

5 files changed

+5
-47
lines changed

5 files changed

+5
-47
lines changed

‎contrib/pg_upgrade/pg_upgrade.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,6 @@ main(int argc, char **argv)
150150
new_cluster.pgdata);
151151
check_ok();
152152

153-
prep_status("Sync data directory to disk");
154-
exec_prog(UTILITY_LOG_FILE,NULL, true,
155-
"\"%s/initdb\" --sync-only \"%s\"",new_cluster.bindir,
156-
new_cluster.pgdata);
157-
check_ok();
158-
159153
create_script_for_cluster_analyze(&analyze_script_file_name);
160154
create_script_for_old_cluster_deletion(&deletion_script_file_name);
161155

‎contrib/pg_upgrade/server.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,19 +209,17 @@ start_postmaster(ClusterInfo *cluster)
209209
* a gap of 2000000000 from the current xid counter, so autovacuum will
210210
* not touch them.
211211
*
212-
* Turn off durability requirements to improve object creation speed, and
213-
* we only modify the new cluster, so only use it there. If there is a
214-
* crash, the new cluster has to be recreated anyway. fsync=off is a big
215-
* win on ext4.
212+
*synchronous_commit=off improves object creation speed, and we only
213+
*modify the new cluster, so only use it there. If there is a crash,
214+
*the new cluster has to be recreated anyway.
216215
*/
217216
snprintf(cmd,sizeof(cmd),
218217
"\"%s/pg_ctl\" -w -l \"%s\" -D \"%s\" -o \"-p %d%s%s%s%s\" start",
219218
cluster->bindir,SERVER_LOG_FILE,cluster->pgconfig,cluster->port,
220219
(cluster->controldata.cat_ver >=
221220
BINARY_UPGRADE_SERVER_FLAG_CAT_VER) ?" -b" :
222221
" -c autovacuum=off -c autovacuum_freeze_max_age=2000000000",
223-
(cluster==&new_cluster) ?
224-
" -c synchronous_commit=off -c fsync=off -c full_page_writes=off" :"",
222+
(cluster==&new_cluster) ?" -c synchronous_commit=off" :"",
225223
cluster->pgopts ?cluster->pgopts :"",socket_string);
226224

227225
/*

‎doc/src/sgml/config.sgml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1696,15 +1696,6 @@ include 'filename'
16961696
turning off <varname>fsync</varname>.
16971697
</para>
16981698

1699-
<para>
1700-
For reliable recovery when changing <varname>fsync</varname>
1701-
off to on, it is necessary to force all modified buffers in the
1702-
kernel to durable storage. This can be done while the cluster
1703-
is shutdown or while fsync is on by running <command>initdb
1704-
--sync-only</command>, running <command>sync</>, unmounting the
1705-
file system, or rebooting the server.
1706-
</para>
1707-
17081699
<para>
17091700
In many situations, turning off <xref linkend="guc-synchronous-commit">
17101701
for noncritical transactions can provide much of the potential

‎doc/src/sgml/ref/initdb.sgml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -244,17 +244,6 @@ PostgreSQL documentation
244244
</listitem>
245245
</varlistentry>
246246

247-
<varlistentry>
248-
<term><option>-S</option></term>
249-
<term><option>--sync-only</option></term>
250-
<listitem>
251-
<para>
252-
Safely write all database files to disk and exit. This does not
253-
perform any of the normal <application>initdb</> operations.
254-
</para>
255-
</listitem>
256-
</varlistentry>
257-
258247
<varlistentry>
259248
<term><option>-T <replaceable>CFG</></option></term>
260249
<term><option>--text-search-config=<replaceable>CFG</></option></term>

‎src/bin/initdb/initdb.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ static const char *authmethodlocal = "";
118118
staticbooldebug= false;
119119
staticboolnoclean= false;
120120
staticbooldo_sync= true;
121-
staticboolsync_only= false;
122121
staticboolshow_setting= false;
123122
staticchar*xlog_dir="";
124123

@@ -2797,7 +2796,6 @@ usage(const char *progname)
27972796
printf(_(" -n, --noclean do not clean up after errors\n"));
27982797
printf(_(" -N, --nosync do not wait for changes to be written safely to disk\n"));
27992798
printf(_(" -s, --show show internal settings\n"));
2800-
printf(_(" -S, --sync-only only sync data directory\n"));
28012799
printf(_("\nOther options:\n"));
28022800
printf(_(" -V, --version output version information, then exit\n"));
28032801
printf(_(" -?, --help show this help, then exit\n"));
@@ -3447,7 +3445,6 @@ main(int argc, char *argv[])
34473445
{"show",no_argument,NULL,'s'},
34483446
{"noclean",no_argument,NULL,'n'},
34493447
{"nosync",no_argument,NULL,'N'},
3450-
{"sync-only",no_argument,NULL,'S'},
34513448
{"xlogdir",required_argument,NULL,'X'},
34523449
{NULL,0,NULL,0}
34533450
};
@@ -3479,7 +3476,7 @@ main(int argc, char *argv[])
34793476

34803477
/* process command-line options */
34813478

3482-
while ((c=getopt_long(argc,argv,"dD:E:L:nNU:WA:sST:X:",long_options,&option_index))!=-1)
3479+
while ((c=getopt_long(argc,argv,"dD:E:L:nNU:WA:sT:X:",long_options,&option_index))!=-1)
34833480
{
34843481
switch (c)
34853482
{
@@ -3525,9 +3522,6 @@ main(int argc, char *argv[])
35253522
case'N':
35263523
do_sync= false;
35273524
break;
3528-
case'S':
3529-
sync_only= true;
3530-
break;
35313525
case'L':
35323526
share_path=pg_strdup(optarg);
35333527
break;
@@ -3595,14 +3589,6 @@ main(int argc, char *argv[])
35953589
exit(1);
35963590
}
35973591

3598-
/* If we only need to fsync, just to it and exit */
3599-
if (sync_only)
3600-
{
3601-
setup_pgdata();
3602-
perform_fsync();
3603-
return0;
3604-
}
3605-
36063592
if (pwprompt&&pwfilename)
36073593
{
36083594
fprintf(stderr,_("%s: password prompt and password file cannot be specified together\n"),progname);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp