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 1lw46b-0001Be-QY for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Jun 2021 14:43:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lw46a-0000yb-CT for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Jun 2021 14:43:52 +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 1lw46Z-0000yT-IS for pgsql-hackers@lists.postgresql.org; Wed, 23 Jun 2021 14:43:51 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lw46W-0007mY-Am for pgsql-hackers@lists.postgresql.org; Wed, 23 Jun 2021 14:43:49 +0000 Received: by mail-wr1-x42c.google.com with SMTP id j1so2939785wrn.9 for ; Wed, 23 Jun 2021 07:43:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ZRTbAwHrvmYLYCEsPDUU8srQAk/u7d1RjHybTgpZndk=; b=FH6GfxRGC5nWGa3xzjfWWHWDZwI0HJKHRQ/X3kCJkfkYii4yit5Ol26APfYddJjZAu 3qbHe3+nNc0Bwj4zDfswBmNsY33Be9LofiiVElI9wx44b171rRZXXN2kJzzRo3UKzwnD zvC+QAUSmVFZxphWKIVEohiZ3jmRSMFiikMkzJKK1dVOkJiEZTENGDTdfei41B6TqxOR cAjoLEBOkgxz6VbN/oD/sJFL4d13C/4jlGCgICvWjkKy1FgcpWDDlR/kR6GIq4bY1IWc sSZlnnW/urtFekjGhuGh1tTid41Ub7R4DnQkTn+2IoqY7FbKdSyVnNtUXBF3Q0+d0jt3 m9tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ZRTbAwHrvmYLYCEsPDUU8srQAk/u7d1RjHybTgpZndk=; b=DHCN+Xuw8idYKY7fTl5zMkNIxeIXLcBGdyH9mrMr2Ywd9IEfvfe/kC3FV3ZF4rYbol JRSP4p4Kuk2SG3RLF6NKJf/ZIhn9Z5W6GuikkzLXLRBtgvSTi6FdPfhFeC/TbmB5JoSV OpOWwBpdh2EdgMRE8c35BZ1uLWALGmwvsDG7fV/L+iVVRg3ERmn0s8Os3BTB0WZX5ugX vl3sZHCpHe4Vu+4QQ+I92uxBa2u99JXOwej6yic11Mtmy+GdqgFzlGwwKFojn6lXQ9Nx EQY+PkGA2zI0E+acr2PcrVeTGiWJGOIAVH6Pg0L8iZyZ1+uiG7ljBFQsuGcvD0EYHAYW UW8g== X-Gm-Message-State: AOAM533aEEI+bbCfsRt1EAwpcrJhPyeHIuNMbnYkRlJ14qNsJtI7L7uG lDP32h9YnNrl3phqqZwW8wirVhze7Fpm8WHIeOfSeBHhfDfttDwzeZtddmFwjLyuIwp1dorFswN WMVOYUF2I7QP6lzG+zXvQoBvquCfygMfvVqKD0p/p6gOUHPllQv7hY7FoySV0hu5ezoK3rTVSXG yajMsYADhGqLC2Hz4MwDsCfqpgfmvXUCiYfLSkNw/Pk7dg/NqFcf77Em9mZzaZ/RB8P9tcrdpwa t1J8HygntOpswssYEcTeMefze/xRo+FFUrOJyDxLsOkju4rx4Dz5Hsq X-Google-Smtp-Source: ABdhPJzyF8NbYtArUKHMqCtOh1d2inzK66/SzqXeGDr2MVkkcuc6TqZo7Tw+V9LXfVpAnzWo7gl9Qw== X-Received: by 2002:adf:f688:: with SMTP id v8mr399063wrp.209.1624459425774; Wed, 23 Jun 2021 07:43:45 -0700 (PDT) Received: from [10.137.0.19] (ip-86-49-254-183.net.upcbroadband.cz. [86.49.254.183]) by smtp.gmail.com with ESMTPSA id v1sm222441wru.61.2021.06.23.07.43.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Jun 2021 07:43:45 -0700 (PDT) Subject: Re: Decoding speculative insert with toast leaks memory To: Amit Kapila , Amit Langote Cc: Dilip Kumar , Tom Lane , osumi.takamichi@fujitsu.com, Alvaro Herrera , Andres Freund , Ashutosh Bapat , Peter Eisentraut , Petr Jelinek , PostgreSQL Hackers References: <648020.1623854904@sss.pgh.pa.us> From: Tomas Vondra Message-ID: <7dab0929-a966-0c0a-4726-878fced2fe00@enterprisedb.com> Date: Wed, 23 Jun 2021 16:43:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 6/18/21 5:50 AM, Amit Kapila wrote: > On Thu, Jun 17, 2021 at 2:55 PM Amit Kapila wrote: >> >> Your patch looks good to me as well. I would like to retain the >> comment as it is from master for now. I'll do some testing and push it >> tomorrow unless there are additional comments. >> > > Pushed! > While rebasing a patch broken by 4daa140a2f5, I noticed that the patch does this: @@ -63,6 +63,7 @@ enum ReorderBufferChangeType REORDER_BUFFER_CHANGE_INTERNAL_TUPLECID, REORDER_BUFFER_CHANGE_INTERNAL_SPEC_INSERT, REORDER_BUFFER_CHANGE_INTERNAL_SPEC_CONFIRM, + REORDER_BUFFER_CHANGE_INTERNAL_SPEC_ABORT, REORDER_BUFFER_CHANGE_TRUNCATE }; I understand adding the ABORT right after CONFIRM Isn't that an undesirable ABI break for extensions? It changes the value for the TRUNCATE item, so if an extension references to that somehow it'd suddenly start failing (until it gets rebuilt). And the failures would be pretty confusing and seemingly contradicting the code. FWIW I don't know how likely it is for an extension to depend on the TRUNCATE value (it'd be far worse for INSERT/UPDATE/DELETE), but seems moving the new element at the end would solve this. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company