Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pUEnp-0006jN-Ew for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Feb 2023 22:38:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pUEno-0003QQ-AK for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Feb 2023 22:38:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pUEnn-0003QG-GJ for pgsql-hackers@lists.postgresql.org; Mon, 20 Feb 2023 22:38:32 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pUEnk-000896-KO for pgsql-hackers@lists.postgresql.org; Mon, 20 Feb 2023 22:38:31 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id CA5E23200A68; Mon, 20 Feb 2023 17:38:24 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 20 Feb 2023 17:38:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc: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=1676932704; x=1677019104; bh=QbbHHGf3b+ oisZq8ZGP51e66el2TKqmuZ1IXgZkk9dI=; b=Lw36MHEvnve6Tku1HgI7MEPW6S Py4Mtk1VGKhLjQ54WxnWvpKsc4GNAy6/mRocg9BwdxcgaBJahAxugayoCaU1giU8 yFill5Uj+GW3AC9dCcABVI/9pGaiPjVpjVdo73vZCm2/QPuQ/sXxZxk1pfnXB/kw pUrGoZjB3MdVXL6BxGOAia4A1LxajRxX/g35JlkPuVB469XXdSMz8w7+cYnx2qL8 ADtEGcXvUA5JiTKab/BWK7b2xuj6UkjxqEXOER6GIHTZKKPFDiXQ8V4NL2kv20mQ Zl4rOGCfcBMwzULuiGvw4ljlQCRCPpVhEy+dhppeyA8Gosfs5goYdn5JW2Fg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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=1676932704; x=1677019104; bh=QbbHHGf3b+oisZq8ZGP51e66el2T KqmuZ1IXgZkk9dI=; b=sBVxgzzOJVw/nZZA0VIulrsYXXUpbrah6IPiNnRAv5tZ zOlMJtLBBtc4Y9H7+S1+ey5pjQYWZwLJ+FhE0SGaljtzAr16bnIgtAjsWLnjp9zD Mx7KS8xS/Nv+ehyhJV57KY80VznTrEJjvE0d55SK47uNsjKyIiQxIFSGbezC5OEp ySm8cMZNBxCFUb29AoGQZ5fGswY6A0KOaZBArQXTOj3xd9188nOFcBYa004C23z0 nASA8L9xIKvZtKm1D6qN/lnbkrCCRr11Bjoq8KWCJlvIl5XIcW2az6KIFaN4ndeG V6k3Lm8lv1SY8iTcrGH5NK9sB4AimDr4zo2PWXzXQw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudejiecutefuodetggdotefrodftvfcurf hrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlh cuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvden ucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquh hivghrrdighiiiqeenucggtffrrghtthgvrhhnpedthfeifeetkedugfdutdevleelgeet leehhfdttdfftdehieekjeffjedvkeduueenucffohhmrghinhephhhtthhprhgvqhhuvg hsthhfihhnihhshhgvugdrrghtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 20 Feb 2023 17:38:21 -0500 (EST) Date: Tue, 21 Feb 2023 07:38:17 +0900 From: Michael Paquier To: Robert Haas Cc: Andres Freund , Tom Lane , Nathan Bossart , Thomas Munro , Fujii Masao , Postgres hackers Subject: Re: Weird failure with latches in curculio on v15[ Message-ID: References: <20230209002413.GA603595@nathanxps13> <3907196.1675957889@sss.pgh.pa.us> <20230209192952.jvx56yuutlxuvjjf@awork3.anarazel.de> <20230216163254.nktnbbb2b7wlpzwy@awork3.anarazel.de> <20230218211522.grbzg75vzjtqafzf@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="V9Kha/1fwVVaO5is" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --V9Kha/1fwVVaO5is Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Feb 19, 2023 at 08:06:24PM +0530, Robert Haas wrote: > I mean, my idea was to basically just have one big callback: > ArchiverModuleMainLoopCB(). Which wouldn't return, or perhaps, would > only return when archiving was totally caught up and there was nothing > more to do right now. And then that callback could call functions like > AreThereAnyMoreFilesIShouldBeArchivingAndIfYesWhatIsTheNextOne(). So > it would call that function and it would find out about a file and > start an HTTP session or whatever and then call that function again > and start another HTTP session for the second file and so on until it > had as much concurrency as it wanted. And then when it hit the > concurrency limit, it would wait until at least one HTTP request > finished. At that point it would call > HeyEverybodyISuccessfullyArchivedAWalFile(), after which it could > again ask for the next file and start a request for that one and so on > and so forth. This archiving implementation is not completely impossible with the current API infrastructure, either? If you consider the archiving as a two-step process where segments are first copied into a cheap, reliable area. Then these could be pushed in block in a more remote area like a S3 bucket? Of course this depends on other things like the cluster structure, but redundancy can be added with standby archiving, as well. I am not sure exactly how many requirements we want to push into a callback, to be honest, and surely more requirements pushed to the callback increases the odds of implementation mistakes, like a full loop. There already many ways to get it wrong with archiving, like missing a flush of the archived segment before the callback returns to ensure its durability.. -- Michael --V9Kha/1fwVVaO5is Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmPz9lkACgkQnvQgOdby QH233w//cyYNxefBZ7+VpiyUaH+AKZiCKpOGOvDo8K9RA8xDtFYkfgRKifK61J6s /Zig5JiVJd0AME2Dr2aT9PWDNgdkGAvlsN9LS8QppRmTMR1Yc/AyWfjTzmrCR9+H 70sKnuNuS6a1iur1ZYFAo749G1gTe8+wKhHNId2MZYieXYHX9jaTHcSrBx+vsBw2 YLrpRlLGcTvcEf80d8XaYpAsy/K8zcSC8CSmYr5fSHgWrQYUk6l9xKY7UTPOGNGE T4kusZAeLQlZGp1RiFMaFpQQFBb2moQ1F3LTeq2ywi7Z25yIVBhVxBR3X4DJpt3b qXevPck6fczIHB75SOQKA6F3wnj9gFMUwPBJ5sfUsEoUQ3Zv8D1ykhJYh1P7RNwz x6JP9VdKkpYeI5JA6KX2vpTFA9iR5EodVdafYJUMn3y8TPU7XqjBzQ03SaIYxMAU tncybB1WFr1FTFB8X/lWyGat6ZYfQUVBQVfiyqKIJ5U2+pGNn5oVoF6cRgE6mhj1 gPK7/q93Ivv+sMy/bYmocf4eF7P5H9v5d2UqVc5JzI++LW4XL9ABSzIFXESj2aVH n3lGe9gtrtwkeT9JcHqgfQ4IZyAzTlUMknY4gC3qhOww0dI6sHkwCesS7BfAc4gc HKts+Alki0gjdGGXLymDzxdD5Pq2V6olacAQyHT6Kee/cCA9xBE= =M8Ee -----END PGP SIGNATURE----- --V9Kha/1fwVVaO5is--