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.94.2) (envelope-from ) id 1qW7Lo-002BXU-Ij for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Aug 2023 03:37:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qW7Ln-002OYV-7m for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Aug 2023 03:37:39 +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.94.2) (envelope-from ) id 1qW7Ll-002OWl-P2 for pgsql-hackers@lists.postgresql.org; Wed, 16 Aug 2023 03:37:39 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qW7Le-000NGk-0e for pgsql-hackers@lists.postgresql.org; Wed, 16 Aug 2023 03:37:36 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 748E45C022B; Tue, 15 Aug 2023 23:37:28 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 15 Aug 2023 23:37:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1692157048; x=1692243448; bh=n5 R/VPE5XHwfdum7YfWdamWfsf5uke4fJuzURJQlXvY=; b=Wg29D+l+Ye1RpFEe1F fZopGFhMH6f2y7H8eOkBDdM5RDadGELSbW/9HmmE8QmVqNLwUwiIS2iAaO4EW6Ii wW6fLeQgbDvI/fe0SDudb2KslUE5olkgejPYdKBNNgmEF0HRUUxEXiax1BEhc2+S ALcc9D6jDUW0w5ixuPvzLgALxJBerwHpgl+l6phJbzEIokZ0m/HmWKAo7Yr8nxsc /QzHOI3IDzyrPKGwVUnkP5+RQudqAGHr8pGuZFHAEiwjF4sPARjuW5SmlKz0RUek iv7Iqh+pwmIYptWEuzEUg6BzZqXq780ffx4WLVRTU64fKoBke3B7+GG7RzT1supt KpZQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1692157048; x=1692243448; bh=n5R/VPE5XHwfd um7YfWdamWfsf5uke4fJuzURJQlXvY=; b=nElQ9kwlsBWtiKiHlT6uWqrY8mf8S jbuz+HKM0KjCvG8Uv8uJ8tVk9XVfXuDK1LTvDAj34m1mmpmr8X6Qz6ufonteOEM8 s2x+MJHpzI9u7RgQcXV+xNR4kmixngeYqV2luXE5AHhxU+bC5YwmihKHuti5R4x4 yiTvjnnO12m7c0YuoAyMFFlJI5Q2gNx9eNOPtk/4erSlh1LyVu0G2wvtS75ROBsA TDoX5t4r6UnggnfDTMELtzJdyUaMvrswqX80UYqPfcvsViCv7eg9ubZgQd4sPYyy h+zupc6sR/PT9MIccGxsksWqKq46OIJ6JyijaY7Wvzyn0IkIMo2K0ISTw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedruddtkedgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Aug 2023 23:37:26 -0400 (EDT) Date: Wed, 16 Aug 2023 12:37:21 +0900 From: Michael Paquier To: Tomas Vondra Cc: Andres Freund , Postgres hackers Subject: Re: pg_logical_emit_message() misses a XLogFlush() Message-ID: References: <4e680b60-9bce-7c4a-0419-f478a30d30e3@enterprisedb.com> <20230816003333.7hn2rx5m2l7una3d@awork3.anarazel.de> <619e219c-5894-cfd0-5634-0d465c41130b@enterprisedb.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3j6mhD1o+ZXwR2OM" Content-Disposition: inline In-Reply-To: <619e219c-5894-cfd0-5634-0d465c41130b@enterprisedb.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --3j6mhD1o+ZXwR2OM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 16, 2023 at 03:20:53AM +0200, Tomas Vondra wrote: > So are you objecting to adding the flush in general, or just to the > backpatching part? >=20 > IMHO we either guarantee durability of non-transactional messages, in > which case this would be a clear bug - and I'd say a fairly serious one. > I'm curious what the workload that'd see order of magnitude of slowdown > does with logical messages, but even if such workload exists, would it > really be enough to fix any other durability bug? Yes, I also think that this is a pretty serious issue to not ensure durability in the non-transactional case if you have solutions designed around that. > Or perhaps we don't want to guarantee durability for such messages, in > which case we don't need to fix it at all (even in master). I mean, just look at the first message of the thread I am mentioning at the top of this thread: it lists three cases where something like pg_logical_emit_message() was wanted. And, it looks like a serious issue to me for the first two ones at least (out-of-order messages and inter-node communication), because an application may want to send something from node1 to node2, and node1 may just forget about it entirely if it crashes, finishing WAL redo at an earlier point than the record inserted. > The docs are not very clear on what to expect, unfortunately. It says > that non-transactional messages are "written immediately" which I could > interpret in either way. Agreed. The original thread never mentions "flush", "sync" or "durab". I won't fight much if there are objections to backpatching, but that's not really wise (no idea how much EDB's close flavor of BDR relies on that). -- Michael --3j6mhD1o+ZXwR2OM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmTcRHEACgkQnvQgOdby QH3hRQ//aFW4CyVDoFsW0AYEgeB+3RKe4mr6iZC0sK/vCoca6BZwpT0i2HM7EsA+ QEOVORXE12/ufR6MsK8TjDyGADqEOAgm2L/jegLl/FffWWidK2KG2zJSS6bloUzx 63j2zyd+VgzJN1vLOcsD0HZxSGm/kX/VQmhs3quL+hBNHDmXiKE10BEHf3pTuLRn at/NjuSSESF9ESf0qaddusdFDahFeFF4UcH+Y56BTatDxf4KLhtoS7dsxfXn3eZl HBDulyJys3hQ4Kc2prjqRNQtnLY24ztcTlN4MO7uhYD1RajtW5rsgorMSbHa5q6I 5KPeu9u7R/51D3lqJnhCLOVyR73z27ZdCjWjSjzRlUzOMDmE3Qy9oKU5cp3LXYYO M4HzolGTnZqBg8lN+NiA1BweaNzi3tfeRnQmksSMGrwEY+j6qVaxTVfFZ2MCm9FC JjWn3/M1ol4AGxr6fMxHFsx2ATH9JbcTt4UlNDuoF6QC1ZrqBLSxDhogXA3FUWbU JCnaQdL1X90f1xKk3krI2YhbxWljfdecwOdesC8cSjs1AcLZiCMpjlQ4OAAMqx52 o2liEsO/Arb6i5F5ipwELq1ZhoEArMRyGYBo84mh+HBevkK7m2Go5HXXq3GKLPto YA175YU8vms2aekVCpqICTFQ5+OTR6t5jYp6juhLmWaYDFF2OAg= =vMkA -----END PGP SIGNATURE----- --3j6mhD1o+ZXwR2OM--