Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sMGW1-001PNG-2W for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Jun 2024 00:28:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sMGVz-00184E-6j for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Jun 2024 00:27:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sMGVy-001845-TY for pgsql-hackers@lists.postgresql.org; Wed, 26 Jun 2024 00:27:59 +0000 Received: from mail-yw1-x1135.google.com ([2607:f8b0:4864:20::1135]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sMGVs-0038Xo-H9 for pgsql-hackers@lists.postgresql.org; Wed, 26 Jun 2024 00:27:57 +0000 Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-63bce128c70so269447b3.0 for ; Tue, 25 Jun 2024 17:27:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1719361671; x=1719966471; darn=lists.postgresql.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=sd0ajP7LgH4EPpohfQDuUGVixppOSW30f+x3N+L0fXM=; b=c4JhmwXYYs6YYPt+zM05n1tzZDOwAwp/c82s0rrny/7los3Z6KKvwO1EXu7tKT9unR /71QkEjh1j2Bp5Hd5hT3CeTMab8dU5E2qcCNK1lSxaIEqm0CseSYvbhkmi43AjzTUoV3 cpC2bZJ8ws6uo1FTgBvso/J//mdFXngPI5jSc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719361671; x=1719966471; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sd0ajP7LgH4EPpohfQDuUGVixppOSW30f+x3N+L0fXM=; b=pjPw7JyGW847FUNiVO+CDLgNRXtIKw51bSD8+icrOEVwM8iCzk89pueY7sS9rSCY5z 4yR2iaErzsuCY5SwXsOvjdwyAZoMv/lc6bjVqB8HiI8GgcI2WUQ3DdsWpsGEm20fNrlB wwBBag2HJM67e4/HXtvoK8yJxDSzKR4htrzxVKf04fXYHWhNBvGP6h2ne0oLDRUg97FG 2mR0ghLzK0RZE0uNMLUQVk+/m+kP4hGwcAXVAvCwb6U+CoZbu6Z1N+HTb0loJGERwwO3 2oHHiC3BCJ0Xel2S1LyvhXbPQwExoScZaQIC4l8AwyULyjnVhHw4mvw/iaWrTEFeZu8Y 2Anw== X-Forwarded-Encrypted: i=1; AJvYcCWqpiHrswTiRpRWuRDJXqflk48XpfjLAxP6CTVs/Kwaohe3giW1pnrdKp6XLUHsYQwZCzlf0NMXQnewLertwUyXIw2pQaR+1CMUJUCVkYwmKvMZ X-Gm-Message-State: AOJu0Yzunfx+UKyXDng5MynjQLcT9XeuCA+NMuH5pb7tJsTIERlDY37c W4AIJkcjU3SSmyyFZEzKhj73Wv84/v2A4q3O6h3M7ZrRCc8ES+ii2qiK6mAwTp4cFuoF8syK6K5 syQ== X-Google-Smtp-Source: AGHT+IFMSHYxRx8ZLNbfG60sh8tctFMdHQkTCZltHRkB+66A2KgmLyIAgQcT6C8HULHjdIkzBzsQFA== X-Received: by 2002:a81:8d4d:0:b0:631:399f:2e87 with SMTP id 00721157ae682-6424bf5370emr69881487b3.16.1719361671307; Tue, 25 Jun 2024 17:27:51 -0700 (PDT) Received: from google.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6447b22709fsm19881327b3.33.2024.06.25.17.27.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jun 2024 17:27:50 -0700 (PDT) Date: Tue, 25 Jun 2024 17:27:47 -0700 From: Noah Misch To: Alexander Korotkov Cc: Maxim Orlov , Aleksander Alekseev , Postgres hackers , Heikki Linnakangas , Japin Li , Andres Freund , Michael Paquier , Pavel Borisov , Peter Eisentraut Subject: Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15) Message-ID: <20240626002747.dc.nmisch@google.com> References: <4dd273c5-f594-1c04-3710-5811e62b18db@iki.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.12 (2023-09-09) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Nov 27, 2023 at 01:43:26AM +0200, Alexander Korotkov wrote: > v61 looks good to me. I'm going to push it as long as there are no objections. This yielded commit 4ed8f09 "Index SLRUs by 64-bit integers rather than by 32-bit integers" and left some expressions coercing SLRU page numbers to int. Two sources: grep -i 'int\b.*page' $(git grep -l SimpleLruInit) make && touch $(git grep -l SimpleLruInit) && make PROFILE=-Wconversion 2>&1 | less -p '.int. from .int64. may alter its value' (Not every match needs to change.) > --- a/src/include/access/slru.h > +++ b/src/include/access/slru.h > @@ -127,7 +127,15 @@ typedef struct SlruCtlData > * the behavior of this callback has no functional implications.) Use > * SlruPagePrecedesUnitTests() in SLRUs meeting its criteria. > */ > - bool (*PagePrecedes) (int, int); > + bool (*PagePrecedes) (int64, int64); > + > + /* > + * If true, use long segment filenames formed from lower 48 bits of the > + * segment number, e.g. pg_xact/000000001234. Otherwise, use short > + * filenames formed from lower 16 bits of the segment number e.g. > + * pg_xact/1234. > + */ > + bool long_segment_names; SlruFileName() makes 15-character (60-bit) file names. Where does the 48-bit limit arise? How does the SlruFileName() comment about a 24-bit limit for short names relate this comment's 16-bit limit? nm