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 1to7KX-006KQp-TS for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Feb 2025 20:51:34 +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 1to7KY-00FpcY-HY for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Feb 2025 20:51:33 +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 1to7KY-00Fpbe-7I for pgsql-hackers@lists.postgresql.org; Fri, 28 Feb 2025 20:51:32 +0000 Received: from mail-io1-xd30.google.com ([2607:f8b0:4864:20::d30]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1to7KU-000EX8-2G for pgsql-hackers@postgresql.org; Fri, 28 Feb 2025 20:51:31 +0000 Received: by mail-io1-xd30.google.com with SMTP id ca18e2360f4ac-8560dea3ceeso70145939f.2 for ; Fri, 28 Feb 2025 12:51:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740775890; x=1741380690; darn=postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=QEI7Vv9dFOWMTZZGDtDtTusQSYz1yNPizzaG7si5G7M=; b=N8EM49hsam0hpMZ7S3VYO1XOdDihkzVk03GpZIFoDFbldShXIu9+vpZt4tfaej52Bj DLqpljimCrVYLAUGte3mVFb9JDfcVCsSdUSSKbiVVdGawrZH7p+U74TioPnSC/WOLRHy +TkXAeAKGDc6U6CZw0JC94XtOArG1sQ1vX8t7JX3J70olkvy/vWO80obx6LUddLDY5ey u3Prb2TK8JH3eFarpdzgbbKxNtFlBczSyHfu9UCiafFLpBJ+qczeVo84ShUkmoWU6f3n YtMF0ULK4tt7dewmEsgLlaRa+pLi6xIAv9KiLwZMMntZDx5JWKRCL9hUR84UbgmjoEj0 WJbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740775890; x=1741380690; h=in-reply-to:content-transfer-encoding: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=QEI7Vv9dFOWMTZZGDtDtTusQSYz1yNPizzaG7si5G7M=; b=c4kJqFNmbnumXUWHAG/BQY9+w6wEoZYlTgZHNXOeDgjScZYYCD6pzkGH7JPkKSlW0J 6iY7fS/VK14nYwh0jV6FUmO7E/zXaDRIa+X+0MsW9s8hGjOEBwlb69xF1+buFoaiCaAb Du6KVMA5d8m74WrwpPVuoZChaTVbHHcSgHwAmiBm9wWEatiqgNqjtyqVZdvgyOfiLIZY sEs8TdoYRD5EYcaboqn4RWCnTcWxwrwRw1UMNJNGFcD9oldN5fVb8ESsUrcloGu8Ybap haiBkV9hMtqD8hs8UGdpVq980CM++1cqMM3kwkLOAL2QCJ79dZs9GnwxC1GLn/b+CqlT rLnQ== X-Gm-Message-State: AOJu0Yw5Qdwdxb1EicHUXXs3sZ0scpTQgTNoithsbz1ZEqKleggbvO7k gddjOUgzJ0THeEJ2B+G4Z2ig91Zu3k4RYeTCoOmuHbvg4HbqUgC3 X-Gm-Gg: ASbGncsfYy60NZxP1HU7BI7Egzz52Pwj4bZm69DEYc4vFPY42RdavvORTQw5oL70ELb mE0r8qWjSWwfRNQkfRQpno+Cx1kXcGpceeQn4X39BjUQlUWiKUk+LsgrXfQqCFMP7otqghQt7ix LbpxP2GoI4IAUhmnAR+c1ruosaLUE5Ov8AsDzeoOR1yyxGzm1YEf6WLla3zqhvKkzv3V3N3QH8E lkq6nTnefQJcY4NPV0o8ZjwTE2y1mBIe567fke7Et9c68BVpjL4I9e8qT7Q6huPX9L0qLDxZEqE riI/7WwdKItmgfw7aicOzfbngT8C9p7fj64Y+GnduDLUnQt8nBm0JKpentPwZhM/QvKwiHMeFvn 7ncvgPG5WKvqXuqXM X-Google-Smtp-Source: AGHT+IGG3ksQu/rKN4Sdep2YsHXQD5T2SEUTJFa8NQynnmSqUoJbUHfbI0FLQAHum8oPJ+wOtSKtJw== X-Received: by 2002:a05:6602:2c8c:b0:858:716b:4986 with SMTP id ca18e2360f4ac-85881f1a2f9mr618625039f.6.1740775889768; Fri, 28 Feb 2025 12:51:29 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-85875133eb0sm96422639f.27.2025.02.28.12.51.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Feb 2025 12:51:29 -0800 (PST) Date: Fri, 28 Feb 2025 14:51:27 -0600 From: Nathan Bossart To: Robert Haas Cc: pgsql-hackers@postgresql.org Subject: Re: optimize file transfer in pg_upgrade Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Feb 28, 2025 at 03:37:49PM -0500, Robert Haas wrote: > On Fri, Feb 28, 2025 at 3:01 PM Nathan Bossart wrote: >> That's exactly where I landed (see v3-0002). I haven't measured whether >> transferring relfilenodes or dumping the sequence data is faster for the >> existing modes, but for now I've left those alone, i.e., they still dump >> sequence data. The new "swap" mode just uses the old cluster's sequence >> files, and I've disallowed using swap mode for upgrades from > the sequence tuple format change (along with other incompatible changes). > > Ah. Perhaps I should have read the thread more carefully before > commenting. Sounds good, at any rate. On the contrary, I'm glad you independently came to the same conclusion. >> I'll admit I'm a bit concerned that this will cause problems if and when >> someone wants to change the sequence tuple format again. But that hasn't >> happened for a while, AFAIK nobody's planning to change it, and even if it >> does happen, we just need to have my proposed new mode transfer the >> sequence files like it transfers the catalog files. That will make this >> mode slower, especially if you have a ton of sequences, but maybe it'll >> still be a win in most cases. Of course, we probably will need to have >> pg_upgrade handle other kinds of format changes, too, but IMHO it's still >> worth trying to speed up pg_upgrade despite the potential future >> complexities. > > I think it's fine. If somebody comes along and says "hey, when v23 > came out Nathan's feature only sped up pg_upgrade by 2x instead of 3x > like it did for v22, so Nathan is a bad person," I think we can fairly > reply "thanks for sharing your opinion, feel free not to use the > feature and run at 1x speed". There's no rule saying that every > optimization must always produce the maximum possible benefit in every > scenario. We're just concerned about regressions, and "only delivers > some of the speedup if the sequence format has changed on disk" is not > a regression. Cool. I appreciate the design feedback. -- nathan