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 1tpue0-00E7S0-0z for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Mar 2025 19:43:04 +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 1tpudx-003N2A-V9 for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Mar 2025 19:43:01 +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 1tpudx-003N22-Kn for pgsql-hackers@lists.postgresql.org; Wed, 05 Mar 2025 19:43:01 +0000 Received: from mail-il1-x132.google.com ([2607:f8b0:4864:20::132]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tpudv-001AEc-2i for pgsql-hackers@postgresql.org; Wed, 05 Mar 2025 19:43:00 +0000 Received: by mail-il1-x132.google.com with SMTP id e9e14a558f8ab-3d2a8c2467eso25682435ab.3 for ; Wed, 05 Mar 2025 11:42:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741203779; x=1741808579; darn=postgresql.org; h=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=lx+JmIL1YUtNwRxduWr5gRQMBAVF/nsYNvykSnHQ2UE=; b=C4W8PjA2JsH+/PsoQ0Sxo7QG1xRBIXxmm14oYOkZ2u/631Miiz6Lrvm/U7uqW3qOFH IpW5owWoAFhNIb9oY3SSXNsw0F5FQVdigEjSvlK8B9A9ZRFCrnZ0dADdVT1DtwHJDv6E hov/Fu/eCKDPLtK1t0/U+TNDnlcawkAopRJWrSCAehfh92KfAfAqhDTZkW+CkB5FJDZA RrrBOeedfQA2SuxKO7er0d450MMD9y1CFfqylKKntJU9NoiGVzqtI4ZW9VkUlH/DB8wK 1hJ6SPHm9j8BqinPcpbLHR7JTNkcU/Q3uCLbEyfj7RTe9ikdMh9Fbbp5LFXGXim5I9d7 6BnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741203779; x=1741808579; h=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=lx+JmIL1YUtNwRxduWr5gRQMBAVF/nsYNvykSnHQ2UE=; b=QysApLeJs99P37a6enrYiPAAmGz84iAP65Hy+znRznrvZp7Foi0q9zWzJuqDZ+w9Se JhbT9GIFKdTLmWdAYsnpcMmAyMRtRNURiWPLTWic9dCo1PtYeEHBsG0iF0SoY1w+mZee VFUt5nTf19qSezcWev/AYWbBLyunuMy/CJigo3kQD1GAAtartAIedrYVDmThuMOgcwoZ CB7+0qZJcKmXiSmCboGBpz+S7jad+yaf6Il2kPJUF407UiAm2wbWqHtAopaW8AMc6SpA x/6swZmbQCVfKNv98JXpsBT6dSYDMaMd6qunLyYzVzNET+iddubM43i3sGXQkago3aVF HWFw== X-Gm-Message-State: AOJu0YypbUUJ2Q3TBjYzu/dgUYgCv7sd4fvEiX6UsPj1Svpbf3Y/69AL 5Wq68wWmKtoXA6S1kiqfxzyOjJBCuu2Nvtr2zXh8pSQZjc2WEcjsfWU5Hw== X-Gm-Gg: ASbGncuNGnN3bvvqej3pjFIjLR9gay4WyIJlC8bAdYtlXr7yMDb7z+BSLkZE4OryzQB xIVTkW1r+fidbf87GuuyVHbUQ8sko5/ZuH8wSXQjp8HbcHo9KdnL4MB+5zk1Ir10SODsWIoVmmO 1nJMrKeqWef49+V0uliBwXE5eH7iB7cvP+U+djWD/9tX0qBPZeqMXa/vUgYmkjEfswpylLYOJUp QK9dlVviG11WEUmG4U1frl05+toE0KQf6fwbFW1ciTTn8zS6WhLdniGjAkrWjBJrhjFURQIhFTC 1O2Vq8F6/style47cCiwpda01w3T0zzWSQzQlsHgTbPRbPRaTFbZHT54NTQDpMr8cPBmTs1SwPC TteAzhjsSzy3ZW/bjHwBmLyCiQr9z4ClH1dw= X-Google-Smtp-Source: AGHT+IElOS8iXz14Zea374JIbByAhnDWk/fmK+gUXMOeJJ71/sPGKNBDYPsB8W4CP5bHJegvC+u7Vg== X-Received: by 2002:a05:6e02:3d86:b0:3d1:79ec:bef2 with SMTP id e9e14a558f8ab-3d42b8a5d08mr56233595ab.6.1741203779153; Wed, 05 Mar 2025 11:42:59 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4f1e571326dsm1370007173.68.2025.03.05.11.42.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Mar 2025 11:42:58 -0800 (PST) Date: Wed, 5 Mar 2025 13:42:56 -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=us-ascii Content-Disposition: inline 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 02:51:27PM -0600, Nathan Bossart wrote: > Cool. I appreciate the design feedback. One other design point I wanted to bring up is whether we should bother generating a rollback script for the new "swap" mode. In short, I'm wondering if it would be unreasonable to say that, just for this mode, once pg_upgrade enters the file transfer step, reverting to the old cluster requires restoring a backup. I believe that's worth considering for the following reasons: * Anecdotally, I'm not sure I've ever actually seen pg_upgrade fail during or after file transfer, and I'm hoping to get some real data about that in the near future. Has anyone else dealt with such a failure? I suspect that failures during file transfer are typically due to OS crashes, power losses, etc., and hopefully those are rare. * I've spent quite some time trying to generate a portable script, but it's quite complicated and difficult to reason about its correctness. And I haven't even started on the Windows version. Leaving this part out would simplify the patch set quite a bit. * If we give up the idea of reverting to the old cluster, we also can avoid a bunch of intermediate fsync() calls which I only included to help reason about the state of the files in case you failed halfway through. This might not add up to much, but it's at least another area of simplification. Of course, rollback would still be possible, but you'd really need to understand what "swap" mode does behind the scenes to do so safely. In any case, I'm growing skeptical that a probably-not-super-well-tested script that extremely few people will need and fewer will use is worth the complexity. -- nathan