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 1nZU9z-0003LS-7d for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Mar 2022 08:58:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nZU9x-0004MA-VR for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Mar 2022 08:58:33 +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 1nZU9x-0004M1-J9 for pgsql-hackers@lists.postgresql.org; Wed, 30 Mar 2022 08:58:33 +0000 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nZU9v-0008Pq-2M for pgsql-hackers@lists.postgresql.org; Wed, 30 Mar 2022 08:58:33 +0000 Received: by mail-pg1-x534.google.com with SMTP id q19so17092846pgm.6 for ; Wed, 30 Mar 2022 01:58:30 -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=GdccO+fFQ4+W3xhHGJS687pO4elPmZ2miZed2xWDcEU=; b=BBVn67hZ6d3Ilh1FpOE8/rZVZASCmwCj+pRz/SKpnSGAMyJWaTELCrQQ1fR5IwQ2Mu 1d9JodB4rka+OCbvphNSvg9l4Z7Lr3Asv3++I83mf+5yiG/UBROFBdsgP0fWHnouVQsK SoC5ZhGEGlIirpR5kVZE+IU4Rhp0tl7slDXPcdbZSreINCMhqmoYSv8dmuyKMnu1mrYd KLwdmCgoMjOhX1d4a1BvAQscmXktkAfRPD9bK4tm4xpAi0daKkcf0Ww0Ag3pvc7m/gZR VAPdfdBJXMm/uSth5mfDuAW1/B9Lll0djqYaA9G89q4c6g3861TcJXdwPeQ04Qf5jufx x7FQ== 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=GdccO+fFQ4+W3xhHGJS687pO4elPmZ2miZed2xWDcEU=; b=ixkXAmG3vCPvXDP/TAo2pg77w0o4sLV1m1/iuquBmou+VUiZe/NrwFBoDamoTd4WOa XSrffoM9Da8/G/UVStXa9s1HNYJ0O64rQD/Y2Enu7sKUFwSbNA/xwtxWo624hVz1HGGc 0Cukn3GPI1SVb1ma0M0lqq9VgA4l5HYlzOjpiPyL32R4zyAEVVeoI/idPXokCh7rQarE Fz3mMjFfUukELkgxTEC/lUFS8PhwD41vnNBoTx/HYJbVR976E/5k+F81q8DBVE8+BdtD tqHaude1MujjA7efdx/gZBWY4Qlkwq4iWP1Ft/7PoypV3wCubdK5Z1WEp6l8p51xy1a7 FGiA== X-Gm-Message-State: AOAM532AupeF4+gWo1ZJaFqA9enb8UTaiB+8tDcKMpoS7P1IuPL/R+O2 kX+wJ7X0mLi4cZ9s/BLj9ME= X-Google-Smtp-Source: ABdhPJz1BFxMbyXbwsH7XtWSV3tIWIIP7qaJRBU8tMeLixjtrjozRIJtMBdfvzjGDV1p37LP7gNjWQ== X-Received: by 2002:a05:6a00:1907:b0:4f7:945:14cf with SMTP id y7-20020a056a00190700b004f7094514cfmr32168352pfi.47.1648630708420; Wed, 30 Mar 2022 01:58:28 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id j23-20020a17090ae61700b001c6bb352763sm5189816pjy.52.2022.03.30.01.58.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 30 Mar 2022 01:58:27 -0700 (PDT) Date: Wed, 30 Mar 2022 17:58:24 +0900 (JST) Message-Id: <20220330.175824.936439875658680065.horikyota.ntt@gmail.com> To: er@xs4all.nl Cc: boekewurm+postgres@gmail.com, pgsql-hackers@lists.postgresql.org Subject: Re: TRAP: FailedAssertion("HaveRegisteredOrActiveSnapshot()", File: "toast_internals.c", Line: 670, PID: 19403) From: Kyotaro Horiguchi In-Reply-To: <20220330.114613.1177577626285014184.horikyota.ntt@gmail.com> References: <20220330.100617.1491348930290941094.horikyota.ntt@gmail.com> <20220330.114613.1177577626285014184.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(Wed_Mar_30_17_58_24_2022_921)--" Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ----Next_Part(Wed_Mar_30_17_58_24_2022_921)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit At Wed, 30 Mar 2022 11:46:13 +0900 (JST), Kyotaro Horiguchi wrote in > But, in the first place the *fix* has been found to be wrong. I'm > going to search for the right fix.. FETCH uses the snapshot at DECLARE. So anyhow I needed to set the queryDesk's snapshot used in PortalRunSelect to the FETCH's portal's holdSnapshot. What I did in this version is: 1. Add a new member "snapshot" to the type DestReceiver. 2. In PortalRunSelect, set the DECLARE'd query's snapshot to the member iff the dest is tupelstore and the active snapshot is not set. 3. In FillPortalStore, copy the snapshot to the portal's holdSnapshot. 4. RunFromStore uses holdSnapshot if any. I'm not still confident on this, but it should be better than the v1. regards. -- Kyotaro Horiguchi NTT Open Source Software Center ----Next_Part(Wed_Mar_30_17_58_24_2022_921)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="v2-0001-Appropriately-set-snapshot-on-cursor-fetch.patch"