Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jInRv-0008TL-A8 for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Mar 2020 05:59:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jInRu-0005bH-0Z for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Mar 2020 05:59:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jInRt-0005Yf-92 for pgsql-hackers@lists.postgresql.org; Mon, 30 Mar 2020 05:59:01 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jInRq-0001xY-TH for pgsql-hackers@postgresql.org; Mon, 30 Mar 2020 05:59:00 +0000 Received: by mail-pg1-x541.google.com with SMTP id t24so8167100pgj.7 for ; Sun, 29 Mar 2020 22:58:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=JRXc2rx0g/WmhkErBDGPZOILu1yRF++VrJnqgEkhR8Q=; b=eXtqRYEY/sNrUeKyy41/UhQZ/uhjW2n9G37Tarz0Z5wWIFFjhhybx7Kd/2/9Gn0EHr UY3hbc/h07PAV5m35VWi1S5dgKa4BxfHmy3zK+b/oAoUKeAc9gr9s4ZE8ORVOb/4fpR/ rkc7pi49FUOdsdP/nWYLphv39ltpDzslKSnEs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=JRXc2rx0g/WmhkErBDGPZOILu1yRF++VrJnqgEkhR8Q=; b=nq402XxersN12NluUdZWvBSEUx3C+0htWIzfIGfWT8tTqZ87X11p3PgEF7hT3Gvyqq DEx25j9+IU9CJmdmambiJbHwd6vshKCnBKIrSPvxiynYMN4Pnh4MA29LQh4tgErfTLVz p8u4cNJS5A5E8RyM+vAfUIxHIaul+p4VxlZ/8yuD28GVs57yHjc4wIGZhjQBj8Yp47Eh cETJSodx0sRn+9SV8KHwPnIQPYq3Q2RgMN4igIRQ9ZBgfegzlD4ZVwJWf53HFU4c1dC0 XXYH98U1LnSf4BqLkN/kqEMK2/YCG8KzWjzhuktR2b9tdxhXIhUo3nnfKLLlR8Sd/qE2 QD9Q== X-Gm-Message-State: ANhLgQ3TR4C0orcAWTkwV6domNd7aZ6iyrLATeOIh4zs68F7WEl5JLdA YD+PjmIMKlyQ7lvO8dbzvQURnyqPdBu2lg== X-Google-Smtp-Source: ADFU+vvsBIwOk2BNm/sOrh0z35MgN4MB2eLsDmouqtmCqcZ5uKTxZ+QlZ07trdC6i7ATdXJ3B8HfNw== X-Received: by 2002:a65:5b49:: with SMTP id y9mr11217177pgr.153.1585547937528; Sun, 29 Mar 2020 22:58:57 -0700 (PDT) Received: from rfd.leadboat.com (108-233-125-46.lightspeed.sntcca.sbcglobal.net. [108.233.125.46]) by smtp.gmail.com with ESMTPSA id x4sm9287881pfi.202.2020.03.29.22.58.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Mar 2020 22:58:56 -0700 (PDT) Date: Sun, 29 Mar 2020 22:58:54 -0700 From: Noah Misch To: Robert Haas Cc: David Steele , Stephen Frost , Amit Kapila , Suraj Kharage , tushar , Rajkumar Raghuwanshi , Rushabh Lathia , Tels , Andrew Dunstan , PostgreSQL Hackers , Jeevan Chalke , vignesh C Subject: Re: backup manifests Message-ID: <20200330055854.GC2324620@rfd.leadboat.com> References: <20200323224217.GN13712@tamriel.snowman.net> <20200325133106.GS13712@tamriel.snowman.net> <20200325205433.GV13712@tamriel.snowman.net> <16538d02-fd4b-6c4f-81a5-132c8fe8c3e9@pgmasters.net> <20200329034010.GB2247658@rfd.leadboat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sun, Mar 29, 2020 at 08:42:35PM -0400, Robert Haas wrote: > On Sat, Mar 28, 2020 at 11:40 PM Noah Misch wrote: > > I think this functionality doesn't belong in its own program. If you suspect > > pg_basebackup or pg_restore will eventually gain the ability to merge > > incremental backups into a recovery-ready base backup, I would put the > > functionality in that program. Otherwise, I would put it in pg_checksums. > > For me, part of the friction here is that the program description indicates > > general verification, but the actual functionality merely checks hashes on a > > directory tree that happens to represent a PostgreSQL base backup. > > Suraj's original patch made this part of pg_basebackup, but I didn't > really like that, because I wanted it to have its own set of options. > I still think all the options I've added are pretty useful ones, and I > can think of other things somebody might want to do. It feels very > uncomfortable to make pg_basebackup, or pg_checksums, take either > options from set A and do thing X, or options from set B and do thing > Y. pg_checksums does already have that property, for what it's worth. (More specifically, certain options dictate the mode, and it reports an error if another option is incompatible with the mode.) > But it feels clear that the name pg_validatebackup is not going > over very well with anyone. I think I should rename it to > pg_validatemanifest. Between those two, I would use "pg_validatebackup" if there's a fair chance it will end up doing the pg_waldump check. Otherwise, I would use "pg_validatemanifest". I still most prefer delivering this as a mode of an existing program. > > > + parse->pathname = palloc(raw_length + 1); > > > > I don't see this freed anywhere; is it? (It's useful to make peak memory > > consumption not grow in proportion to the number of files backed up.) > > We need the hash table to remain populated for the whole run time of > the tool, because we're essentially doing a full join of the actual > directory contents against the manifest contents. That's a bit > unfortunate but it doesn't seem simple to improve. I think the only > people who are really going to suffer are people who have an enormous > pile of empty or nearly-empty relations. People who have large > databases for the normal reason - i.e. a reasonable number of tables > that hold a lot of data - will have manifests of very manageable size. Okay.