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 1mNVGk-0005T1-Lu for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Sep 2021 07:11:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mNVGj-0001ji-J4 for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Sep 2021 07:11:45 +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 1mNVGJ-0005VA-2Q for pgsql-hackers@lists.postgresql.org; Tue, 07 Sep 2021 07:11:19 +0000 Received: from smtp-fw-6002.amazon.com ([52.95.49.90]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mNVGG-0001ZS-QF for pgsql-hackers@lists.postgresql.org; Tue, 07 Sep 2021 07:11:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1630998676; x=1662534676; h=to:cc:references:from:message-id:date:mime-version: in-reply-to:content-transfer-encoding:subject; bh=MR0L89t224hvx9mHiscpIw/SIljD3PABqYLXVGQpqOI=; b=j8V7nFJQZ4wYqVDxyMOeDkuNprv0vuXM/o10xMvwReEiLIFYYQb5GegH Q4im9B+QoWv/9TYmS4mCrGBpiR3M+q9dAWDRyUI2HDK57XpylCLph6avn roUMRcxy1CDP52d3lqM9IfFTe7neLxOmEEjgBY52zFriYMO/8SVgQw9LA o=; X-IronPort-AV: E=Sophos;i="5.85,274,1624320000"; d="scan'208";a="138320540" Subject: Re: [BUG] Failed Assertion in ReorderBufferChangeMemoryUpdate() Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-1e-27fb8269.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-6002.iad6.amazon.com with ESMTP; 07 Sep 2021 07:11:09 +0000 Received: from EX13D03EUC003.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan2.iad.amazon.com [10.40.163.34]) by email-inbound-relay-1e-27fb8269.us-east-1.amazon.com (Postfix) with ESMTPS id 4BB3FA1906; Tue, 7 Sep 2021 07:11:08 +0000 (UTC) Received: from 38f9d36c4abb.ant.amazon.com (10.43.162.248) by EX13D03EUC003.ant.amazon.com (10.43.164.192) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Tue, 7 Sep 2021 07:11:05 +0000 To: Amit Kapila CC: Dilip Kumar , PostgreSQL Hackers References: <92b0ee65-b8bd-e42d-c082-4f3f4bf12d34@amazon.com> <73dcd904-cfee-21f2-d363-317cd517cb00@amazon.com> <51babafd-4c0c-9b69-ec5c-5e4740d2606b@amazon.com> From: "Drouvot, Bertrand" Message-ID: <7e2a1da1-80e1-64c4-1512-78e47a6711d4@amazon.com> Date: Tue, 7 Sep 2021 09:11:01 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.43.162.248] X-ClientProxiedBy: EX13D27UWB002.ant.amazon.com (10.43.161.167) To EX13D03EUC003.ant.amazon.com (10.43.164.192) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 9/7/21 8:51 AM, Amit Kapila wrote: > On Tue, Sep 7, 2021 at 11:33 AM Drouvot, Bertrand wrote: >> Hi, >> >> On 9/7/21 7:58 AM, Dilip Kumar wrote: >> >> >> On Tue, Sep 7, 2021 at 11:10 AM Amit Kapila wrote: >> >>>>> Isn't it better if we use option 2) at all places as then we won't >>>>> need any special check inside ReorderBufferChangeMemoryUpdate()? >>>> >>>> If we want to do this then be careful about REORDER_BUFFER_CHANGE_INTERNAL_TUPLECID change. Basically, ReorderBufferChangeMemoryUpdate() ignores this type of change whereas ReorderBufferChangeSize(), consider at least sizeof(ReorderBufferChange) bytes to this change. So if we compute the size using ReorderBufferChangeSize() outside of ReorderBufferChangeMemoryUpdate(), then total size will be different from what we have now. Logically, we should be ignoring/asserting REORDER_BUFFER_CHANGE_INTERNAL_TUPLECID in ReorderBufferChangeSize(), because ReorderBufferChangeMemoryUpdate() is the only caller for this function. >>>> >>> Why can't we simply ignore it in ReorderBufferChangeMemoryUpdate() as >>> we are doing now? >> >> Yeah right, we can actually do that, it doesn't matter even if we are passing the size from outside. >> >> Agree, if no objections, I'll prepare a patch with the modified approach of option 2) proposed by Amit (means passing the size from the outside in all the cases). >> > Sounds reasonable. Another point that needs some thought is do we want > to backpatch this change till v13? I am not sure if there is any > user-visible bug here but maybe it is still good to fix this in back > branches. What do you think? Yes, +1 to backpatch till v13 "per precaution". I will first come back with a proposed version for master and once we agree on a final/polished version then I'll do the backpatch ones (if needed). Thanks Bertrand