mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-29 22:49:41 +03:00 
			
		
		
		
	Revert initdb --sync-only patch that had incorrect commit messages.
This commit is contained in:
		| @@ -150,12 +150,6 @@ main(int argc, char **argv) | |||||||
| 			  new_cluster.pgdata); | 			  new_cluster.pgdata); | ||||||
| 	check_ok(); | 	check_ok(); | ||||||
|  |  | ||||||
| 	prep_status("Sync data directory to disk"); |  | ||||||
| 	exec_prog(UTILITY_LOG_FILE, NULL, true, |  | ||||||
| 			  "\"%s/initdb\" --sync-only \"%s\"", new_cluster.bindir, |  | ||||||
| 			  new_cluster.pgdata); |  | ||||||
| 	check_ok(); |  | ||||||
|  |  | ||||||
| 	create_script_for_cluster_analyze(&analyze_script_file_name); | 	create_script_for_cluster_analyze(&analyze_script_file_name); | ||||||
| 	create_script_for_old_cluster_deletion(&deletion_script_file_name); | 	create_script_for_old_cluster_deletion(&deletion_script_file_name); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -209,10 +209,9 @@ start_postmaster(ClusterInfo *cluster) | |||||||
| 	 * a gap of 2000000000 from the current xid counter, so autovacuum will | 	 * a gap of 2000000000 from the current xid counter, so autovacuum will | ||||||
| 	 * not touch them. | 	 * not touch them. | ||||||
| 	 * | 	 * | ||||||
| 	 * Turn off durability requirements to improve object creation speed, and | 	 *	synchronous_commit=off improves object creation speed, and we only | ||||||
| 	 * we only modify the new cluster, so only use it there.  If there is a | 	 *	modify the new cluster, so only use it there.  If there is a crash, | ||||||
| 	 * crash, the new cluster has to be recreated anyway.  fsync=off is a big | 	 *	the new cluster has to be recreated anyway. | ||||||
| 	 * win on ext4. |  | ||||||
| 	 */ | 	 */ | ||||||
| 	snprintf(cmd, sizeof(cmd), | 	snprintf(cmd, sizeof(cmd), | ||||||
| 			 "\"%s/pg_ctl\" -w -l \"%s\" -D \"%s\" -o \"-p %d%s%s%s%s\" start", | 			 "\"%s/pg_ctl\" -w -l \"%s\" -D \"%s\" -o \"-p %d%s%s%s%s\" start", | ||||||
| @@ -220,8 +219,7 @@ start_postmaster(ClusterInfo *cluster) | |||||||
| 			 (cluster->controldata.cat_ver >= | 			 (cluster->controldata.cat_ver >= | ||||||
| 			  BINARY_UPGRADE_SERVER_FLAG_CAT_VER) ? " -b" : | 			  BINARY_UPGRADE_SERVER_FLAG_CAT_VER) ? " -b" : | ||||||
| 			 " -c autovacuum=off -c autovacuum_freeze_max_age=2000000000", | 			 " -c autovacuum=off -c autovacuum_freeze_max_age=2000000000", | ||||||
| 			 (cluster == &new_cluster) ? | 			 (cluster == &new_cluster) ? " -c synchronous_commit=off" : "", | ||||||
| 				" -c synchronous_commit=off -c fsync=off -c full_page_writes=off" : "", |  | ||||||
| 			 cluster->pgopts ? cluster->pgopts : "", socket_string); | 			 cluster->pgopts ? cluster->pgopts : "", socket_string); | ||||||
|  |  | ||||||
| 	/* | 	/* | ||||||
|   | |||||||
| @@ -1696,15 +1696,6 @@ include 'filename' | |||||||
|         turning off <varname>fsync</varname>. |         turning off <varname>fsync</varname>. | ||||||
|        </para> |        </para> | ||||||
|  |  | ||||||
|        <para> |  | ||||||
|         For reliable recovery when changing <varname>fsync</varname> |  | ||||||
|         off to on, it is necessary to force all modified buffers in the |  | ||||||
|         kernel to durable storage.  This can be done while the cluster |  | ||||||
|         is shutdown or while fsync is on by running <command>initdb |  | ||||||
|         --sync-only</command>, running <command>sync</>, unmounting the |  | ||||||
|         file system, or rebooting the server. |  | ||||||
|        </para> |  | ||||||
|  |  | ||||||
|        <para> |        <para> | ||||||
|         In many situations, turning off <xref linkend="guc-synchronous-commit"> |         In many situations, turning off <xref linkend="guc-synchronous-commit"> | ||||||
|         for noncritical transactions can provide much of the potential |         for noncritical transactions can provide much of the potential | ||||||
|   | |||||||
| @@ -244,17 +244,6 @@ PostgreSQL documentation | |||||||
|       </listitem> |       </listitem> | ||||||
|      </varlistentry> |      </varlistentry> | ||||||
|  |  | ||||||
|      <varlistentry> |  | ||||||
|       <term><option>-S</option></term> |  | ||||||
|       <term><option>--sync-only</option></term> |  | ||||||
|       <listitem> |  | ||||||
|        <para> |  | ||||||
|         Safely write all database files to disk and exit.  This does not |  | ||||||
|         perform any of the normal <application>initdb</> operations. |  | ||||||
|        </para> |  | ||||||
|       </listitem> |  | ||||||
|      </varlistentry> |  | ||||||
|  |  | ||||||
|      <varlistentry> |      <varlistentry> | ||||||
|       <term><option>-T <replaceable>CFG</></option></term> |       <term><option>-T <replaceable>CFG</></option></term> | ||||||
|       <term><option>--text-search-config=<replaceable>CFG</></option></term> |       <term><option>--text-search-config=<replaceable>CFG</></option></term> | ||||||
|   | |||||||
| @@ -118,7 +118,6 @@ static const char *authmethodlocal = ""; | |||||||
| static bool debug = false; | static bool debug = false; | ||||||
| static bool noclean = false; | static bool noclean = false; | ||||||
| static bool do_sync = true; | static bool do_sync = true; | ||||||
| static bool sync_only = false; |  | ||||||
| static bool show_setting = false; | static bool show_setting = false; | ||||||
| static char *xlog_dir = ""; | static char *xlog_dir = ""; | ||||||
|  |  | ||||||
| @@ -2797,7 +2796,6 @@ usage(const char *progname) | |||||||
| 	printf(_("  -n, --noclean             do not clean up after errors\n")); | 	printf(_("  -n, --noclean             do not clean up after errors\n")); | ||||||
| 	printf(_("  -N, --nosync              do not wait for changes to be written safely to disk\n")); | 	printf(_("  -N, --nosync              do not wait for changes to be written safely to disk\n")); | ||||||
| 	printf(_("  -s, --show                show internal settings\n")); | 	printf(_("  -s, --show                show internal settings\n")); | ||||||
| 	printf(_("  -S, --sync-only           only sync data directory\n")); |  | ||||||
| 	printf(_("\nOther options:\n")); | 	printf(_("\nOther options:\n")); | ||||||
| 	printf(_("  -V, --version             output version information, then exit\n")); | 	printf(_("  -V, --version             output version information, then exit\n")); | ||||||
| 	printf(_("  -?, --help                show this help, then exit\n")); | 	printf(_("  -?, --help                show this help, then exit\n")); | ||||||
| @@ -3447,7 +3445,6 @@ main(int argc, char *argv[]) | |||||||
| 		{"show", no_argument, NULL, 's'}, | 		{"show", no_argument, NULL, 's'}, | ||||||
| 		{"noclean", no_argument, NULL, 'n'}, | 		{"noclean", no_argument, NULL, 'n'}, | ||||||
| 		{"nosync", no_argument, NULL, 'N'}, | 		{"nosync", no_argument, NULL, 'N'}, | ||||||
| 		{"sync-only", no_argument, NULL, 'S'}, |  | ||||||
| 		{"xlogdir", required_argument, NULL, 'X'}, | 		{"xlogdir", required_argument, NULL, 'X'}, | ||||||
| 		{NULL, 0, NULL, 0} | 		{NULL, 0, NULL, 0} | ||||||
| 	}; | 	}; | ||||||
| @@ -3479,7 +3476,7 @@ main(int argc, char *argv[]) | |||||||
|  |  | ||||||
| 	/* process command-line options */ | 	/* process command-line options */ | ||||||
|  |  | ||||||
| 	while ((c = getopt_long(argc, argv, "dD:E:L:nNU:WA:sST:X:", long_options, &option_index)) != -1) | 	while ((c = getopt_long(argc, argv, "dD:E:L:nNU:WA:sT:X:", long_options, &option_index)) != -1) | ||||||
| 	{ | 	{ | ||||||
| 		switch (c) | 		switch (c) | ||||||
| 		{ | 		{ | ||||||
| @@ -3525,9 +3522,6 @@ main(int argc, char *argv[]) | |||||||
| 			case 'N': | 			case 'N': | ||||||
| 				do_sync = false; | 				do_sync = false; | ||||||
| 				break; | 				break; | ||||||
| 			case 'S': |  | ||||||
| 				sync_only = true; |  | ||||||
| 				break; |  | ||||||
| 			case 'L': | 			case 'L': | ||||||
| 				share_path = pg_strdup(optarg); | 				share_path = pg_strdup(optarg); | ||||||
| 				break; | 				break; | ||||||
| @@ -3595,14 +3589,6 @@ main(int argc, char *argv[]) | |||||||
| 		exit(1); | 		exit(1); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	/* If we only need to fsync, just to it and exit */ |  | ||||||
| 	if (sync_only) |  | ||||||
| 	{ |  | ||||||
| 		setup_pgdata(); |  | ||||||
| 		perform_fsync(); |  | ||||||
| 		return 0; |  | ||||||
| 	} |  | ||||||
| 	 |  | ||||||
| 	if (pwprompt && pwfilename) | 	if (pwprompt && pwfilename) | ||||||
| 	{ | 	{ | ||||||
| 		fprintf(stderr, _("%s: password prompt and password file cannot be specified together\n"), progname); | 		fprintf(stderr, _("%s: password prompt and password file cannot be specified together\n"), progname); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user