summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/replication/syncrep.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/backend/replication/syncrep.c b/src/backend/replication/syncrep.c
index 525a696930b..bc341bd51f3 100644
--- a/src/backend/replication/syncrep.c
+++ b/src/backend/replication/syncrep.c
@@ -719,8 +719,15 @@ SyncRepGetSyncStandbys(bool *am_sync)
priority = next_highest_priority;
}
- /* never reached, but keep compiler quiet */
- Assert(false);
+ /*
+ * We might get here if the set of sync_standby_priority values in shared
+ * memory is inconsistent, as can happen transiently after a change in the
+ * synchronous_standby_names setting. In that case, just return the
+ * incomplete list we have so far. That will cause the caller to decide
+ * there aren't enough synchronous candidates, which should be a safe
+ * choice until the priority values become consistent again.
+ */
+ list_free(pending);
return result;
}