Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wY1Y5-0001H5-22 for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Jun 2026 13:03:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wY1Y4-000HGl-1N for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Jun 2026 13:03:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wY1Y3-000HGb-37 for pgsql-hackers@lists.postgresql.org; Fri, 12 Jun 2026 13:03:48 +0000 Received: from mail-oo1-xc2d.google.com ([2607:f8b0:4864:20::c2d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wY1Y1-000000000lI-3fmy for pgsql-hackers@lists.postgresql.org; Fri, 12 Jun 2026 13:03:47 +0000 Received: by mail-oo1-xc2d.google.com with SMTP id 006d021491bc7-69e59978deeso391078eaf.0 for ; Fri, 12 Jun 2026 06:03:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781269425; cv=none; d=google.com; s=arc-20240605; b=OC0K1I9e9cP7gLM4gR2eM2B2r2dqAepH/pUMOICneJEKhDog/iUg2Po/+Wuxu38Gn8 MaUuqh+jCmCbu7mZ3UlP3FNOMcKOcgSvjJcT4Q5R3ZXGh7VfrW23xp6HqP+8KhNuSuf+ qoPR43HIO4f9F4YiSwSvfCl4jJCqc45Vo3jy8xJ6VDliQuLU4XVS6J8JfpYDxZLj3Dwy DRh5IOAcZEJAIBCA0JR20eVZyr21Tece2xAHjKFqUVuqGgUBqCIEwv5YDdli2UzIHWuW RnVqRqFo2ZRQNoIRkE7aNplWlWbyW0pGVRJel1wVB37CWDqiaAPgkk0UWWERGFzH4Zm+ Lbbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=LkTGqaAuMfIclXBQ+GbsPG531u/baSXD1fiZo5QQNos=; fh=8kekUnUozd65opK8U1BTNNZDzkI3nEpBzhDKh4FukdU=; b=ZY2onKe/x+XatFXRiXZ7MRUi0XVAabYOaIqy31QqfaqoeNnmCG1mgtM/kSJ5zHwpVD 4g8MHCq3+kiovbSk9YPpZYuF4/CQqkAV572+bU50lzEdwnd9lDm6iqCA4VBo2Woh9+UJ 3WpKrPV6O10kaCcnGBNzGRK/k/b/Iwhzp7g0xtJ//EerwvTEEmcHLDA539Bc0EsDdCAz RTy6YF0hRuLHwhHXyKJ1FEYhuidGudjUMlkAOJUMqe85z5OnOKUDMoaq0BURrOgZvsD9 DxHg/yJac0Io16x0lSWNQNZNATywIxQBeCOnFOeYKORPSOVWb0JdbTDM97PuTNHPKFOS 1bWw==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781269425; x=1781874225; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=LkTGqaAuMfIclXBQ+GbsPG531u/baSXD1fiZo5QQNos=; b=MNPBUK4n5RUViZsfTXIXSTs3KU/4V95o1NArDX3dOIsvstVIPCOiX2Qcb4EzMt+pWc lZTgYsLoFqsPk4ZmEgMql0YBQeU8pCYA0IHANzRr/iTy/UKqL+zaT/NtYQtt9eG3p0SK PkhaCHxfRdG57itismGGh6UpvcLTu5BLWP2+CXiFhLI7jI2SztOZ0gt/9KTE4XaMxeBJ uMsi2voK4qk2g8wqP/6MDbxlL4PWtIeTP6qP8G3macgkf1oT4O5d+hUWKYIwaKtRaE7w xLnVShMCtiDrbypnGmNCHi0pSuuEawZpqSL3PXu7hoDcpKir3nVLBLYAv/z38NQ1S22b uLNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781269425; x=1781874225; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=LkTGqaAuMfIclXBQ+GbsPG531u/baSXD1fiZo5QQNos=; b=kpHOvg4PGrcr8ojzqGLXFcxp84qRuljKSOt+niWtzYY+N834Z3HJcjQcB0DRo9m315 TKPPlT7aqNrDVu0gdwnsgNSMxEZyzUM6m2XfSnBbD+VaSmXWy8bKSHCEfvxSCciZLtws mUON2OqjPKofPSsTtW/1IIwgc6VFCIPB+gQHFSzVJUSmPtollNPX4PVH26DrvExm95EH BtjOuec9O1Nhd/aVlbOjZF1Se0pisQc9CLqb3gBdlPoPP+S99mvP2Y1/HKfxF0WIXeB/ cq/U0Gaedf3b1hPGRwTTi5FI8KhvzpPTI5anrLNs3r0+09nk9iMzN2uZ5jyq71Y65tm6 dRmA== X-Forwarded-Encrypted: i=1; AFNElJ9B9zWgLIRn5kl9NvdBPQLnzrbORuUroeGNFO3JemLIXYegr0l/Yk6owu+f+QiUTZ0PXmA8WDwNanz4OWU9@lists.postgresql.org X-Gm-Message-State: AOJu0YzV7uuat5vbiTQNO7q5/+woYgO+hW6UmnvO5Zi8Hs8FPNfhznCd Yuja5K9LS+aBi79WHIhKbDdztFv34c3/3hCaSeDva1f6FP3PwYfTs5lRoxB+4kTEuwFl7O3+/Nh swEhlzlv/Gp3PdjjhuF6dn4vZMAokFcg= X-Gm-Gg: Acq92OEACF1iMRziA3wTkdStJiMqYMkVkxHHlYxc1lWrdUt21rhtIrGiNcpymC9Pt3F 5FQUPR24tG+IXBBEgDsV7uybOw7h96qC+vCFroVKZAyDfAKLdhkXYo6N2ZPF1G+a+tkdK9LEPzu 9LkSxj32BWidzKxmEjTrT5+pVj6tW/S/szU9u8KeOipAM0rrAy65wCf2FH1A6zSjx9hHFe+a3Mu vQH0nnDDq84ly3jgKzmIfW7SnWhE9QvMbUY0Ihdu2mGid5loF81nTfbYUMPrKcTN7fATv/+4pnV ImVSurmUUxwHP+X4188= X-Received: by 2002:a05:6820:1786:b0:69d:fb2c:77ff with SMTP id 006d021491bc7-69edc6f1377mr1651529eaf.30.1781269424571; Fri, 12 Jun 2026 06:03:44 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Shlok Kyal Date: Fri, 12 Jun 2026 18:33:32 +0530 X-Gm-Features: AVVi8Ce-iGIkQVIZZh_z3FO4lpLVn4anM_ul2JidPFjINfJ3S4Fr6Dy8k8R_7_E Message-ID: Subject: Re: synchronized_standby_slots behavior inconsistent with quorum-based synchronous replication To: Ashutosh Sharma Cc: shveta malik , Amit Kapila , "Zhijie Hou (Fujitsu)" , Ajin Cherian , SATYANARAYANA NARLAPURAM , PostgreSQL-development , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 12 Jun 2026 at 15:40, Ashutosh Sharma wrote= : > > Hi Shveta, > > Thanks again for your review comments and suggestions. Please see my > comments inline below: > > On Wed, Jun 10, 2026 at 12:16=E2=80=AFPM shveta malik wrote: > > > > Please find a few comments on June8 version fo patches: > > > > 1) > > patch001: > > > > SYNC_REP_DEFAULT: do we need to give one-line comment for this > > somewhere as unlike PRIORITY and QUORUM, it is not self-explanatory. > > > > Yes, it does makes sense to include a one-line comment. I've added it > in the attached patch. > > > > > patch002: > > 2) > > It is better to avoid mentioning it as 'synchronized standby slots'. > > We can make it as 'synchronized_standby_slots' in below comments: > > > > + /* Parse the synchronized standby slots configuration */ > > > > + * Report problem states for synchronized standby slots that prevented= the > > > > Good point. I've made the suggested change in the attached patch > > > 3) > > For these error-messages too, we need to mention GUC name to give > > better clarity. > > > > + GUC_check_errmsg("number of synchronized standby slots (%d) must not > > exceed the number of unique listed slots (%d)", > > + syncrep_parse_result->num_sync, > > + syncrep_parse_result->nmembers); > > > > > > How about: > > GUC_check_errcode(ERRCODE_INVALID_PARAMETER_VALUE); > > GUC_check_errmsg("invalid value for parameter \"%s\: synchronization > > requirement (%d) exceeds the number of unique listed slots (%d)", > > "synchronized_standby_slots", > > syncrep_parse_result->num_sync, > > syncrep_parse_result->nmembers); > > > > Updated as suggested in the attached patch. > > > 3) > > + GUC_check_errmsg("number of synchronized standby slots (%d) must be > > greater than zero", > > + syncrep_parse_result->num_sync) > > > > How about: > > GUC_check_errcode(ERRCODE_INVALID_PARAMETER_VALUE); > > GUC_check_errmsg("invalid value for parameter \"%s\: required number > > of synchronized standby slots (%d) must be greater than zero", > > "synchronized_standby_slots", > > syncrep_parse_result->num_sync); > > > > > > > > Updated as suggested in the attached patch. > > > 4) > > +ReportUnavailableSyncStandbySlots(SyncStandbySlotsStateInfo * slot_sta= tes > > > > We can get rid of space before slot_states. I think pgindent might > > have put it in my patch. Sorry for the trouble. > > > > 5) > > 003: > > - wait_for_all =3D (required =3D=3D synchronized_standby_slots_config->= nslotnames); > > + wait_for_all =3D > > + (synchronized_standby_slots_config->syncrep_method =3D=3D SYNC_REP_DE= FAULT); > > > > This change can be moved to 002, right? > > Done. > > PFA patch containing all the above changes. > Hi Ashutosh, I have reviewed the patches. Here are some comments: 1. Should we update the doc for function "pg_logical_slot_get_changes". It = says: ``` If the specified slot is a logical failover slot then the function will not return until all physical slots specified in synchronized_stan= dby_slots have confirmed WAL receipt. ``` This line "return until all physical slots specified in" seems wrong after introduction of "FIRST/ANY" 2. Similarly, should we update the doc for function "pg_replication_slot_advance"? It also says: ``` If the specified slot is a logical failover slot then the function will not return until all physical slots specified in synchronized_stan= dby_slots have confirmed WAL receipt. ``` 3. Comment in syncrep_gram.y states: * syncrep_gram.y - Parser for synchronous_standby_names Since synchronosed_standby_slots is reusing this, should we update this com= ment? 4. Similarly for syncrep_scanner.l, we have comment: * syncrep_scanner.l * a lexical scanner for synchronous_standby_names Should we update it? 5. enum "SyncStandbySlotsState" and stuct "SyncStandbySlotsStateInfo" shoul= d be mentioned in typedefs.list, so that pgindent works properly. Thanks, Shlok Kyal