Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eAiT8-00058o-TQ for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Nov 2017 20:21:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eAiT8-0005p0-6u for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Nov 2017 20:21:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eAiT6-0005kA-EJ for pgsql-hackers@postgresql.org; Fri, 03 Nov 2017 20:21:32 +0000 Received: from mail-pf0-x22d.google.com ([2607:f8b0:400e:c00::22d]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1eAiT3-0007c2-Ce for pgsql-hackers@postgresql.org; Fri, 03 Nov 2017 20:21:31 +0000 Received: by mail-pf0-x22d.google.com with SMTP id e64so2966321pfk.9 for ; Fri, 03 Nov 2017 13:21:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bowt-ie.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=hb10CRRfhnL1mrmRO7SSSmeCoagPvUDkKFC4vW71siE=; b=f+SImRvH7OGFg4Gw32vva6oNQHLhr96dMwB6sGv1LkvCYcYTMfrJNLKz+CAPyIEb6K BRYJOcxyzlOTaeZ2K6PBgQe7g6vw5jd5H0oWNAFOjHkD9zN9FIMurcJek4o095zt5xBf DfNZfLJOJjbKgKniPg3Oz2mlCmqldHQ0QfUVGaamcZcPyof/ynh/ZEuwcKF2mhFxY+jQ dnYWFwMGYwOA2+HjK7B8qokVZbCcrwtHoPOFBQ5uDQCAkc0QIbNJ576olJa6dga0hLH3 54YQBdiJ8lYeOVv5S7YX6iBodiYsUCPGgax//BKvarogHNBzkd2MheEdY4xSgRQeePa5 P1Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=hb10CRRfhnL1mrmRO7SSSmeCoagPvUDkKFC4vW71siE=; b=r8yrshHQifbCl908LPaCbtkNs9/A9Xtb4u2bv31D+eVNS5C//aPHLbdcGbchlpPgDd vloHyzfAblPZjYNMugvAdLzyYPhCpNAGnRrEMTlztNhio9F09lmVrDB/fJg1+W7yBN6C LAW/v+dPJvYaxkHAQqUIdQv6z9rX1lNptUiFXHn1KAkxB18Mn/xVY5LhSRQ+e2eQksfe 7IxEcz6AWyLM50BDAJxJ8GI4yVwX4HkRE+xgi1ZP0nNm4AvORZZGJNZZaQFYjwHALJuM la4ojYKILT31baYt9/FctKbG9mJegY4M8xX+PRqbNM3Ss/Lq6NqPVgM6d17250xQSoCQ iAcw== X-Gm-Message-State: AMCzsaVOy+MFXCBSDXW4wnLBzR5SBSg6i7rrHPk9I3IwWTF2ZFicwxCK fNY0P/0zKNJv7AUWXFNl1S+SBQ== X-Google-Smtp-Source: ABhQp+TZ29MX8ACOft4RnOhoO4Ocl5xRfSzrn1RrgJCou/EbH3QtRZOOqZYTW8ETq96ztiKYwsJcQA== X-Received: by 10.84.217.142 with SMTP id p14mr7928087pli.313.1509740486871; Fri, 03 Nov 2017 13:21:26 -0700 (PDT) Received: from marmot ([162.217.72.7]) by smtp.gmail.com with ESMTPSA id 204sm12502297pfu.8.2017.11.03.13.21.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Nov 2017 13:21:25 -0700 (PDT) Date: Fri, 3 Nov 2017 13:21:23 -0700 From: Peter Geoghegan To: Alvaro Herrera Cc: Andres Freund , "Wood, Dan" , pgsql-committers@postgresql.org, "Wong, Yi Wen" , Michael Paquier , Robert Haas , Tom Lane , pgsql-hackers@postgresql.org Subject: Re: [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple Message-ID: <20171103202123.GA6004@marmot> References: <20171103193659.GA3404@marmot> <20171103195204.omoi4olywmv3nyqk@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20171103195204.omoi4olywmv3nyqk@alvherre.pgsql> User-Agent: Mutt/1.5.24 (2015-08-30) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Alvaro Herrera wrote: >He means that the tuple that heap_update moves to page 1 (which will no >longer be processed by vacuum) will contain a multixact that's older >than relminmxid -- because it is copied unchanged by heap_update instead >of properly checking against age limit. I see. The problem is more or less with this heap_update() code: /* * And also prepare an Xmax value for the new copy of the tuple. If there * was no xmax previously, or there was one but all lockers are now gone, * then use InvalidXid; otherwise, get the xmax from the old tuple. (In * rare cases that might also be InvalidXid and yet not have the * HEAP_XMAX_INVALID bit set; that's fine.) */ if ((oldtup.t_data->t_infomask & HEAP_XMAX_INVALID) || HEAP_LOCKED_UPGRADED(oldtup.t_data->t_infomask) || (checked_lockers && !locker_remains)) xmax_new_tuple = InvalidTransactionId; else xmax_new_tuple = HeapTupleHeaderGetRawXmax(oldtup.t_data); My naive guess is that we have to create a new MultiXactId here in at least some cases, just like FreezeMultiXactId() sometimes does. -- Peter Geoghegan -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers