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 1pcbMi-0007IV-5H for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Mar 2023 00:21:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pcbMg-0006o5-Fb for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Mar 2023 00:21:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcbMg-0006nw-68 for pgsql-hackers@lists.postgresql.org; Thu, 16 Mar 2023 00:21:06 +0000 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pcbMd-0000I8-8w for pgsql-hackers@lists.postgresql.org; Thu, 16 Mar 2023 00:21:05 +0000 Received: by mail-il1-x12d.google.com with SMTP id bp11so132516ilb.3 for ; Wed, 15 Mar 2023 17:21:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; t=1678926061; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=QQRPag1Xip2csjt+3Vd3t3EiXqiRHmtJS0I/FE0Av3c=; b=M22LOgWS/6z+yZumshxW3cU0v5wTM9uobRzR0e7AdPgCiOaimcJlmZAH14FFCV8vbF HwtqnTEXfpeSTBVQcILWdiXYXUktGnqlg0UKXWrzVdrgk2Q6u9VWShaJcRSAZzbHGeiT gLyQnQoIAUI7Py9QGk8KskyVm9J4qCD5dqd4N77dOjkbpNuUCZ8nj7FktZSryCYegsSI LMCUcKHJ5g0Hxq9o9kOdhqZe805yREFdvUzoTldhFtpAonF6nbkOiDLSWNIy3lrIEaki y2itJKTOHSls2agWT6aOZWQ/HV8x0/Ed1sPVW0ffhBze1oDjG/8YwllQlAyKCeFxQKEJ KKOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678926061; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=QQRPag1Xip2csjt+3Vd3t3EiXqiRHmtJS0I/FE0Av3c=; b=Sr4lDeAO7GVHN76LIqEcu6X2Vf9N7kBnTOotcD4EvdhpYKfhMnKjpbW9nztqKD9l2r knBIKK7b/jIYQ8UqpPS3RT996KEg9W/3UiLvv2VtPLCgxG8rJ5G6DuYmBqiuIG/7DlN7 BBHRZVmUUcVZ3RwubJBAL0nBzGW1fUz0+VUkRyUDmeRWlFBH1cd+oCXRJgAbO6tGg/rI FuXdOcXBBPnWxPeP3xGhQUSHu3i5OPoswHgs6012EKhr6AeQ58L6EQcYkILiQL4o3ZHa gwHrMDEhxfoPariEPSFvNMMU//SkKW1Z5yvS/oTVPBaGfDKr9uriuHhlCU8q6VsIrljE GvYQ== X-Gm-Message-State: AO0yUKWClEurgeZkGWedJ6ZCnCvffN05d9J7v/r1szIq84rYsSqLKTdS d6LXjuV0T2RWo6bjr/4/B0u53g== X-Google-Smtp-Source: AK7set8ReltTRkYJf1+O0kW1yHMfcuOYXYcRkQfQtUqmaZPgdJiBVIPO9R0Ehme3QEkQwCQ6Rjzf7g== X-Received: by 2002:a92:d3c6:0:b0:317:9711:cf0 with SMTP id c6-20020a92d3c6000000b0031797110cf0mr6020897ilh.16.1678926061302; Wed, 15 Mar 2023 17:21:01 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id o13-20020a92c04d000000b00317b8e2c2b4sm2005258ilf.39.2023.03.15.17.21.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 17:21:00 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id BF90F800778; Wed, 15 Mar 2023 19:20:59 -0500 (CDT) Date: Wed, 15 Mar 2023 19:20:59 -0500 From: Justin Pryzby To: Tomas Vondra Cc: gkokolatos@pm.me, shiy.fnst@fujitsu.com, Michael Paquier , pgsql-hackers@lists.postgresql.org, Rachel Heaton Subject: Re: Add LZ4 compression in pg_dump Message-ID: References: <535565cd-b69f-c064-a845-15c0fc44db4a@enterprisedb.com> <22cb80ed-ec87-54c7-fd5b-cdcf79766bb1@enterprisedb.com> <8421f53d-c9f7-c02e-3278-9f9522a8e8f3@enterprisedb.com> <20230228235834.GC30529@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Mar 13, 2023 at 10:47:12PM +0100, Tomas Vondra wrote: > > Rearrange functions to their original order allowing a cleaner diff to the prior code; > > OK. I wasn't very enthusiastic about this initially, but after thinking > about it a bit I think it's meaningful to make diffs clearer. But I > don't see much difference with/without the patch. The > > git diff --diff-algorithm=minimal -w e9960732a~:src/bin/pg_dump/compress_io.c src/bin/pg_dump/compress_gzip.c > > Produces ~25k diff with/without the patch. What am I doing wrong? Do you mean 25 kB of diff ? I agree that the statistics of the diff output don't change a lot: 1 file changed, 201 insertions(+), 570 deletions(-) 1 file changed, 198 insertions(+), 548 deletions(-) But try reading the diff while looking for the cause of a bug. It's the difference between reading 50, two-line changes, and reading a hunk that replaces 100 lines with a different 100 lines, with empty/unrelated lines randomly thrown in as context. When the diff is readable, the pg_fatal() also stands out. > > Change pg_fatal() to an assertion+comment; > > Yeah, that's reasonable. I'd even ditch the assert/comment, TBH. We > could add such protections against "impossible" stuff to a zillion other > places and the confusion likely outweighs the benefits. > > > Update the commit message and fix a few typos; > > Thanks. I don't want to annoy you too much, but could you split the > patch into the "empty-data" fix and all the other changes (rearranging > functions etc.)? I'd rather not mix those in the same commit. I don't know if that makes sense? The "empty-data" fix creates a new function called DeflateCompressorInit(). My proposal was to add the new function in the same place in the file as it used to be. The patch also moves the pg_fatal() that's being removed. I don't think it's going to look any cleaner to read a history involving the pg_fatal() first being added, then moved, then removed. Anyway, I'll wait while the community continues discussion about the pg_fatal(). -- Justin