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 1lZe7N-0006bA-QQ for pgsql-bugs@arkaria.postgresql.org; Thu, 22 Apr 2021 18:32:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lZe7M-00053D-QN for pgsql-bugs@arkaria.postgresql.org; Thu, 22 Apr 2021 18:32:00 +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 1lZe7L-000536-8p for pgsql-bugs@lists.postgresql.org; Thu, 22 Apr 2021 18:32:00 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lZe7H-0004Ze-Iu for pgsql-bugs@lists.postgresql.org; Thu, 22 Apr 2021 18:31:58 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 428E9FDC; Thu, 22 Apr 2021 14:31:52 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 22 Apr 2021 14:31:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=1nQXZsim0pFNa5pz2Calc4S29Kz +r+ujkADEt7M341Q=; b=W8eFYL62+tTRByWEgAk959irhvAyRMEkjXXd1euddkO sdJV6o4NlDhoJaBhsNt50FYNwBFo/8xv1sB233+rmlP8XnAFklZDl3k2sTN5Z3Si GxgubUwXw0Go23uWpeuGtvkkD3rrsH5S8hJYGBP1Yodg/DuDfRziX7hypd7jBGJ6 T/Wl/Z1miGBXvlWR1C97M+VK7ShE25NUINqPq8j8xWmH3j/ONpcNB+Wf5/SZfGvO Zrd89J5tGfOoBKKuK2EkyL7/NFMMqJLy/3kANTs9W2d5jqXwn1u6FLXOw+amYL9s aquV+agY2PXjlNo31kgcLYiDMtR15PnrCGd0+CCcTWA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=1nQXZs im0pFNa5pz2Calc4S29Kz+r+ujkADEt7M341Q=; b=sRAB0GaGvCYnLwWia4UF31 DX9g0L4Bg2QICtPdBbGzu8agnh2sG/UbjwdYVluW7dVWftxbK12agVvEBuVyEiwh EamsEwuJp86sonAKd96PJ7eE6TOF23A9JlL50WkxXuCGG8R+ikz9tizVw8onACj6 TYmLZ7Yqyvbp4xvYwHfUd5hlXcki6kotJYIdjl15Lk7Wd/Aia3t1tu6g/7B3m580 YtSYKxbZnNJ1icwVO1XZ18KmAJq2pQeJEPJRTRmC1qrCA2OI5xsgZs5Bo3BLBakq jpX5horueo2wXK5QYSBphWlvN3xF80bDeP//V1/U/0qG79U7giKCM4d45Hxs5oyg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddutddguddvgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepudekhfekleeugeevteehleffffejgeelueduleeffeeutdelffeujeff hfeuffdunecukfhppedutdejrddugedvrdeffedruddtfeenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvshesrghnrghrrgiivghl rdguvg X-ME-Proxy: Received: from intern.anarazel.de (107-142-33-103.lightspeed.sntcca.sbcglobal.net [107.142.33.103]) by mail.messagingengine.com (Postfix) with ESMTPA id 9D13A240054; Thu, 22 Apr 2021 14:31:50 -0400 (EDT) Date: Thu, 22 Apr 2021 11:31:48 -0700 From: Andres Freund To: Tom Lane Cc: Amit Langote , David Steele , Pavel Biryukov <79166341370@yandex.ru>, PostgreSQL mailing lists Subject: Re: posgres 12 bug (partitioned table) Message-ID: <20210422183148.xsopy2qsym7a7app@alap3.anarazel.de> References: <20200812162718.ycxrktzoe6rpdy5k@alap3.anarazel.de> <407111603806900@mail.yandex.ru> <793243.1619032209@sss.pgh.pa.us> <1102101.1619115665@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1102101.1619115665@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2021-04-22 14:21:05 -0400, Tom Lane wrote: > Hm, we're not done with this. Whatever you think of the merits of > throwing an implementation-level error, what's actually happening > in v12 and v13 in the wake of a71cfc56b is that an attempt to do > "RETURNING xmin" works in a non-cross-partition UPDATE, but in > a cross-partition UPDATE it dumps core. What I'm seeing is that > the result of the execute_attr_map_slot() call looks like > > (gdb) p *(BufferHeapTupleTableSlot*) scanslot > $3 = {base = {base = {type = T_TupleTableSlot, tts_flags = 8, tts_nvalid = 3, > tts_ops = 0xa305c0 , > tts_tupleDescriptor = 0x7f1c7798f920, tts_values = 0x2077100, > tts_isnull = 0x2075fb0, tts_mcxt = 0x2015ea0, tts_tid = {ip_blkid = { > bi_hi = 0, bi_lo = 0}, ip_posid = 3}, tts_tableOid = 37812}, > tuple = 0x0, off = 0, tupdata = {t_len = 0, t_self = {ip_blkid = { > bi_hi = 0, bi_lo = 0}, ip_posid = 0}, t_tableOid = 0, > t_data = 0x0}}, buffer = 0} > > and since base.tuple is NULL, heap_getsysattr dies on either > "Assert(tup)" or a null-pointer dereference. > > So > > (1) It seems like this is exposing a shortcoming in the > multiple-slot-types logic. It's not hard to understand why the slot would > look like this after execute_attr_map_slot does ExecStoreVirtualTuple, > but if this is not a legal state for a BufferHeapTuple slot, why didn't > ExecStoreVirtualTuple raise a complaint? I think it's too useful to support ExecStoreVirtualTuple() in a heap[buffer] slot to disallow that. Seems like we should make tts_buffer_heap_getsysattr() error out if there's no tuple? > (2) It also seems like we can't use the srcSlot if we want to have > the fail-because-its-a-virtual-tuple behavior. I experimented with > doing ExecMaterializeSlot on the result of execute_attr_map_slot, > and that stops the crash, but then we're returning garbage values > of xmin etc, which does not seem good. Garbage values as in 0's, or random data? Seems like it should be the former? Greetings, Andres Freund