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 1iRm0H-0001Dm-Qi for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Nov 2019 23:43:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iRm0E-0000OX-3s for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Nov 2019 23:43:18 +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 1iRm0D-0000OP-Gh for pgsql-hackers@lists.postgresql.org; Mon, 04 Nov 2019 23:43:17 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iRm09-0004YY-Pl for pgsql-hackers@postgresql.org; Mon, 04 Nov 2019 23:43:16 +0000 Received: by mail-pg1-x544.google.com with SMTP id k13so1335539pgh.3 for ; Mon, 04 Nov 2019 15:43:13 -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=djxSgaohCW4vB1w3v7fNuZbUhgM2CK+oc/OpIr+A++c=; b=Hy6r5qlDCuC9/bKJt00Bvl0uLfJ2u0OE4Uc4OJTpmWaPyXXfm/PT+SdKL/P+BwqRok ToNySb5uu90PUTDgLNzqZ5kgc3y4FbVLv21Gsi5P5ZIb1r37GGON69WZR4m5NGQGmoQ0 8KmOtbUtHwJdGaSk4Hi67U4bMAYQXR+4GrJg8= 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=djxSgaohCW4vB1w3v7fNuZbUhgM2CK+oc/OpIr+A++c=; b=AHy173KmB55EA+CVnVmiKSLWtEbrNFLXiqZz035/+2M8bYLkPhs5OdiVs8ygVYUHnq mrCxshrEZYwmTws9uum9NA+bJYsOVc4dpzx5z7kdLzmk5GvdH0AjaX5RhR+dgoNiiGNe OYJ5JP150biRCaAxKI1RsFWZNT1y1OwzlI8QPZho9IcPrALkHfUWQ3G7XabICIOpEKHE sjn4WExdTV+xHfKXqPBxm74Y3Bl8gccLU7pnQepPadX3VfRR+5bFrLW3ju0K2jDohWNJ tKhcTBP9durq9XDqKAEfpCJw0cadOjppdfrv0VOhMoiwuILX99Q/k+my3nSomqalRn8E zKwA== X-Gm-Message-State: APjAAAUYJcuaaGeqb3Ko3Uodj3Ij/yheextR/Vf2pGsbffQ///tF3Qel NDYgxsyThtE/ekZ5ZwLsiFlDcQ== X-Google-Smtp-Source: APXvYqwmaEFHgdKCzge90W6HvlU9Ofu+Oc47KMKpBI0tjIgwmBKQsRgYGHRYyvaACiH+z31aWECHuw== X-Received: by 2002:a63:cf4d:: with SMTP id b13mr32260008pgj.396.1572910992335; Mon, 04 Nov 2019 15:43:12 -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 j126sm26423347pfg.4.2019.11.04.15.43.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Nov 2019 15:43:11 -0800 (PST) Date: Mon, 4 Nov 2019 15:43:09 -0800 From: Noah Misch To: Thomas Munro Cc: Tom Lane , pgsql-hackers Subject: Re: SimpleLruTruncate() mutual exclusion Message-ID: <20191104234309.GA375824@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: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.