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 1pIZ8i-0003pR-5b for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Jan 2023 17:55:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pIZ8h-0003dr-3i for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Jan 2023 17:55:51 +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 1pIZ8g-0003df-QZ for pgsql-hackers@lists.postgresql.org; Thu, 19 Jan 2023 17:55:50 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pIZ8e-0005ie-7f for pgsql-hackers@lists.postgresql.org; Thu, 19 Jan 2023 17:55:49 +0000 Received: by mail-wr1-x431.google.com with SMTP id e3so2614924wru.13 for ; Thu, 19 Jan 2023 09:55:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=RF6MkNr3EqgUW0EMDpYWx4icV9TNEY86qD8K868z4H8=; b=WqAiqg0+Sgl88hpjifphvuS5xsYboRLg/Q7i+xF3U8IP1Re4culubwTdnJQR5Tiu1q J3NnMP1jSo0Fwt1iLOw3x+g8Qkf7ospJTCDMU1YQDIog+yOmdu0XLHDuxpwJ0MTwqviB 9pa3TtkaaeEVCPvWym5a2pyQK12vWtC0kpMsIq9Qz9zwjYQsgD17LnzRBki/2s2KGjNy FPuE0T31DSslmZ36TssmUJZuGyEyToWzZgsiU0286+gornYfMjZFvM3AA8WBBJuAhrQp 5m0yOnBlnkEdYxUkpF2+O8GqVLNBWRz93vGM5WiFGhRhSG+yafDxcyCpiI4FyQrw4tHN A9TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RF6MkNr3EqgUW0EMDpYWx4icV9TNEY86qD8K868z4H8=; b=Ak7QQb57J11D15oeXbEmlbT5BJRGynll/GKZz3qPvP2SDpLqCXuCR2g6qnn/2omwge BV06YuRgeIgU/Zxgn1fUcKrEWgERNSNNq3SdIpNaM622TM/Yt4V/2cRobBx9Sdm1cQNy ugT4f66gOJxbWtO+AC1XF15+0mVse1p6I17mFH7qbERmj9GDCPWWkHn5DZhn9V7OeRxj wFGtd1aKHtkfqrVEFsU4lqqOxqTKAvCl5ltlawvYvEq9AOwOVE1YhOqYq5Z7KF9prqa9 vyDTGzWM2EQdJ4iNGtCJoO95O7j6OdCkU5K3fbl4NF+3ASrwMcFouSZpsj9k2T8kobst 1llA== X-Gm-Message-State: AFqh2kqGJm1qnHLrhnQdtiOMo73zGVU2oZUTqR4T9CTK7rKrXVwnDQnn Rf0mOJ1iERfvGAyTnu9uwrDxnkSL2KQjisLrYmdiWAb/4TRPkne8Jv3pqdmxedFrsBHf11jCgcI zC/qwpCTi19x2Xn+jVgyUuVKPB46qZRoXHTW6raprvdJEoMSTq29fhfQA5T4s43+4BNKo3pB40v vt5LxzuPeSn/uQoFFKgQ3pDsdhINVV20JrZFX9DoZfY8k89UbfzovSQ6rvevoz8Fd8MJd/FIFIi uFSWqHdwwMLN+TckvVu2TIiuxQm8xWufLAhQd/VdGDifBWeGQ+Ac1m9jH4y X-Google-Smtp-Source: AMrXdXs8ngdpwV52VDynnRaYY/ewi13ifN75yM0hXyEepwyRAQL+SnP7UDQk6fOVgMyjUpq8i8Hijg== X-Received: by 2002:a5d:698e:0:b0:2bd:fa7c:bb9e with SMTP id g14-20020a5d698e000000b002bdfa7cbb9emr10086166wru.6.1674150945848; Thu, 19 Jan 2023 09:55:45 -0800 (PST) Received: from [10.137.0.17] (ip-86-49-228-162.bb.vodafone.cz. [86.49.228.162]) by smtp.gmail.com with ESMTPSA id i2-20020adfdec2000000b002b9b9445149sm41140913wrn.54.2023.01.19.09.55.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Jan 2023 09:55:45 -0800 (PST) Message-ID: Date: Thu, 19 Jan 2023 18:55:43 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: Add LZ4 compression in pg_dump Content-Language: en-US To: gkokolatos@pm.me Cc: Michael Paquier , Justin Pryzby , pgsql-hackers@lists.postgresql.org, Rachel Heaton References: <20230114214308.GC9837@telsasoft.com> <20230116015625.GH9837@telsasoft.com> <41036470-041b-08a3-469d-fe07de2bc58e@enterprisedb.com> <6ab89d42-0345-b96e-02d4-68e171cdbe03@enterprisedb.com> <7zu6GYFi72jByVk2SEe_nd8r1DHhwA35vSntAE9sAfiMX9Lfk6bwimkwmu7GDgYaEvL27SE4qF1uK4_LHWQM4H-SXOwkMAI-GV8PKGmED_E=@pm.me> From: Tomas Vondra In-Reply-To: <7zu6GYFi72jByVk2SEe_nd8r1DHhwA35vSntAE9sAfiMX9Lfk6bwimkwmu7GDgYaEvL27SE4qF1uK4_LHWQM4H-SXOwkMAI-GV8PKGmED_E=@pm.me> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 1/19/23 17:42, gkokolatos@pm.me wrote: > > ------- Original Message ------- > On Thursday, January 19th, 2023 at 4:45 PM, Tomas Vondra wrote: >> >> On 1/18/23 20:05, gkokolatos@pm.me wrote: >> >>> ------- Original Message ------- >>> On Wednesday, January 18th, 2023 at 3:00 PM, Tomas Vondra tomas.vondra@enterprisedb.com wrote: >> >> I'm not sure I understand why leave the lz4/zstd in this place? > > You are right, it is not obvious. Those were added in 5e73a60488 which is > already committed in master and I didn't want to backtrack. Of course, I am > not opposing in doing so if you wish. > Ah, I didn't realize it was already added by earlier commit. In that case let's not worry about it. >> >>>> 2) I wouldn't reorder the cases in WriteDataToArchive, i.e. I'd keep >>>> "none" at the end. It might make backpatches harder. >>> >>> Agreed. However a 'default' is needed in order to avoid compilation warnings. >>> Also note that 0002 completely does away with cases within WriteDataToArchive. >> >> >> OK, although that's also a consequence of using a "switch" instead of >> plan "if" branches. >> >> Furthermore, I'm not sure we really need the pg_fatal() about invalid >> compression method in these default blocks. I mean, how could we even >> get to these places when the build does not support the algorithm? All >> of this (ReadDataFromArchive, WriteDataToArchive, EndCompressor, ...) >> happens looong after the compressor was initialized and the method >> checked, no? So maybe either this should simply do Assert(false) or use >> a different error message. > > I like Assert(false). > OK, good. Do you agree we should never actually get there, if the earlier checks work correctly? >> >>>> 4) "cfp" struct no longer wraps gzFile, but the comment was not updated. >>>> FWIW I'm not sure switching to "void *" is an improvement, maybe it'd be >>>> better to have a "union" of correct types? >>> >>> Please find and updated comment and a union in place of the void *. Also >>> note that 0002 completely does away with cfp in favour of a new struct >>> CompressFileHandle. I maintained the void * there because it is used by >>> private methods of the compressors. 0003 contains such an example with >>> LZ4CompressorState. >> >> >> I wonder if this (and also the previous item) makes sense to keep 0001 >> and 0002 or to combine them. The "intermediate" state is a bit annoying. > > Agreed. It was initially submitted as one patch. Then it was requested to be > split up in two parts, one to expand the use of the existing API and one to > replace with the new interface. Unfortunately the expansion of usage of the > existing API requires some tweaking, but that is not a very good reason for > the current patch set. I should have done a better job there. > > Please find v22 attach which combines back 0001 and 0002. It is missing the > documentation that was discussed above as I wanted to give a quick feedback. > Let me know if you think that the combined version is the one to move forward > with. > Thanks, I'll take a look. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company