Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iVcxI-00056Z-Ts for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Nov 2019 14:52:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iVcxH-0002t5-PU for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Nov 2019 14:52:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iVcxH-0002sy-D9 for pgsql-hackers@lists.postgresql.org; Fri, 15 Nov 2019 14:52:11 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iVcxF-0005zh-1Q for pgsql-hackers@postgresql.org; Fri, 15 Nov 2019 14:52:10 +0000 Received: by mail-pg1-x542.google.com with SMTP id f19so6109417pgk.11 for ; Fri, 15 Nov 2019 06:52:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=gbOk9eLuLnIfATWDGxoJoAq4NnikjSJ2c0byDaT60aw=; b=NIIV53B7q7rc+z5AyLNu/8A51vTXzX6bPBF41caqlUBgRVKGYvIp/j4pIXcuweGE1n 1XVWOKqmqXfIFK5q3V4eUZHSWyNfOKCT39GACCsc9QA2dMjwwtdQP57oRxK/asJmPoZ3 h3FRh74LXJ4kS4gmGrIkGlWQ8Vo5m10rUlZxI= 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=gbOk9eLuLnIfATWDGxoJoAq4NnikjSJ2c0byDaT60aw=; b=aTgpUuMtAQsyHiQfujr6LRpKFkf/jlP9fAlkwH5pONgqV/GTWIf9NsKIWADe3agyaN oiMCq7ZuwXut8a2OQyatWqTyyCEsw5YfrkgcsK6R87YI01Jncbc62+e/Bh/B5eDQa1BD aGsOKmyheOa11WtdlsBzVRrlsawRg7LkSV7HNTinALSCk1AkwYnyCA80hwpOL/jkNuWS ahWZDgOndrKFI9DBxuvaE4q94JFDtn8Sc3uvLek+xmVnKL60CmgE/RCdS6Bttc5mETjL IN3N14tOyC1FQDn9tc8SCVqi7buDM+Xqwr/f73b8A3eYUSjm+AXdmwJ4CNqMh5KYxfME d/KQ== X-Gm-Message-State: APjAAAVzurbQpbbCiXJiPCVThlzrcuWyBR702Fl2EgYvg8JWRuFwGqRE blPR7serdF+XKGKHoYAXbyGmqw== X-Google-Smtp-Source: APXvYqxU+j1+xlHnj6P2fLF50Lb410pXhhBsb6rKQj4AuFqX2oJBag2M+aAvrATLnXCnjMfqUpdjlA== X-Received: by 2002:aa7:870c:: with SMTP id b12mr17976274pfo.30.1573829527859; Fri, 15 Nov 2019 06:52:07 -0800 (PST) Received: from rfd.leadboat.com (108-233-125-46.lightspeed.sntcca.sbcglobal.net. [108.233.125.46]) by smtp.gmail.com with ESMTPSA id n8sm9452888pja.30.2019.11.15.06.52.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Nov 2019 06:52:06 -0800 (PST) Date: Fri, 15 Nov 2019 06:52:04 -0800 From: Noah Misch To: Thomas Munro Cc: Tom Lane , pgsql-hackers Subject: Re: SimpleLruTruncate() mutual exclusion Message-ID: <20191115145204.GA941210@rfd.leadboat.com> References: <20190218073103.GA1434723@rfd.leadboat.com> <20190628170628.GA1238361@rfd.leadboat.com> <29566.1564419497@sss.pgh.pa.us> <20190801065117.GA2355684@rfd.leadboat.com> <20191104234309.GA375824@rfd.leadboat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191104234309.GA375824@rfd.leadboat.com> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Nov 04, 2019 at 03:43:09PM -0800, Noah Misch wrote: > On Mon, Nov 04, 2019 at 03:26:35PM +1300, Thomas Munro wrote: > > On Thu, Aug 1, 2019 at 6:51 PM Noah Misch wrote: > > > vac_truncate_clog() instance 1 starts, considers segment ABCD eligible to unlink > > > vac_truncate_clog() instance 2 starts, considers segment ABCD eligible to unlink > > > vac_truncate_clog() instance 1 unlinks segment ABCD > > > vac_truncate_clog() instance 1 calls SetTransactionIdLimit() > > > vac_truncate_clog() instance 1 finishes > > > some backend calls SimpleLruZeroPage(), creating segment ABCD > > > vac_truncate_clog() instance 2 unlinks segment ABCD > > > > > > Serializing vac_truncate_clog() fixes that. > > > > I've wondered before (in a -bugs thread[1] about unexplained pg_serial > > wraparound warnings) if we could map 64 bit xids to wide SLRU file > > names that never wrap around and make this class of problem go away. > > Unfortunately multixacts would need 64 bit support too... > > > > [1] https://www.postgresql.org/message-id/flat/CAEBTBzuS-01t12GGVD6qCezce8EFD8aZ1V%2Bo_3BZ%3DbuVLQBtRg%40mail.gmail.com > > That change sounds good to me. I do think $SUBJECT should move forward independent of that.