Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15) - Mailing list pgsql-hackers

From Japin Li
Subject Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)
Date
Msg-id MEYP282MB16695F792FFBAF748592DABEB6FB9@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
Whole thread Raw
In response to Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)  (Maxim Orlov <orlovmg@gmail.com>)
Responses Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)  (Maxim Orlov <orlovmg@gmail.com>)
List pgsql-hackers
On Mon, 19 Dec 2022 at 22:40, Maxim Orlov <orlovmg@gmail.com> wrote:
> Hi!
>
> As a result of discussion in the thread [0], Robert Haas proposed to focus
> on making SLRU 64 bit, as a first step towards 64 bit XIDs.
> Here is the patch set.
>
> In overall, code of this patch set is based on the existing code from [0]
> and may be simplified, due to the fact, that SLRU_PAGES_PER_SEGMENT is not
> meant to be changed now.
> But I decided to leave it that way. At least for now.
>
> As always, reviews and opinions are very welcome.
>

For v51-0003. We can use GetClogDirName instead of GET_MAJOR_VERSION in
copy_subdir_files().

diff --git a/src/bin/pg_upgrade/pg_upgrade.c b/src/bin/pg_upgrade/pg_upgrade.c
index 1c49c63444..3934978b97 100644
--- a/src/bin/pg_upgrade/pg_upgrade.c
+++ b/src/bin/pg_upgrade/pg_upgrade.c
@@ -857,10 +857,7 @@ copy_xact_xlog_xid(void)
         pfree(new_path);
     }
     else
-        copy_subdir_files(GET_MAJOR_VERSION(old_cluster.major_version) <= 906 ?
-                          "pg_clog" : "pg_xact",
-                          GET_MAJOR_VERSION(new_cluster.major_version) <= 906 ?
-                          "pg_clog" : "pg_xact");
+        copy_subdir_files(GetClogDirName(old_cluster), GetClogDirName(new_cluster));
 
     prep_status("Setting oldest XID for new cluster");
     exec_prog(UTILITY_LOG_FILE, NULL, true, true,

-- 
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.



pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: moving extraUpdatedCols out of RangeTblEntry (into ModifyTable)
Next
From: Jeff Davis
Date:
Subject: Re: Rework of collation code, extensibility