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 1nZ7rp-0008La-SO for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Mar 2022 09:10:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nZ7ro-0008Uz-7L for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Mar 2022 09:10:20 +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 1nZ7rn-0008Uq-OK for pgsql-hackers@lists.postgresql.org; Tue, 29 Mar 2022 09:10:19 +0000 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nZ7rk-000388-61 for pgsql-hackers@lists.postgresql.org; Tue, 29 Mar 2022 09:10:18 +0000 Received: by mail-pj1-x1035.google.com with SMTP id mj15-20020a17090b368f00b001c637aa358eso1555581pjb.0 for ; Tue, 29 Mar 2022 02:10:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:message-id:to:cc:subject:from:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=C7Dj08I4B8zEbIK15Js0lzHV6OMBJNkO8Ju16R9pkCc=; b=B1obmPc8txb92M8aH2TrlgOM1Wu8BCjLGYsBdg2/c3yvu/PV1p35wTXcLLhJH+qlhu UBNTftBZjs3ObkyaHGf5Rxu0SP8xGGAVoWXXgffTUEbRe6APRNCjL1aR+xgsKd35ei8a rRcpZDUgyMR/74dgt382jJN87rJrDYtSWt9AeHDVYv48FeLAFANvrQIcmZX2Fj/JaeN2 /O5b5Yrc5L+tgZOQLwraoC6h9KHr5iyDGfv9nahmHZTCHFDXVse+a8qKwQxoNXaFwFIY YH5so739mj2OXypjUI6Fnjo1M4xspwdOUT0AMyJKi87fWZ5grVhWA7bfNWPXuoqn8ECk MUEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:to:cc:subject:from:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=C7Dj08I4B8zEbIK15Js0lzHV6OMBJNkO8Ju16R9pkCc=; b=oZHT+3eISnynlSbA2ADkC1eXw3kctMQBIIjyzSrJnbBchZ6JBOKBKJBliIDlsuep3b aUqTBnsvyL7IUdMGlBX546LwEalaJUUcQUyXxsdSIaYtwqU/JyhZZ9xnIGdPXK9yR7y3 fFqR+OgN3Dc6tnYdMayvYNw1g7oinH8CAa7ODD3AQDARpYfrv7q1TaDQkyYVICu/M5Ff 4p/JWFeTUaIGbxI06kRza2U5rbqVd6v6u1TnhasHjBBSJ1MhCITpFRWSRoyCCh2jeTjE 3HEhoF+u4XPvtRd9Zf4RiaVAEUtfDIP6CHJzuyJ3AcezRWToHPUp3AuqIx9M53RPkYTO b/sg== X-Gm-Message-State: AOAM532ufanFZlwCvltNHg2j7IeVLypBoYCYJXs/2kHOxXy7fsgFlBNB fk4binYBatDIdGI/8/QvaGc= X-Google-Smtp-Source: ABdhPJygmhCoCifOsXcgwsIZhfGv5xeajm22U8p6Dg3gPYjLG23zNpe/ciDwYKR5Cd1HUnR8P74SsQ== X-Received: by 2002:a17:903:234c:b0:154:317:3828 with SMTP id c12-20020a170903234c00b0015403173828mr29898361plh.123.1648545014993; Tue, 29 Mar 2022 02:10:14 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id y9-20020a056a00180900b004faa45a2230sm19301824pfa.210.2022.03.29.02.10.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 29 Mar 2022 02:10:13 -0700 (PDT) Date: Tue, 29 Mar 2022 18:10:11 +0900 (JST) Message-Id: <20220329.181011.1401235917653600685.horikyota.ntt@gmail.com> To: er@xs4all.nl Cc: pgsql-hackers@lists.postgresql.org Subject: Re: TRAP: FailedAssertion("HaveRegisteredOrActiveSnapshot()", File: "toast_internals.c", Line: 670, PID: 19403) From: Kyotaro Horiguchi In-Reply-To: <20220329.170621.2101149643828659444.horikyota.ntt@gmail.com> References: <20220328.183646.1041002117568499041.horikyota.ntt@gmail.com> <20220329.170621.2101149643828659444.horikyota.ntt@gmail.com> User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Tue_Mar_29_18_10_11_2022_652)--" Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ----Next_Part(Tue_Mar_29_18_10_11_2022_652)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit At Tue, 29 Mar 2022 17:06:21 +0900 (JST), Kyotaro Horiguchi wrote in > At Mon, 28 Mar 2022 18:36:46 +0900 (JST), Kyotaro Horiguchi wrote in > Then, I found that portal->holdSnapshot is that. I came up with the > attached. It does the follows: > > 1. Teach PlannedStmtRequiresSnapshot() to return true for FetchStmt. > > 2. Use holdSnapshot in RunFromStore if any. > > > The rerpducer is reduced to as small as the following. > > CREATE TABLE t (a text); > INSERT INTO t VALUES('some random text'); > BEGIN; > DECLARE c CURSOR FOR SELECT * FROM t; > FETCH ALL IN c; > > But I haven't come up with a reasonable way to generate the 'some > random text' yet. I gave up and took a straightforward way to generate one. I don't like that it uses a fixed length for the random text, but anyway it works for now... regards. -- Kyotaro Horiguchi NTT Open Source Software Center ----Next_Part(Tue_Mar_29_18_10_11_2022_652)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="v1-0001-Appropriately-set-snapshot-on-cursor-fetch.patch"