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.96) (envelope-from ) id 1vRW5b-00Et5i-1x for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Dec 2025 13:43:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vRW5Z-008Blj-3B for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Dec 2025 13:43:14 +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.96) (envelope-from ) id 1vRW5Z-008Bla-2F for pgsql-hackers@lists.postgresql.org; Fri, 05 Dec 2025 13:43:14 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vRW5X-003HjX-1W for pgsql-hackers@lists.postgresql.org; Fri, 05 Dec 2025 13:43:13 +0000 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-42e2d5e119fso983019f8f.2 for ; Fri, 05 Dec 2025 05:43:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764942191; x=1765546991; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=YLUVulrM4qaHYoj/exIagAxm/7jEp3wyzpM+BDySmUk=; b=nMTel0NfkBQxId/f+AQwGzapNdEfGL3U/dFlsi98Kow9WF6uN7JDVigzJRsYKsgKsR KQkyiV3P9x5zIjh8j8S4cbut4JMZWJZH9F0hAd2GCBfM1qDqkiy4N7K5ZzBv5b5D34WG lG+wRUsAwa3meaA0ppaSHuF7vXRUZhqMRF9sadjFZX2kst90aBu8XsGjthhAX2yXxDrD LUa5h2Cbx8V7qWE1WBDT6IcJ6CRzXijpyM6BPk6ugPEbMDID1KS4q61vFjlbMIa/kx4r JutgGY46F2Sd9NwQaLlTdu82j3pkj8oHubdWqMhsN4+rXv0F9u8/XpUvVrYuhNE0Qq8H G85Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764942191; x=1765546991; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=YLUVulrM4qaHYoj/exIagAxm/7jEp3wyzpM+BDySmUk=; b=iGyTIOjuOaqojimE423nENz0icxm+xSaouJSCWv3S4YTXp2YF7RrA/ltSO/fo9R6jh wZuXltfPp1nHP1NYywMeWX8zM057OXYq2zrdegekEBhv+RfrSYa/QEk/bZGQCQ4Vzhm8 Oxqq4S9w5PaZ1cGTPn2fIQI0WZo9bvdff6x0yDfZlKkSOgRxdNLE/miRAoV4YZAQftdw zM5fdqTm7TAKEUyAQi5rB/rpRj9V1dIyV3J+JpRgXwkh3umbHZpXUe7khqrfxF1Oc0PB 3+2nu7hvarVcmrXWvtMJPDebGeSq00SorwMqfB37YdPlGNZHaZwbEjv6LHgLAGrYDOqE ja8w== X-Forwarded-Encrypted: i=1; AJvYcCW3VZoQmyp5LcSbgjAKo3y/f+SCo9gnSg6ctMWllIezQRHc0F/R2XOuSse647mjawSB5dm7E49prx1+fpVe@lists.postgresql.org X-Gm-Message-State: AOJu0YwLJNAHDlvy6hYMtR5IQeMuIDEidPy6Xbafsh8tBivxNl9c4D9R xq+GlAxN/bSa72lgT9rTvW6Ka85PUyZwQBJfSw1huFjw1gaTvfatoTWsURzlQYV1RrNsi0sf8BZ agS2Zq9A39jfdHPg6Coa0y2DLFSalELw= X-Gm-Gg: ASbGncuKYx8WVE/YoIP14qb6VxaiXZ6O15yIYOkf0i6FjnLp25b+X+VKxjgykLm7anf 9Ce5rY7ueCeJN8VLDU+6WG341fknav1njR+YjdlkefPjIkOrBgbci7fdKMpscEnSfSaRdTDDk+T LlyLrWE7IEfAr0ekxVcJLTm4ygdhTOrihNo7G7b//I1ZieHy/5qajexB1Vl56jTp8Leh58KgkSx ffZHfvljxPeRTtJu7bZT06vXFKgTZEILj2O1ynLRRqv5Ww28OSvU2cHlZG61KG5PhypRe4/6dyA l0UqNFK0 X-Google-Smtp-Source: AGHT+IHop1lJjg+rauu+FT3jvPQRtOUsEX7v+pO/IoFcexB+vTdFlanESZMVjpOZacc2kBd8kWrdRxUeow/OetHqKys= X-Received: by 2002:a05:6000:2085:b0:42b:397f:8dd4 with SMTP id ffacd0b85a97d-42f731f68cbmr11331333f8f.49.1764942190618; Fri, 05 Dec 2025 05:43:10 -0800 (PST) MIME-Version: 1.0 References: <4535f3aa-3220-4760-b1f5-2bc91f248e03@iki.fi> <2bc58592-9d74-4af0-bdd1-1a88e8683f7c@iki.fi> <36531c0e-292c-409d-bbc7-a252cf6e910a@iki.fi> <54aa8f65-f0e4-4464-b543-e0399c1cab1e@iki.fi> <4a9dda70-0af7-41a4-9636-b168f2fc48ef@iki.fi> <46cc45e9-fddd-44bc-bcb3-96889aafd921@iki.fi> <6c298bc4-7029-4c1d-bf16-3e094842ce32@iki.fi> In-Reply-To: From: Ashutosh Bapat Date: Fri, 5 Dec 2025 19:12:57 +0530 X-Gm-Features: AQt7F2r6xA0JqQI3ENoW_e1JuMioF9Vhr01QWNmjLvnSNEaoKwmcfPbhEGgJXmI Message-ID: Subject: Re: POC: make mxidoff 64 bits To: Heikki Linnakangas Cc: Maxim Orlov , Alvaro Herrera , Alexander Korotkov , wenhui qiu , Postgres hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Nov 28, 2025 at 6:35=E2=80=AFPM Ashutosh Bapat wrote: > > > I will continue reviewing it further. > There is duplication of code/functionality between server and pg_upgrade. With it we carry all the risks that come with code/functionality duplication like the copies going out of sync. There may be a valid reason to do that but it's not documented in the comments. At-least both mutlixact_new.c and slru_io.c are not as well commented as their server counterparts. I understand that the SLRU code in the server deals with shared memory which is not needed in pg_upgrade; pg_upgrade will not need more than one buffer in memory and pg_upgrade code doesn't need to deal with lock and it can not deal with locks. That means the code required by pg_upgrade is much simpler than that on the server. But there's also non-trivial code which is required in both the cases. WIll it be possible to extract parts of slru.c which deal with IO into slru_io.c, make it part of the core and then use it in pg_upgrade as well as slru.c? Or whether it's possible to make SLRU use local memory? And throwing some FRONTEND magic to the mix, we may be able to avoid duplication. Have we tried this or something else to avoid duplication? Sorry, if this has been discussed earlier. Please point me to the relevant discussion if so. -- Best Wishes, Ashutosh Bapat