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 1oNj5e-0001j1-Jl for pgsql-bugs@arkaria.postgresql.org; Mon, 15 Aug 2022 23:01:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oNj5d-0005GP-FF for pgsql-bugs@arkaria.postgresql.org; Mon, 15 Aug 2022 23:01:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oNj5d-0005GF-6c for pgsql-bugs@lists.postgresql.org; Mon, 15 Aug 2022 23:01:45 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oNj5W-00038v-Ll for pgsql-bugs@lists.postgresql.org; Mon, 15 Aug 2022 23:01:44 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 686E7320070D; Mon, 15 Aug 2022 19:01:37 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 15 Aug 2022 19:01:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:content-transfer-encoding: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=1660604496; x= 1660690896; bh=NvF68R0kMUCP71f4NR6NXz8Ye6AO7B57h/1cqVqAJ1E=; b=0 GjTc7ixkIn052J+K2QLXSHqDryWlyVnZHVQi529LWvlaes1yJE7JeKvZQv9X3XSl kekh6sHrkdBqQBcm77rYa0OBMjZCVoOdYxoQW0+i90xAFIj2DeTcdFSNhrPlw+44 yoR/InXhDbd1gzxtbk2dn/T0jiccKUQROtGtd34tyJIEmaYwCdIi6h1XUqRn3mMp ECVH8uRV6tVLW/03pXnlZwgTY2KghcfemtmRzKh/EwjCIeWsNPXznuSD0nYXW421 f0+pi7Jvn26LgRjZkW3s2YK9hYAg5fI4RvVSQnf25MDvv1Lgwd7vZd/GKI+4S6H7 hi8HpwNNpF2i5SlH5KC0g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=1660604496; x=1660690896; bh=N vF68R0kMUCP71f4NR6NXz8Ye6AO7B57h/1cqVqAJ1E=; b=W3a2uuBEJwKn1At8A 2Epi71t1GPkSLRtdTxNUzFuxdiekoPeAyqz+eqfTMjBj5OTXqVWXxAcmoUGEsn6/ foHhzoEIfeqQoESVXZl6bPR1M1hxyboE0+GFf1BfjCrhUTazOvAVWvARIlAxq0yS uVi4uyNGChcLbjVXeTbp1s8tWYa8hu2RpR2r9eebBhAgC2+ugRzENAM4qx4UhTFu Q3+Nk2KybbiFK157RuFsiDuzSGeVMdFTpr4o+zU6I9BgIdzW9Ur6qf4XF07Q21Yv AHKpoz6r8uWBn/vtt6eBBIQVNCKUwr6OFryr7K1JWSk+TOWwHP4eUgSEMrezjSL9 KXx0w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdehfedgudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggugfgjsehtke ertddttddunecuhfhrohhmpeetnhgurhgvshcuhfhrvghunhguuceorghnughrvghssegr nhgrrhgriigvlhdruggvqeenucggtffrrghtthgvrhhnpeejheeivdevffeijeffheegfe ejveffteeviedugeegtdehffdvffekudektdehjeenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 15 Aug 2022 19:01:36 -0400 (EDT) Date: Mon, 15 Aug 2022 16:01:35 -0700 From: Andres Freund To: maxim.boguk@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17586: Look like there are an another bug in REINDEX INDEX CONCURRENTLY of pg_toast indexes Message-ID: <20220815230135.brixexmmacvej4gh@awork3.anarazel.de> References: <17586-b96c11ee8441c4d6@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <17586-b96c11ee8441c4d6@postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2022-08-15 11:36:52 +0000, PG Bug reporting form wrote: > Bug reference: 17586 > Logged by: Maxim Boguk > Email address: maxim.boguk@gmail.com > PostgreSQL version: 14.4 > Operating system: Ubuntu Linux > Description: > > Details about the data structure > pg_toast.pg_toast_2502234687_index is index toast of exports_new_2022_32w > partition of exports_new table (Partition key: RANGE (epoch)) > > During the reindex job there were quite a lot new inserts into > exports_new_2022_32w table via partition head. > > 2022-08-11 02:46:16.972 UTC 1175180 ***_push@***_exports from [local] > [vxid:12/63545267 txid:354388805] [INSERT] LOG:  duration: 2711.995 ms >  statement: INSERT INTO exports_new(field_board_id, field_id_mod_256, epoch, > field_ids) >                 (SELECT field_board_id, (field_id % 256)::int > field_id_mod_256, epoch, ARRAY_AGG(field_id) AS field_ids FROM (SELECT > field_board_id, epoch, unnest(field_ids) AS field_id FROM temp_export_ids) > t >                 GROUP BY 1,2,3) > > > 2022-08-11 02:47:28.927 UTC 1187482 postgres@***_exports from [local] > [vxid:14/66875173 txid:0] [REINDEX] LOG:  temporary file: path > "base/pgsql_tmp/pgsql_tmp1187482.1.sharedfileset/2.0", size 8192 > [vxid:10/63478386 txid:0] [SELECT] ERROR:  missing chunk number 0 for toast > value 2546878653 in pg_toast_2502234687 > 2022-08-11 02:48:49.512 UTC 1184504 ***_field_sync@***_exports from [local] > [vxid:10/63478386 txid:0] [SELECT] STATEMENT:  SELECT field_ids FROM > exports_new WHERE field_board_id = $1 AND field_id_mod_256 = $2 AND epoch = > $3 Hm. What is the setup of this system? Do you have a hot_standby_feedback enabled replica? Does it use replication slots? Did it reconnect at the time? This issue could be due to the xmin horizon going backward, rather than a bug in reindex concurrently itself. Too bad we don't have an errcontext set up for this, it'd be quite helpful to know what row the missing toast value is in, so we could check its visibility. Greetings, Andres Freund