From 17d5db352c1780f4721664f67bc3a3f3b1cf933c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 30 Apr 2016 10:54:45 -0400 Subject: Remove warning about num_sync being too large in synchronous_standby_names. If we're not going to reject such setups entirely, throwing a WARNING in check_synchronous_standby_names() is unhelpful, because it will cause the warning to be logged again every time the postmaster receives SIGHUP. Per discussion, just remove the warning. In passing, improve the documentation for synchronous_commit, which had not gotten the word that now there can be more than one synchronous standby. --- src/backend/replication/syncrep.c | 45 --------------------------------------- 1 file changed, 45 deletions(-) (limited to 'src') diff --git a/src/backend/replication/syncrep.c b/src/backend/replication/syncrep.c index acdbf1e230c..959ca78a1ef 100644 --- a/src/backend/replication/syncrep.c +++ b/src/backend/replication/syncrep.c @@ -929,51 +929,6 @@ check_synchronous_standby_names(char **newval, void **extra, GucSource source) return false; } - /* - * Warn if num_sync exceeds the number of names of potential sync - * standbys. This setting doesn't make sense in most cases because it - * implies that enough number of sync standbys will not appear, which - * makes transaction commits wait for sync replication infinitely. - * - * If there are more than one standbys having the same name and - * priority, we can see enough sync standbys to complete transaction - * commits. However it's not recommended to run multiple standbys with - * the same priority because we cannot gain full control of the - * selection of sync standbys from them. - * - * OTOH, that setting is OK if we understand the above problem - * regarding the selection of sync standbys and intentionally specify * - * to match all the standbys. - */ - if (syncrep_parse_result->num_sync > syncrep_parse_result->nmembers) - { - const char *standby_name; - int i; - bool has_asterisk = false; - - standby_name = syncrep_parse_result->member_names; - for (i = 1; i <= syncrep_parse_result->nmembers; i++) - { - if (strcmp(standby_name, "*") == 0) - { - has_asterisk = true; - break; - } - standby_name += strlen(standby_name) + 1; - } - - /* - * Only the postmaster warns about this inappropriate setting to - * avoid cluttering the log. - */ - if (!has_asterisk && !IsUnderPostmaster) - ereport(WARNING, - (errmsg("configured number of synchronous standbys (%d) exceeds the number of names of potential synchronous ones (%d)", - syncrep_parse_result->num_sync, - syncrep_parse_result->nmembers), - errhint("Specify more names of potential synchronous standbys in synchronous_standby_names."))); - } - /* GUC extra value must be malloc'd, not palloc'd */ pconf = (SyncRepConfigData *) malloc(syncrep_parse_result->config_size); -- cgit v1.2.3