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 1nToEi-0004au-No for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Mar 2022 17:12:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nToEh-0000mx-DX for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Mar 2022 17:11:59 +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 1nToEh-0000mo-4f for pgsql-hackers@lists.postgresql.org; Mon, 14 Mar 2022 17:11:59 +0000 Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nToEc-00035d-6B for pgsql-hackers@postgresql.org; Mon, 14 Mar 2022 17:11:58 +0000 Received: by mail-qt1-x82e.google.com with SMTP id n11so8064128qtk.4 for ; Mon, 14 Mar 2022 10:11:54 -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:in-reply-to:user-agent; bh=luN/ch8bjxJVZA8dn5TxoCPGWG7LMbRe1i8Db5/DbXc=; b=tIJ025IE/tKEZLuF7reQhTN4EOirKezTGSwrM1sNakUg/Sa5vEYhLaBw5czt/pWjZa w/ThfbXbAaGICxLVqHY2PP/E5mA1UD5qxlH0FEZJARbak1KUupS56aoOXLomOJeB8ALE 4e9ZieLdjH3QY0zD4dzO6pDZQFR+wqmq67ZIxGLWXZxzvRz9urua0D38TajCSFnoNHbL XR2s9fYLFxBgqBiGN3v+Vph/hjaLE0JCqYg/2Op3g2VfL1qeaXbsaVL9hIlOok+dF/YU lrLYP0ZfXz292xCqBNZuR0GL+otn4PzrWZl4FxZbpod25hz9zFiORl9vWDEIQczHVOdt sRoQ== 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:in-reply-to:user-agent; bh=luN/ch8bjxJVZA8dn5TxoCPGWG7LMbRe1i8Db5/DbXc=; b=WAUvlA1XPUqglVzQ5DtMr843AUJ4JNY6WYSxN87agNsFHea3lEnu95L4iLBK2Na+Ug KAFvjtDw3o+d+2OqRGxJgkOvH4yfl+cBUvLJpmixz11wgtFeRuf83o9xGDdOulFQl+/I dAOp7Wy+srglJLn7zC7KvnOMWfMpZyW/oG9P3Sjg3pwvYH4p3yxwjjGgFuxBNNMvmhbr KV5caDctUWsUDllvPVizxREahDAkTnZYs1XROgekjB2A734DrLXpAmVKLIwEa7r+soGu HvGjTd8rT2L4F9A4xg0XbJfNwUy/prHrd1nqms6wdsgSC337UmAitgtOaaQpOGYQHUsu hiBg== X-Gm-Message-State: AOAM531v+RJKJVstyRk6e1RI5SnV2r3ChtF3AzG8PRKzppudg3TXRV5s 6K+TDRXjn5e3kmVJz5WvZfOQ4ytTZtC25A== X-Google-Smtp-Source: ABdhPJywTLouAX/lQva4Gp26ufWDo957RdF91ZIACvAF7PG9YJTL5Dzkw94aOJlVlaCV056uj6aiKA== X-Received: by 2002:a05:622a:150:b0:2e1:dcd8:71d0 with SMTP id v16-20020a05622a015000b002e1dcd871d0mr1628016qtw.86.1647277913393; Mon, 14 Mar 2022 10:11:53 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id t207-20020a3746d8000000b0067b33b6a4efsm8034811qka.21.2022.03.14.10.11.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Mar 2022 10:11:53 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 49FBE800990; Mon, 14 Mar 2022 12:11:52 -0500 (CDT) Date: Mon, 14 Mar 2022 12:11:52 -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: <20220314171152.GU28503@telsasoft.com> References: <20220311010223.GI28503@telsasoft.com> <20220312015253.zokhkwdn5xbbd4vf@alap3.anarazel.de> <20220314163547.GT28503@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Mon, Mar 14, 2022 at 01:02:20PM -0400, Robert Haas wrote: > On Mon, Mar 14, 2022 at 12:35 PM Justin Pryzby wrote: > > I suggest to use a syntax that's more general than that, maybe something like > > > > :[level=]N,parallel=N,flag,flag,... > > > > For example, someone may want to use zstd "long" mode or (when it's released) > > rsyncable mode, or specify fine-grained compression parameters (strategy, > > windowLog, hashLog, etc). > > That's an interesting idea. I wonder what the replication protocol > ought to look like in that case. Should we have a COMPRESSION_DETAIL > argument that is just a string, and let the server parse it out? Or > separate protocol-level options? It does feel reasonable to have both > COMPRESSION_LEVEL and COMPRESSION_WORKERS as first-class options, but > I don't know that we want COMPRESSION_HASHLOG true as part of our > first-class grammar. I was only referring to the user-facing grammar. Internally, I was thinking they'd all be handled as first-class options, with separate struct fields and separate replication protocol options. If an option isn't known, it'd be rejected on the client side, rather than causing an error on the server. Maybe there'd be an option parser for this in common/ (I think that might require having new data structure there too, maybe one for each compression method, or maybe a union{} to handles them all). Most of the ~100 lines to support wal_compression='zstd:N' are to parse out the N. -- Justin