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 1vnNfK-0069o7-0l for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Feb 2026 21:10:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vnNfI-007Nem-31 for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Feb 2026 21:10:28 +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.96) (envelope-from ) id 1vnNfI-007Nee-1l for pgsql-hackers@lists.postgresql.org; Tue, 03 Feb 2026 21:10:28 +0000 Received: from mail-yw1-x1131.google.com ([2607:f8b0:4864:20::1131]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vnNfF-00000000uoj-3NWE for pgsql-hackers@lists.postgresql.org; Tue, 03 Feb 2026 21:10:28 +0000 Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-790b7b3e594so65045457b3.3 for ; Tue, 03 Feb 2026 13:10:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1770153024; cv=none; d=google.com; s=arc-20240605; b=SuhjfcoY7VbQ+qtvKxZcun3HWGi0aOvg3hZ5OvamswX7N/+GfsmrMDoDFw8547ln2c NvSJLXhxTnwi35Ei46Hphnl7Y801tmF8CC/a6tQxKEz6cxUGKISbVeECoA1ru7AKND5v Kh05eftUc51pCSNcOWYP3Kk0HmDKqWVa1lUGsSOsnjgum8TDbUeKSyfOlWT0a2+WAGNx PO/a3im1qTZKbD26iSEjWIN4eiYg6Mgd+xyDkJl1oHcPVHYsqqT6BbRrMmXXjn/TXgT3 D/nNTmfOv+BsTx2ssE7bAvtXhZxGSislJKWGe4Y8vbOqZXaTyhABcmVo3JIvuTUPK4o5 S/3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=ojftFvILn84UhmXeniIG7XkqWKZLoZT2BgdYS/RV6Pg=; fh=yI7t6nEHbosSIEHQH4Vel6JzqdLqJo9h1nihQGcVDjg=; b=FMIYZl0bn3zJHA8D8qH5Ja9/XGlC+31gmcOjJ1HBMn7tIhnfDuFVQrsymX5BNEh53I +fAJwbbSfC7bOFuNfuVHr8RePGrfwEwg6sHe/sb3fUFuP85U7tawE5DF+MiCHjnSryoc DMO3sQ+Mdaq1VXQVaHmSf1Bznx7m0LmDz38FWUYb5UzQ20ox/7y5QiJl/tio1+BoOgla fd8RbOUBLcQLeRbns/YjHwIGJTi0nVDqxIO8J8ol0e3CZd0WcUdBWFutbQxbb38BEEKm H1sUDPMvaoqDHdhHrrs/E+rxxyks9nPpB4NZwL3ruu2KYrtLjS+TTLS5YC+0x/cn/zLd IvxQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=percona.com; s=google; t=1770153024; x=1770757824; darn=lists.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=ojftFvILn84UhmXeniIG7XkqWKZLoZT2BgdYS/RV6Pg=; b=W0m/YZlHpspFrTTC5eo7pXYKJ87vYnRFuNp4t4Dpay9WpOJT3/Y/x3owUIxg2XnDeK w7XU6yx4Dz5xBUyie8A08zmK9SvNiyKnP5je14ShZW1W9z/3rr2awQSJd+9ps6gGBoR5 dvShlZHsC4vbUmeRo9nZiddakTmlRhv+PIFbE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770153024; x=1770757824; h=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=ojftFvILn84UhmXeniIG7XkqWKZLoZT2BgdYS/RV6Pg=; b=SgFMbW491OR0r4m6jVJkaXqp5DCP1Ohxq1rBAUdDWTraVb0Ca/Xhr29exzE1IB/yz5 8SKTMDpxgh7JpnNbgjI3FYPufe8ClFRWQ+N9Lm+YBkiEsMAsfr0SWjqk2VVdGydy7QN4 m2PNFmepYnZiWre2AgbGWVBOcP16vi3R5ggQMlffUNdpeIMevlssHoHn4Zsjhf8wGMbw BcqD6TgwlESvONbCEqQxj3Ts6cqvwJ4NSSNrINbDCAB16VMKzHTwoYauT7GiD/ssCqKC pXk8NxL88wMW07QquhEoDDQ77BrAS6wMDBOuEIEB4AG8fKwsp8MQTf+GQShs19zDLBoz wU+A== X-Forwarded-Encrypted: i=1; AJvYcCWIDNDk4nJaCJy3SRhjhV1x9JWtkIWlzJ9u7rJeNKnXq5QIVmqVvCOQ+kq+CofKmQ2LJpSkhEgL8KvX+wE/@lists.postgresql.org X-Gm-Message-State: AOJu0Yy9nKhQhO0atQTT5NVqph7bb0p1vQJ79V/atePWqnqrVC8lXLgN wpqUw2sQ5zHsHib8QY9ko1NkAYpT95jdQVpjmZoy1kGHlrNFCxl8JDqcwOwTmksJfznsBtqKKIr XScobsQ1JpnfJUVSLKRb/KCoLJ0nxwO+vnfxA7TwgC5avUgiVN8qJbA7eLViOg9y7TCG0irw6IL EJLUShpRGb1cb1MGsxOWaQk7cBSjaqtInJDw/0eNevDqTX/mCLA4GC5Iy13rch+z4ox8h+oiMOD yEnOOrXYlYpOPVoyyK5bDfKlifMtqOkze5Xo4NBdmEnBOOPjLQ0jctxnd01TY1LD/Y= X-Gm-Gg: AZuq6aLrkxlL1uWUC/uSq9vGL6r3RpJZo03tUEgT4fuq8TxTZsoar0uONc02d5XJufm TZdZ2+lSClV1QSi6XZ98BR4/zFVGRt1kbjcyoUjLCJJ9VAezC80Ax3fE6D7PpJ3R8v20gIc3x3b KOVzNmwworyd064sGbmsYrZwgG+6VqnwQ/DjpE/gNOWLCyOKH7RFo9sqpI6wOfOzW7Q9qcrFQtU hZ/4BYlU3DWF2+EeGFsOk7mxUOLhar3iEOlqpIG2u3AQa1xRDXQ/hxyaA/Vo0DT2D9ZMpVnPXIT yz8dCyg+he2/9dpj33ABr4nDIDc3KksvVz5nDZkQED4mjsWm8JIfjNr9 X-Received: by 2002:a05:690c:4b13:b0:794:b7f1:59f1 with SMTP id 00721157ae682-794fe84f2efmr9590227b3.66.1770153024049; Tue, 03 Feb 2026 13:10:24 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Zsolt Parragi Date: Tue, 3 Feb 2026 21:10:12 +0000 X-Gm-Features: AZwV_QjfFkwxjbrE6iy0fjCUF1YgjmzCautSie_DzSqF-7sRAOglEzft5HBAHp4 Message-ID: Subject: Re: Patch: dumping tables data in multiple chunks in pg_dump To: Hannu Krosing Cc: David Rowley , Ashutosh Bapat , PostgreSQL Hackers , Nathan Bossart Content-Type: text/plain; charset="UTF-8" X-CLOUD-SEC-AV-Sent: true X-CLOUD-SEC-AV-Info: percona,google_mail,monitor X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello! I did some testing with this patch, and I think there are some issues during restoration: 1. Isn't there a possible race / scheduling mistake during restore because of missing dependencies? The code now prints out "TABLE DATA (pages %u:%u)", while the restore code checks for the explicit "TABLE DATA" string for dependency tracking (pg_backup_archiver.c:2013 and a few other places). This causes POST DATA to have no dependency on the table data, and can be scheduled before we load all table data. I was able to verify the scheduling issue with an index: the INDEX part is scheduled too early, before all TABLE DATA completes, but then locking prevents it from progressing, so everything completed fine in the end. Even if that's guaranteed, which I'm not 100% sure of, it's still based on luck and not proper logic, and takes up a slot (or multiple), reducing parallelism. 2. Fixing the TABLE DATA strcmp checks solves the scheduling issue, but it's not that simple, because then it causes truncation issues during restore, which needs additional changes in the restore code. I did a quick fix for that by adding an additional condition to the created flag, and with that it seems to restore everything properly, and with proper ordering, only starting index/constraint/etc after all table data is completed. However this was definitely just a quick test fix, this needs a proper better solution. Other issues I see are more minor, but numerous: 3. The patch still has lots of debug output (pg_log_WARNING("CHUNKING ...")); Is this intended? Shouldn't these be behind some verbose check, and maybe use info instead of warning? 4. The is_segment macro should have () around the use of tdiptr 5. There's still a 32000 magic constant, shouldn't that have some descriptive name / explanatory comment? 6. formatting issues at multiple places, mostly missing spaces after if/while/for statements 7. inconsistent error messages (not in range vs must be in range) 8. There's a remaining TODO that seems stale, current_chunk_start is already uint64 9. typo: "the computed from pog_relation_size" -> "then computed from pg_relation_size"