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

Commit88f32b7

Browse files
Avoid assuming there will be only 3 states for synchronous_commit.
Also avoid hardcoding the current default state by giving it the name"on" and replace with a meaningful name that reflects its behaviour.Coding only, no change in behaviour.
1 parent479ee1b commit88f32b7

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

‎src/backend/access/transam/xact.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ RecordTransactionCommit(void)
10561056
* if all to-be-deleted tables are temporary though, since they are lost
10571057
* anyway if we crash.)
10581058
*/
1059-
if ((wrote_xlog&&synchronous_commit >=SYNCHRONOUS_COMMIT_LOCAL)||
1059+
if ((wrote_xlog&&synchronous_commit>SYNCHRONOUS_COMMIT_OFF)||
10601060
forceSyncCommit||nrels>0)
10611061
{
10621062
/*

‎src/backend/postmaster/autovacuum.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,7 @@ AutoVacWorkerMain(int argc, char *argv[])
15311531
* if we are waiting for standbys to connect. This is important to
15321532
* ensure we aren't blocked from performing anti-wraparound tasks.
15331533
*/
1534-
if (synchronous_commit==SYNCHRONOUS_COMMIT_ON)
1534+
if (synchronous_commit>SYNCHRONOUS_COMMIT_LOCAL_FLUSH)
15351535
SetConfigOption("synchronous_commit","local",PGC_SUSET,PGC_S_OVERRIDE);
15361536

15371537
/*

‎src/backend/utils/misc/guc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ static const struct config_enum_entry constraint_exclusion_options[] = {
355355
* accept all the likely variants of "on" and "off".
356356
*/
357357
staticconststructconfig_enum_entrysynchronous_commit_options[]= {
358-
{"local",SYNCHRONOUS_COMMIT_LOCAL, false},
358+
{"local",SYNCHRONOUS_COMMIT_LOCAL_FLUSH, false},
359359
{"on",SYNCHRONOUS_COMMIT_ON, false},
360360
{"off",SYNCHRONOUS_COMMIT_OFF, false},
361361
{"true",SYNCHRONOUS_COMMIT_ON, true},

‎src/include/access/xact.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,14 @@ extern bool XactDeferrable;
5454

5555
typedefenum
5656
{
57-
SYNCHRONOUS_COMMIT_OFF,/* asynchronous commit */
58-
SYNCHRONOUS_COMMIT_LOCAL,/* wait foronlylocal flush */
59-
SYNCHRONOUS_COMMIT_ON/* wait for localflushandsync rep */
57+
SYNCHRONOUS_COMMIT_OFF,/* asynchronous commit */
58+
SYNCHRONOUS_COMMIT_LOCAL_FLUSH,/* wait for local flush only */
59+
SYNCHRONOUS_COMMIT_REMOTE_FLUSH/* wait for local andremote flush */
6060
}SyncCommitLevel;
6161

62+
/* Define the default setting for synchonous_commit */
63+
#defineSYNCHRONOUS_COMMIT_ON SYNCHRONOUS_COMMIT_REMOTE_FLUSH
64+
6265
/* Synchronous commit level */
6366
externintsynchronous_commit;
6467

‎src/include/replication/syncrep.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include"utils/guc.h"
2121

2222
#defineSyncRepRequested() \
23-
(max_wal_senders > 0 && synchronous_commit== SYNCHRONOUS_COMMIT_ON)
23+
(max_wal_senders > 0 && synchronous_commit> SYNCHRONOUS_COMMIT_LOCAL_FLUSH)
2424

2525
/* syncRepState */
2626
#defineSYNC_REP_NOT_WAITING0

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp