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 1qjepQ-00BcWH-KF for pgsql-bugs@arkaria.postgresql.org; Fri, 22 Sep 2023 12:00:12 +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 1qjepP-003ORk-33 for pgsql-bugs@arkaria.postgresql.org; Fri, 22 Sep 2023 12:00:11 +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 1qjepO-003ORW-OA for pgsql-bugs@lists.postgresql.org; Fri, 22 Sep 2023 12:00:10 +0000 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qjepL-006vGD-Se for pgsql-bugs@lists.postgresql.org; Fri, 22 Sep 2023 12:00:10 +0000 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-501eec0a373so3490852e87.3 for ; Fri, 22 Sep 2023 05:00:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695384006; x=1695988806; darn=lists.postgresql.org; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=UPBMld85/Z0X9W9hkPuOXuGmRGP9jO5LYmx2upp64IQ=; b=FqDL9WFXsjpe1FRdcKTtqAdKBU7ILuOsuRBJ596HtCCD8Xuk/sXl7YkJagyWEiU4+u Ev12GBg/ATWnnH8mqeOC4cwqD0XVgjxQo+lLVceaExdktxzYnY7pafJ7olyA77nbE4m4 8pyeH1YLv0FgzND9zQFYGR6ekQpE1apC5pbS5hB4J9uvI9O2dwLydhpAocVHRtCbiP7X QVWHNCPalAnEDSSC5tluDcLGDcSk3/wWa+ifj+iVsFpglgLKfK9hvpeBxASZGgpNLSM/ 0KsCpFJZLAJVleTSO2MDZv469ketb+l9lM20BSxPdbFi8fbxhuNPcQPHbj7NsyQu2UlE 88LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695384006; x=1695988806; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=UPBMld85/Z0X9W9hkPuOXuGmRGP9jO5LYmx2upp64IQ=; b=eHw4tQcxd0RPeXYbfvpu/xj9ZLJ9kKXLz6SM3fp0IVEo3zaeFH1pyTYTQ0CJYpOzA8 ruhJOaCViXXL6eWEIr45lrtd1wnDxPud19sbMCD9Ls5KQGkufIEEavO5P692cx/QyYYW 2fwKMfQ3VV0SCMSGxy/Jzn4P1XgCTkaHgobwLBYiWt3NveoaOL5oTsIv9x9kNfBTbAre wQZQFjrNKtFC8T5wClBjlCtg88hPECDySlvFwrEai425KnuY6BIeijr7qkHU4nrR47ee l8YskQo9eDV+Ttt5uZWbhnVKY+vRnXblxuMTRqGWoWHNxOTl5Q5jrI94dLZ8UHoHa+lT /tFg== X-Gm-Message-State: AOJu0YwojYE5VLAmuL0uSUKbSCBCJWeA63jj9N51Gzv1jYoLBwjywJCt cHFs73d6s8Rnc9nXzv20rg6QB6q0DFUTpw== X-Google-Smtp-Source: AGHT+IHdAJ1OlJxzc0Ouh3M6AUJuEonV5FrDWN0OYbO53SYu2MKfPfO4H/XiJ9kr3Fm64tq5WkaYWA== X-Received: by 2002:a05:6512:3f1:b0:500:91ac:c0b5 with SMTP id n17-20020a05651203f100b0050091acc0b5mr6688283lfq.30.1695384004760; Fri, 22 Sep 2023 05:00:04 -0700 (PDT) Received: from [1.0.0.7] ([178.155.23.234]) by smtp.gmail.com with ESMTPSA id w17-20020ac254b1000000b004fe8593b67fsm702749lfk.107.2023.09.22.05.00.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Sep 2023 05:00:03 -0700 (PDT) Content-Type: multipart/mixed; boundary="------------T21k0FKoF1J09eVjzD47sjI0" Message-ID: <9541c507-a325-7768-38b0-90f6532c01e3@gmail.com> Date: Fri, 22 Sep 2023 15:00:01 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: BUG #18127: Assertion HaveRegisteredOrActiveSnapshot failed on REINDEX CONCURRENTLY when blocksize=1 Content-Language: en-US To: pgsql-bugs@lists.postgresql.org, Andres Freund References: <18127-fe54b6a667f29658@postgresql.org> From: Alexander Lakhin In-Reply-To: <18127-fe54b6a667f29658@postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------T21k0FKoF1J09eVjzD47sjI0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 21.09.2023 14:00, PG Bug reporting form wrote: > The following bug has been logged on the website: > > Bug reference: 18127 > > A server compiled --with-blocksize=1 produces an assertion failure on > `make check`. More specifically, the failure triggered on a query like: > CREATE TABLE concur_reindex_tab (c1 int PRIMARY KEY); > CREATE TABLE concur_reindex_tab2 (c1 int REFERENCES concur_reindex_tab); > REINDEX INDEX CONCURRENTLY concur_reindex_tab_pkey; With the attached patch, which, as I believe, represents a real possibility during code execution, I could perform check-world without changing the block size. It gave me other code paths to reach that assertion failure: 1) ALTER TABLE range_parted2 DETACH PARTITION part_rp CONCURRENTLY #5  0x0000555e8b668a01 in ExceptionalCondition (conditionName=conditionName@entry=0x555e8b6ca710 "HaveRegisteredOrActiveSnapshot()", fileName=fileName@entry=0x555e8b6dbe02 "toast_helper.c", lineNumber=lineNumber@entry=281)     at assert.c:66 ... #9  0x0000555e8b15c637 in simple_heap_update (...) at heapam.c:4044 #10 0x0000555e8b20510c in CatalogTupleUpdate (...) at indexing.c:322 #11 0x0000555e8b2e1bf6 in DetachPartitionFinalize (...) at tablecmds.c:19428 ... 2) src/test/subscription/t/021_twophase.pl Core was generated by `postgres: subscriber: logical replication apply worker for subscription 16389 '. ... #5  0x000055dae548da01 in ExceptionalCondition (conditionName=conditionName@entry=0x55dae54ef710 "HaveRegisteredOrActiveSnapshot()", fileName=fileName@entry=0x55dae5500e02 "toast_helper.c", lineNumber=lineNumber@entry=281)     at assert.c:66 ... #9  0x000055dae4f81637 in simple_heap_update (...) at heapam.c:4044 #10 0x000055dae502a10c in CatalogTupleUpdate (...) at indexing.c:322 #11 0x000055dae52c70ca in UpdateTwoPhaseState (...) at tablesync.c:1752 #12 0x000055dae52ce2e1 in run_apply_worker () at worker.c:4539 3) src/test/subscription/t/029_on_error.pl Core was generated by `postgres: subscriber: logical replication tablesync worker for subscription 163'. ... #5  0x0000556c27961a01 in ExceptionalCondition (conditionName=conditionName@entry=0x556c279c3710 "HaveRegisteredOrActiveSnapshot()", fileName=fileName@entry=0x556c279d4e02 "toast_helper.c", lineNumber=lineNumber@entry=281)     at assert.c:66 ... #9  0x0000556c27455637 in simple_heap_update (...) at heapam.c:4044 #10 0x0000556c274fe10c in CatalogTupleUpdate (...) at indexing.c:322 #11 0x0000556c2751fc98 in DisableSubscription (...) at pg_subscription.c:196 #12 0x0000556c277a1d03 in DisableSubscriptionAndExit () at worker.c:4725 #13 0x0000556c2779a935 in start_table_sync (...) at tablesync.c:1623 These are all code paths that were detected during check-world. Andres, could you please look at this and determine whether the state, highlighted by the assert, is unexpected? Best regards, Alexander --------------T21k0FKoF1J09eVjzD47sjI0 Content-Type: text/x-patch; charset=UTF-8; name="hroas-test.patch" Content-Disposition: attachment; filename="hroas-test.patch" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9iYWNrZW5kL2FjY2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