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

Commit93eb619

Browse files
committed
Ensure that num_sync is greater than zero in synchronous_standby_names.
Previously num_sync could be set to zero and this setting causedan assertion failure. This means that multiple synchronous standbyscode should assume that num_sync is greater than zero.Also setting num_sync to zero is nonsense because it's basicallythe configuration for synchronous replication. If users want not tomake transaction commits wait for any standbys,synchronous_standby_names should be emptied to disable synchronousreplication instead of setting num_sync to zero.This patch forbids users from setting num_sync to zero insynchronous_standby_names. If zero is specified, an error willhappen during processing the parameter settings.Back-patch to 9.6 where multiple synchronous standbys feature was added.Patch by me. Reviewed by Tom Lane.Discussion: <CAHGQGwHWB3izc6cXuFLh5kOcAbFXaRhhgwd-X5PeN9TEjxqXwg@mail.gmail.com>
1 parent23c75b5 commit93eb619

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎src/backend/replication/syncrep.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,13 @@ check_synchronous_standby_names(char **newval, void **extra, GucSource source)
924924
return false;
925925
}
926926

927+
if (syncrep_parse_result->num_sync <=0)
928+
{
929+
GUC_check_errmsg("number of synchronous standbys (%d) must be greater than zero",
930+
syncrep_parse_result->num_sync);
931+
return false;
932+
}
933+
927934
/* GUC extra value must be malloc'd, not palloc'd */
928935
pconf= (SyncRepConfigData*)
929936
malloc(syncrep_parse_result->config_size);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp