Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nW1Q9-0001KU-6e for pgsql-hackers@arkaria.postgresql.org; Sun, 20 Mar 2022 19:40:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nW1Q7-0007kC-8e for pgsql-hackers@arkaria.postgresql.org; Sun, 20 Mar 2022 19:40:55 +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 1nW1Q6-0007k3-Va for pgsql-hackers@lists.postgresql.org; Sun, 20 Mar 2022 19:40:54 +0000 Received: from mail-il1-x133.google.com ([2607:f8b0:4864:20::133]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nW1Q4-00039u-In for pgsql-hackers@postgresql.org; Sun, 20 Mar 2022 19:40:53 +0000 Received: by mail-il1-x133.google.com with SMTP id l13so9132217iln.13 for ; Sun, 20 Mar 2022 12:40:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=hKPBpYgLtnfHSZH590E6nZWVvfa+8gy38HoikzplnAM=; b=smUhr69jZll4yvoFgX/fbHybWY37UNRd8gSB5Dre/8W6+2w18N4w2LdZLlpZGbOfUt 10gHjfa4I2/18FvnilrW/Nv/Oe6A9T+QAFiIu+/2h/mfMIVkeZZnku2FTU66OnvloOxn D1iqzV/Zi9I5Q+Ez45eF/F+4UcUTq7sUb98TPzSN9Qwh8qpIClryMNdFHNKQLssV33Kw g+IYtrU5XyrALbGtTXivhrbAIDPUO/1O46EzRdHhTcChTS7CgNF0Dm3VAXXthmWJ69Xg rXUWlT6+ATsKcLG8F8qhNn9T/130Hi0O0NoWRUNueY5M4ZRK0A0KqHp+GVP6d8j4xIMa 90tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=hKPBpYgLtnfHSZH590E6nZWVvfa+8gy38HoikzplnAM=; b=LbSeVJfZioUqlrXnkH9CAeRaYi3ih7gzRpDI0VvGA7MzEsVcMCBcGQ3pCLdtkPUxsS UVJmHWHKnmfRGcXleOlgaU6kRqL/WgOjpTUDtAyBd4Go7Mn68DHEx41Mu5w46/maCCx+ YKT3UY8bruQJz4MlrLXDpDqjY7nCQBdQVVYspzf76WCQqzvNyPuVpkq0GuAoIxu8qIPo yXUo5kxvfB07z0I9QuaTDO8+l54occxSD8Q49Lbf7czFGhHxYRFDyy9D4JtOaatDPoEM b+/qrG/iF03oQdA285LyTyuJAEuRvUZRoqxSozbnh6PweOQj1cktTQDU80EBuAs0BgUp Ia3w== X-Gm-Message-State: AOAM533TAbUTqlIDz8Rg2fOUQR8EczwLa+JoICqXrntwdSZ23e5h7/1E /faO5El4dAkV24vMLubN9b0ERQ== X-Google-Smtp-Source: ABdhPJyXTnKL9tHSMV8gnKeb0bpZ4dECfiZz4c27gwvivIGy2GDL6xVTslP3t+OZ/QAZvsTUzxTlJQ== X-Received: by 2002:a92:ca47:0:b0:2c7:f738:3953 with SMTP id q7-20020a92ca47000000b002c7f7383953mr5894666ilo.42.1647805251870; Sun, 20 Mar 2022 12:40:51 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id m4-20020a0566022e8400b006463059bf2fsm7675844iow.49.2022.03.20.12.40.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Mar 2022 12:40:51 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id CC5F5800DAB; Sun, 20 Mar 2022 14:40:50 -0500 (CDT) Date: Sun, 20 Mar 2022 14:40:50 -0500 From: Justin Pryzby To: Robert Haas Cc: Dipesh Pandit , Andres Freund , Jeevan Ladhe , Alvaro Herrera , "Shinoda, Noriyoshi (PN Japan FSIP)" , Abhijit Menon-Sen , Dmitry Dolgov <9erthalion6@gmail.com>, Jeevan Ladhe , Mark Dilger , pgsql-hackers@postgresql.org, tushar Subject: Re: refactoring basebackup.c (zstd workers) Message-ID: <20220320194050.GX28503@telsasoft.com> References: <20220312015253.zokhkwdn5xbbd4vf@alap3.anarazel.de> <20220314163547.GT28503@telsasoft.com> <20220314171152.GU28503@telsasoft.com> <20220317194130.GM28503@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Mar 20, 2022 at 03:05:28PM -0400, Robert Haas wrote: > On Thu, Mar 17, 2022 at 3:41 PM Justin Pryzby wrote: > > - errmsg("unrecognized compression algorithm: \"%s\"", > > + errmsg("unrecognized compression algorithm \"%s\"", > > > > Most other places seem to say "compression method". So I'd suggest to change > > that here, and in doc/src/sgml/ref/pg_basebackup.sgml. > > I'm not sure that's really better, and I don't think this patch is > introducing an altogether novel usage. I think I would probably try to > standardize on algorithm rather than method if I were standardizing > the whole source tree, but I think we can leave that discussion for > another time. The user-facing docs are already standardized using "compression method", with 2 exceptions, of which one is contrib/ and the other is what I'm suggesting to make consistent here. $ git grep 'compression algorithm' doc doc/src/sgml/pgcrypto.sgml: Which compression algorithm to use. Only available if doc/src/sgml/ref/pg_basebackup.sgml: compression algorithm is selected, or if server-side compression > > + result->parse_error = > > + pstrdup("found empty string where a compression option was expected"); > > > > Needs to be localized with _() ? > > Also, document that it's pstrdup'd. > > Did the latter. The former would need to be fixed in a bunch of places > and while I'm happy to accept an expert opinion on exactly what needs > to be done here, I don't want to try to do it and do it wrong. Better > to let someone with good knowledge of the subject matter patch it up > later than do a crummy job now. I believe it just needs _("foo") See git grep '= _(' I mentioned another issue off-list: pg_basebackup.c:2741:10: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 2741 | Assert(compressloc = COMPRESS_LOCATION_SERVER); | ^~~~~~~~~~~ pg_basebackup.c:2741:3: note: in expansion of macro ‘Assert’ 2741 | Assert(compressloc = COMPRESS_LOCATION_SERVER); This crashes the server using your v2 patch: src/bin/pg_basebackup/pg_basebackup --wal-method fetch -Ft -D - -h /tmp --no-sync --no-manifest --compress=server-zstd:level, |wc -c I wonder whether the syntax should really use both ":" and ",". Maybe ":" isn't needed at all. This patch also needs to update the other user-facing docs. typo: contain a an -- Justin