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 1qOkwR-008qKU-7w for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Jul 2023 20:17:03 +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 1qOkwO-0066uP-VA for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Jul 2023 20:17:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qOkwO-0066uH-Me for pgsql-bugs@lists.postgresql.org; Wed, 26 Jul 2023 20:17:00 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qOkwJ-000Xfo-KE for pgsql-bugs@lists.postgresql.org; Wed, 26 Jul 2023 20:16:59 +0000 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1bbc64f9a91so1683975ad.0 for ; Wed, 26 Jul 2023 13:16:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690402613; x=1691007413; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=gcAwh3dY2/vzRSEnAnk1mhoYF8tO/MY8SVUyTA3CDxY=; b=UtbPoNZpE+u5RUg1rvlZS3Fm4PtihAahY4E4cuy6wTVGxA5O3G9Dvb46OdMZSwR7T1 13ui7cbwXi/qKPA5xdtrc0FcRdSuQ2izDPhTy5ypNBKfd1zceBPw0/3zqOq7485uoLXu uL7JHykgBRM9tAGVpaIq6LegpXP6/vHpT8JE7u8j7ylmc9t2OZBnBomsfxQlNw3tvG0+ EyobIu+SLH1Hhu6BNsr9NQ2jzUrbfA8LNfnbPjzMGwAZsXhaAc0b8yXNagAvjW4Yi/4d /diYF0JCSr+DG64iyzXCqj6gh/qZDaNFnRZIe1Ug1gZyLDaDDkb/yWGZB5o+uOuUyfZN vCuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690402613; x=1691007413; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=gcAwh3dY2/vzRSEnAnk1mhoYF8tO/MY8SVUyTA3CDxY=; b=P+1UoG+XOfbTEOGlp4AIT0sBWhBFzWYlLChn8UI7KJaDqbU1sQeSKzr6mdcxcZNeOU usW4rj/mzU0WAOAWKxSGRYzp8xQGQ/BfrYLxFy+bCvrplxj0EOUByC3HcTxWpwDOXg7Z JPSFKc0b5DBZbzKuHA6IQcDB+VW47TmvFm43v6wdvlCc9JYGU7KcIViCmOUiE04oIvlJ y4hPq2IGURfJJpdp4u1+1QPBChnKxNQm4mE34xo53I1Kipy6RXWpufz2TtyBMy+vkyuI wDV+5ikrdpEu4dP8nt6IEEs9/K0fioaJJKTYu38539mpeHdb9XWpUu8svSjwaILyNOCP qn5w== X-Gm-Message-State: ABy/qLbiYxnXwCVcwkngsFWr2VxtB/vlquY/kRqtyF6Jf2tGChl4lDOH XrTzas0w5bjFW0aQDx/W9EH7EB9/jH8= X-Google-Smtp-Source: APBJJlH8XxQKzqboqqej6WCUBLvKdczuHB3zi3hthb7c5oSi8lL9NlQESBkRrpy+gK9fETm+YnyQ0Q== X-Received: by 2002:a17:902:d501:b0:1b8:b5f8:c485 with SMTP id b1-20020a170902d50100b001b8b5f8c485mr3999587plg.50.1690402613221; Wed, 26 Jul 2023 13:16:53 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id t4-20020a170902e84400b001bbd1562e75sm1699109plg.55.2023.07.26.13.16.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 13:16:52 -0700 (PDT) Date: Wed, 26 Jul 2023 13:16:51 -0700 From: Nathan Bossart To: Gurjeet Singh Cc: Tom Lane , Michael Paquier , richard.vesely@softea.sk, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18016: REINDEX TABLE failure Message-ID: <20230726201651.GC3310393@nathanxps13> References: <18016-2bd9b549b1fe49b3@postgresql.org> <1457241.1688775601@sss.pgh.pa.us> <1867443.1688912310@sss.pgh.pa.us> <20230726175000.GA3259285@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230726175000.GA3259285@nathanxps13> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jul 10, 2023 at 09:35:05AM -0700, Gurjeet Singh wrote: > The code block movement involved slightly more thought and care than I > had previously imagined. As explained in comments in the patch, the > enumeration and suppression of indexes on the main table must happen > before any CommandCounterIncrement() call, hence the > reindex-the-toast-table-if-any code had to be placed after that > enumeration. Do we need to add another CCI after reindexing the TOAST table? It looks like we presently do so between reindexing each relation, including the TOAST table. + * This should be done after the suppression of the use of indexes (above), + * because the recursive call to reindex_relation() below will invoke + * CommandCounterIncrement(), which may prevent enumeration of the indexes + * on the table. I'm not following this. We've already obtained the list of index OIDs before this point. Does this create problems when we try to open and lock the relations? And if so, how? -- Nathan Bossart Amazon Web Services: https://aws.amazon.com