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 1rTNQ9-002Rdw-NG for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jan 2024 14:43:06 +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 1rTNQ7-00GdN6-Bh for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jan 2024 14:43:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rTNQ7-00GdLZ-1Z for pgsql-hackers@lists.postgresql.org; Fri, 26 Jan 2024 14:43:03 +0000 Received: from mail-yw1-x1130.google.com ([2607:f8b0:4864:20::1130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rTNQ4-003q0h-9Y for pgsql-hackers@postgresql.org; Fri, 26 Jan 2024 14:43:02 +0000 Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-5ff7a8b5e61so4142007b3.2 for ; Fri, 26 Jan 2024 06:42:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706280178; x=1706884978; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=FAq5D/NWpNxv+Rby8VPJRMeSIu+Lqw5ADcpkRGUPgMU=; b=LW0kMisMXizCVKR05e/kzQnFahamqFvjZYvdHIgHWJSoWMRzY6yAXBzSeXW8DsnLUN MmzOaNnpFLiO3rhiDbBe+0eKQkMAKVeyAl7OW0cBeCjcQu2+O1n7fCabmqe52yq+irh4 hQP4XEC79pX1pBkOlY85jvDHYcDUo5RyWLRy6J6nwtNd6erScbAURjYKLJIeBKGGdkys fgraM0mcpGScUqMOx+mLB7KewKh5/v6jD2csiSyZk6MpfGUz3UJ/d/joPdPgaXyhpz4x y3MiHLDj/1BcNPz3jpPA+u2Xux4+wbNF+pWv5cRR5wqUc8o798LxYG9R3RCZOS4nebUz OfdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706280178; x=1706884978; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FAq5D/NWpNxv+Rby8VPJRMeSIu+Lqw5ADcpkRGUPgMU=; b=B4DwEa8CgcpFdgDTIXg3mzPTXj2P2DcWp36gqsSEicLkPxxo8akKZtQIuj1VbNSE/A mY0dm5TlsUoIVk7+8eaLoIbPwiYf+F+th/1wCtXU0d5LuIAgBT9YGuId2YZBa0xZRl+s dkJKG1iZTKeGFhQe3q1b9U6Z5IGesqRoQ6XEJLoWfP3qb6amyLVXXtsDF7+Vw7/JWTzA 4Gb2cMIX0ig1wwAeeG0yGcI7uFlA46N6jMt25B3+cfi0L6IubLonkctrQONIb7oj2W5Q jr7bHU5C+lFZl7XLDhgzQRf6roAwekY1q+Hq0ORWNbztqKbdo5ycUxU09Sf8sSNKxIoa vmPA== X-Gm-Message-State: AOJu0YzxrkzGBN1RraJnsnPZmnS2gb6Fk7w6GfrzJ8OYrk6b1Xql4nwv l2zN/awUIMwhK3WmcDLK+RiQKfaluQUMenkcXzN352d0r7dg8Kc7aFgPTVMFIzbFEsGcx0MhitK hlv9X1oC/5AIyUJSwZNUYUf/bd68= X-Google-Smtp-Source: AGHT+IGkZ/Ujx4LHUG/N72ZnZd/GuWuxPYo+rXyHSbtY4tlCplZPELmJcTwqKH6MvnZaGzX8FHkmFUXRNIKbYYG5rDo= X-Received: by 2002:a81:4146:0:b0:5ff:86e9:e259 with SMTP id f6-20020a814146000000b005ff86e9e259mr1296720ywk.16.1706280176397; Fri, 26 Jan 2024 06:42:56 -0800 (PST) MIME-Version: 1.0 References: <986904.1616525964@sss.pgh.pa.us> <6cccaa33-c263-b8a2-b064-985605d33d25@wi3ck.info> <988415.1616528159@sss.pgh.pa.us> <872315a8-99fc-da4e-463d-784cfb5a025d@wi3ck.info> <1010642.1616532950@sss.pgh.pa.us> <802b96e9-f5e1-015c-dfb9-8756974b11fc@wi3ck.info> <0263bf35-05d6-02a1-519b-b7895a918314@wi3ck.info> <20220825003227.GA1456581@nathanxps13> <663393ca-b2ff-26f0-2e2d-adc942aff4fd@timescale.com> <20220908231807.GA2242918@nathanxps13> <0643CC11-223A-4039-AC34-94E127462796@amazon.com> <1152134.1699555261@sss.pgh.pa.us> <83D44BE5-0088-4D41-8AE6-20A05D026F46@amazon.com> <81D13E16-BA04-43CF-9B89-B8924300B211@amazon.com> <240D05EC-8B28-4112-BEAB-85ECBAF3F871@amazon.com> <2055911.1702258962@sss.pgh.pa.us> <557FD681-3929-44A1-87B2-6B5E10C4A66B@amazon.com> In-Reply-To: <557FD681-3929-44A1-87B2-6B5E10C4A66B@amazon.com> From: vignesh C Date: Fri, 26 Jan 2024 20:12:44 +0530 Message-ID: Subject: Re: pg_upgrade failing for 200+ million Large Objects To: "Kumar, Sachin" Cc: Tom Lane , Robins Tharakan , Nathan Bossart , Jan Wieck , Bruce Momjian , Zhihong Yu , Andrew Dunstan , Magnus Hagander , Peter Eisentraut , "pgsql-hackers@postgresql.org" Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2 Jan 2024 at 23:03, Kumar, Sachin wrote: > > > On 11/12/2023, 01:43, "Tom Lane" > wrote: > > > I had initially supposed that in a parallel restore we could > > have child workers also commit after every N TOC items, but was > > soon disabused of that idea. After a worker processes a TOC > > item, any dependent items (such as index builds) might get > > dispatched to some other worker, which had better be able to > > see the results of the first worker's step. So at least in > > this implementation, we disable the multi-command-per-COMMIT > > behavior during the parallel part of the restore. Maybe that > > could be improved in future, but it seems like it'd add a > > lot more complexity, and it wouldn't make life any better for > > pg_upgrade (which doesn't use parallel pg_restore, and seems > > unlikely to want to in future). > > I was not able to find email thread which details why we are not using > parallel pg_restore for pg_upgrade. IMHO most of the customer will have single large > database, and not using parallel restore will cause slow pg_upgrade. > > I am attaching a patch which enables parallel pg_restore for DATA and POST-DATA part > of dump. It will push down --jobs value to pg_restore and will restore database sequentially. CFBot shows that the patch does not apply anymore as in [1]: === Applying patches on top of PostgreSQL commit ID 46a0cd4cefb4d9b462d8cc4df5e7ecdd190bea92 === === applying patch ./v9-005-parallel_pg_restore.patch patching file src/bin/pg_upgrade/pg_upgrade.c Hunk #3 FAILED at 650. 1 out of 3 hunks FAILED -- saving rejects to file src/bin/pg_upgrade/pg_upgrade.c.rej Please post an updated version for the same. [1] - http://cfbot.cputube.org/patch_46_4713.log Regards, Vignesh