mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Merge synchronous_replication setting into synchronous_commit.
This means one less thing to configure when setting up synchronous replication, and also avoids some ambiguity around what the behavior should be when the settings of these variables conflict. Fujii Masao, with additional hacking by me.
This commit is contained in:
@ -350,6 +350,23 @@ static const struct config_enum_entry constraint_exclusion_options[] = {
|
||||
{NULL, 0, false}
|
||||
};
|
||||
|
||||
/*
|
||||
* Although only "on", "off", and "local" are documented, we
|
||||
* accept all the likely variants of "on" and "off".
|
||||
*/
|
||||
static const struct config_enum_entry synchronous_commit_options[] = {
|
||||
{"local", SYNCHRONOUS_COMMIT_LOCAL, false},
|
||||
{"on", SYNCHRONOUS_COMMIT_ON, false},
|
||||
{"off", SYNCHRONOUS_COMMIT_OFF, false},
|
||||
{"true", SYNCHRONOUS_COMMIT_ON, true},
|
||||
{"false", SYNCHRONOUS_COMMIT_OFF, true},
|
||||
{"yes", SYNCHRONOUS_COMMIT_ON, true},
|
||||
{"no", SYNCHRONOUS_COMMIT_OFF, true},
|
||||
{"1", SYNCHRONOUS_COMMIT_ON, true},
|
||||
{"0", SYNCHRONOUS_COMMIT_OFF, true},
|
||||
{NULL, 0, false}
|
||||
};
|
||||
|
||||
/*
|
||||
* Options for enum values stored in other modules
|
||||
*/
|
||||
@ -746,22 +763,6 @@ static struct config_bool ConfigureNamesBool[] =
|
||||
&enableFsync,
|
||||
true, NULL, NULL
|
||||
},
|
||||
{
|
||||
{"synchronous_commit", PGC_USERSET, WAL_SETTINGS,
|
||||
gettext_noop("Sets immediate fsync at commit."),
|
||||
NULL
|
||||
},
|
||||
&XactSyncCommit,
|
||||
true, NULL, NULL
|
||||
},
|
||||
{
|
||||
{"synchronous_replication", PGC_USERSET, WAL_REPLICATION,
|
||||
gettext_noop("Requests synchronous replication."),
|
||||
NULL
|
||||
},
|
||||
&synchronous_replication,
|
||||
false, NULL, NULL
|
||||
},
|
||||
{
|
||||
{"zero_damaged_pages", PGC_SUSET, DEVELOPER_OPTIONS,
|
||||
gettext_noop("Continues processing past damaged page headers."),
|
||||
@ -2908,6 +2909,16 @@ static struct config_enum ConfigureNamesEnum[] =
|
||||
assign_session_replication_role, NULL
|
||||
},
|
||||
|
||||
{
|
||||
{"synchronous_commit", PGC_USERSET, WAL_SETTINGS,
|
||||
gettext_noop("Sets the current transaction's synchronization level."),
|
||||
NULL
|
||||
},
|
||||
&synchronous_commit,
|
||||
SYNCHRONOUS_COMMIT_ON, synchronous_commit_options,
|
||||
NULL, NULL
|
||||
},
|
||||
|
||||
{
|
||||
{"trace_recovery_messages", PGC_SIGHUP, DEVELOPER_OPTIONS,
|
||||
gettext_noop("Enables logging of recovery-related debugging information."),
|
||||
|
Reference in New Issue
Block a user