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 1pw5Td-0006mC-0y for pgsql-hackers@arkaria.postgresql.org; Mon, 08 May 2023 18:20:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pw5Tb-0001wk-LW for pgsql-hackers@arkaria.postgresql.org; Mon, 08 May 2023 18:20:47 +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 1pw5Tb-0001wb-CR for pgsql-hackers@lists.postgresql.org; Mon, 08 May 2023 18:20:47 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1pw5TY-001PiT-5C for pgsql-hackers@lists.postgresql.org; Mon, 08 May 2023 18:20:46 +0000 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-50bc4bc2880so7765591a12.2 for ; Mon, 08 May 2023 11:20:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1683570043; x=1686162043; 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=mNL2+Wta9F57LBsMVbP5wm0eimnFbVqzIiVr0oFREUc=; b=TlSACJhYrD2njXBgyQPkTHHJocbYQzeh5mFdSKgabi5taDX1k1xZ6dpIfWmN013OUG q3Y3VcFQ4ePmLcG0bSr0FFFH5nQ+3e3LskwVewhMhayHCYoO3oWu0ipFOMoi88/XEj0l S6yZRLZLeBx6RRxX9e+CKnovBpAeEtznAu9mjv1wOKDNFJjfQhrINeh5zw2NW3qzo+fA ZuEQo0+eVr7vozcNBDFlH+aKvC9F1oT2GfHGsGUk1ir2HWMpo3Eg6VZMzv7VfF1GmSfV d9USoVMOkqiFAIgvOM6ZqU/M0NDlk7cWSSCvT1qvhK3MoDtZrUfEjnq0x75ZuAPQcx7g DXAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683570043; x=1686162043; 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=mNL2+Wta9F57LBsMVbP5wm0eimnFbVqzIiVr0oFREUc=; b=dMrnuL9MgRV2m0zUwR0CbpzkOpAu3ja1Mg2GXv6gwOuodJTREmH5TBQr3zr6Dpfkwl fJGxyZn51GhhaNHsjPEfBS3WIKg2Rk4QAoUf6qd3DsBLUEEJ0twefDvfL/dFvBVOCHwJ kP9YQ+FdJ+iXvAximYPTIJ6GkmOIVuDuYecz2/QHll7U8PamAsSlx3yZA/dzVIxqqlwN J+uyGPvNzMXDwKN7/9aTfQ7+F+Tbmv5NnOtGrxbfq0uQIUnJajbE/Voim5/Tovea40aZ n3qLkQomCxTL34uqHZh9uiQ7cVDg1F5uMllfrVpCbK4YyiaMlCJ5xKDTeHj3mgAkZkjs zLVQ== X-Gm-Message-State: AC+VfDyG/WLZ3UaQLJ0DS0aJq36ZORskVzpv5EcsCv67LII2RoWM7UpS ALpgLFfXxd/0u1dxCrUOktbx8S6MmzmKYV3H3i8e5eJnPoOiMyl1V1dURveiC1+KJQde/YYdzdJ 4Z2L+ZDsdZJeqz2SNK3wPN1zVVWX3GMHMbIOkqZkoyvJyfLfywGgW1bahKt/grkleqOWZBzAIyr rF0aJ8qnRTZXt8pfkhEXrjk1KE5aro/orKvDm7zloa4KeJgpymXK3P X-Google-Smtp-Source: ACHHUZ658YDl+XBTUZsijzr0ZdjxU4VBQHXzWkG6pBh2Wd7srFdFfMsF9hlubbjRH9pwTmR3ldiGFQ== X-Received: by 2002:a17:907:d89:b0:966:168d:8c9 with SMTP id go9-20020a1709070d8900b00966168d08c9mr7401936ejc.32.1683570043166; Mon, 08 May 2023 11:20:43 -0700 (PDT) Received: from [10.137.0.17] (ip-86-49-228-220.bb.vodafone.cz. [86.49.228.220]) by smtp.gmail.com with ESMTPSA id ca21-20020a170906a3d500b00965a52d2bf6sm275076ejb.88.2023.05.08.11.20.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 May 2023 11:20:42 -0700 (PDT) Message-ID: <1963a93f-001d-aa60-dec8-a7e1c6e03203@enterprisedb.com> Date: Mon, 8 May 2023 20:20:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: Add LZ4 compression in pg_dump Content-Language: en-US To: gkokolatos@pm.me, Tom Lane Cc: Michael Paquier , Andrew Dunstan , Alexander Lakhin , Justin Pryzby , shiy.fnst@fujitsu.com, pgsql-hackers@lists.postgresql.org, Rachel Heaton References: <7zu6GYFi72jByVk2SEe_nd8r1DHhwA35vSntAE9sAfiMX9Lfk6bwimkwmu7GDgYaEvL27SE4qF1uK4_LHWQM4H-SXOwkMAI-GV8PKGmED_E=@pm.me> <3beb0dd7-c927-3eca-689f-716e255d5b27@enterprisedb.com> <94ae9bca-5ebb-1e68-bb7b-4f32e89fefbe@gmail.com> <71868915-0345-1b7b-f3d6-ec66547c662a@dunslane.net> <219662.1683508165@sss.pgh.pa.us> <220484.1683508611@sss.pgh.pa.us> From: Tomas Vondra In-Reply-To: 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 On 5/8/23 18:19, gkokolatos@pm.me wrote: > > > > > > ------- Original Message ------- > On Monday, May 8th, 2023 at 3:16 AM, Tom Lane wrote: > > >> >> >> I wrote: >> >>> Michael Paquier michael@paquier.xyz writes: >>> >>>> While testing this patch, I have triggered an error pointing out that >>>> the decompression path of LZ4 is broken for table data. I can >>>> reproduce that with a dump of the regression database, as of: >>>> make installcheck >>>> pg_dump --format=d --file=dump_lz4 --compress=lz4 regression >> >>> Ugh. Reproduced here ... so we need an open item for this. >> >> >> BTW, it seems to work with --format=c. >> > > Thank you for the extra tests. It seems that exists a gap in the test > coverage. Please find a patch attached that is addressing the issue > and attempt to provide tests for it. > Seems I'm getting messages with a delay - this is mostly the same fix I ended up with, not realizing you already posted a fix. I don't think we need the local "in" variable - the pointer parameter is local in the function, so we can modify it directly (with a cast). WriteDataToArchiveLZ4 does it that way too. The tests are definitely a good idea. I wonder if we should add a comment to DEFAULT_IO_BUFFER_SIZE mentioning that if we choose to increase the value in the future, we needs to tweak the tests too to use more data in order to exercise the buffering etc. Maybe it's obvious? regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company