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 1lJe16-00073d-UI for pgsql-committers@arkaria.postgresql.org; Tue, 09 Mar 2021 15:11:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lJe15-00039T-N5 for pgsql-committers@arkaria.postgresql.org; Tue, 09 Mar 2021 15:11:23 +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 1lJe15-00039K-Gf for pgsql-committers@lists.postgresql.org; Tue, 09 Mar 2021 15:11:23 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lJe13-0003LN-0g for pgsql-committers@lists.postgresql.org; Tue, 09 Mar 2021 15:11:23 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id AEAC324613EC for ; Tue, 9 Mar 2021 16:11:18 +0100 (CET) Received: from s630.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id 902E62E28973; Tue, 9 Mar 2021 16:11:18 +0100 (CET) Received: from s476.loopia.se (unknown [172.22.191.5]) by s630.loopia.se (Postfix) with ESMTP id 75A3513B93C9; Tue, 9 Mar 2021 16:11:18 +0100 (CET) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-1 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1] autolearn=disabled Received: from s630.loopia.se ([172.22.191.5]) by s476.loopia.se (s476.loopia.se [172.22.190.16]) (amavisd-new, port 10024) with LMTP id KHd_vWjmsn55; Tue, 9 Mar 2021 16:11:17 +0100 (CET) X-Loopia-Auth: user X-Loopia-User: daniel@yesql.se X-Loopia-Originating-IP: 89.255.232.193 Received: from [192.168.72.43] (customer-89-255-232-193.stosn.net [89.255.232.193]) (Authenticated sender: daniel@yesql.se) by s630.loopia.se (Postfix) with ESMTPSA id BF9EA13B93BC; Tue, 9 Mar 2021 16:11:17 +0100 (CET) From: Daniel Gustafsson Message-Id: <0ABE2652-9850-43D4-A7A3-57C8F6834038@yesql.se> Content-Type: multipart/mixed; boundary="Apple-Mail=_EACC1DE2-332B-4094-A080-432105B9A1CA" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: pgsql: Remove support for SSL compression Date: Tue, 9 Mar 2021 16:11:17 +0100 In-Reply-To: Cc: pgsql-committers@lists.postgresql.org To: Michael Paquier References: X-Mailer: Apple Mail (2.3445.104.17) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_EACC1DE2-332B-4094-A080-432105B9A1CA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On 9 Mar 2021, at 12:19, Michael Paquier wrote: >=20 > On Tue, Mar 09, 2021 at 12:26:15PM +0900, Michael Paquier wrote: >> It looks like it is not that much a good idea to define it as a debug >> option after all. So I guess that the attached would fix the = failure, >> where FDW servers can still pass down the parameter at will for >> backward-compatibility, and where libpq keeps ignoring its value. = Any >> thoughts? >=20 > So, I have been thinking more about this one, and applied the previous > patch to bring back crake to green. There are a couple of options > that could be considered to make the option non-visible, but nothing > looks really appealing to me: > - Tweak the regression tests on the back-branches to bypass the > failure, but this won't change the potential impact of anybody using > sslcompression in a FDW server, or even dblink. > - Create specific exceptions in postgres_fdw and perhaps dblink. > - Extend libpq with a special status to mark a parameter as > to-be-removed, but that feels like a mix of a normal option and a > debug option. > - Make pg_upgrade complain if such a server is detected (?), bringing > in the ring the first point of this list. Having tried a number of different ways to fix this I think the least = intrusive fix is to teach pg_upgrade and dblink about sslcompression, like how've = already taught it about other options. Building any infrastructure to handle deprecated options and extending the dispchar with a classification for deprecation for just this one option seems overkill. Deprecating = options is also not something frequently done, so the cost/benefit for something complicated seems off. The attached is a version of the simple fix. -- Daniel Gustafsson https://vmware.com/ --Apple-Mail=_EACC1DE2-332B-4094-A080-432105B9A1CA Content-Disposition: attachment; filename=v1-0001-Fix-sslcompression-in-postgres_fdw-and-dblink.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="v1-0001-Fix-sslcompression-in-postgres_fdw-and-dblink.patch" Content-Transfer-Encoding: quoted-printable =46rom=20f13390a1922266906e949510b93a979bb1575b0f=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Daniel=20Gustafsson=20=0A= Date:=20Tue,=209=20Mar=202021=2015:40:13=20+0100=0ASubject:=20[PATCH=20= v1]=20Fix=20sslcompression=20in=20postgres_fdw=20and=20dblink=0A=0A= Commit=20f9264d1524ba=20deprecated=20sslcompression=20leaving=20the=20= libpq=20option=0Aas=20a=20debug=20option=20to=20preserve=20backwards=20= compatibility=20by=20silently=20eating=0Ait=20when=20passed=20in.=20= postgres_fdw=20and=20dblink=20does=20however=20skip=20over=20debug=0A= options=20when=20validating=20the=20set=20of=20options=20and=20would=20= thus=20fail=20with=20an=0Ainvalid=20option.=20This=20teaches=20= postgres_fdw=20and=20dblink=20to=20treat=20the=20option=0Ain=20the=20= same=20way=20to=20avoid=20upgrades=20breaking.=0A=0AThis=20reverts=20= commit=20096bbf7c934a4288c9=20which=20was=20a=20temporary=20fix=20of=20= the=0Atest=20failure=20in=20f9264d1524ba.=0A=0ADiscussion:=20= https://postgr.es/m/7E384D48-11C5-441B-9EC3-F7DB1F8518F6@yesql.se=0A= Discussion:=20= https://postgr.es/m/E1lJRxU-00051U-47@gemulon.postgresql.org=0A---=0A=20= contrib/dblink/dblink.c=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20|=2013=20++++++++++---=0A=20= contrib/postgres_fdw/expected/postgres_fdw.out=20|=20=203=20+--=0A=20= contrib/postgres_fdw/option.c=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20|=2013=20++++++++++---=0A=20= contrib/postgres_fdw/sql/postgres_fdw.sql=20=20=20=20=20=20|=20=201=20-=0A= =20src/interfaces/libpq/fe-connect.c=20=20=20=20=20=20=20=20=20=20=20=20=20= =20|=20=202=20+-=0A=205=20files=20changed,=2022=20insertions(+),=2010=20= deletions(-)=0A=0Adiff=20--git=20a/contrib/dblink/dblink.c=20= b/contrib/dblink/dblink.c=0Aindex=203a0beaa88e..d589886aa2=20100644=0A= ---=20a/contrib/dblink/dblink.c=0A+++=20b/contrib/dblink/dblink.c=0A@@=20= -2035,14=20+2035,21=20@@=20dblink_fdw_validator(PG_FUNCTION_ARGS)=0A=20=0A= =20=09=09if=20(!is_valid_dblink_option(options,=20def->defname,=20= context))=0A=20=09=09{=0A+=09=09=09StringInfoData=20buf;=0A+=09=09=09= const=20PQconninfoOption=20*opt;=0A+=0A+=09=09=09/*=0A+=09=09=09=20*=20= sslcompression=20is=20deprecated=20and=20should=20be=20silently=20= ignored=20to=0A+=09=09=09=20*=20preserve=20backwards=20compatibility.=0A= +=09=09=09=20*/=0A+=09=09=09if=20(strcmp(def->defname,=20= "sslcompression")=20=3D=3D=200)=0A+=09=09=09=09continue;=0A+=0A=20=09=09=09= /*=0A=20=09=09=09=20*=20Unknown=20option,=20or=20invalid=20option=20for=20= the=20context=20specified,=20so=0A=20=09=09=09=20*=20complain=20about=20= it.=20=20Provide=20a=20hint=20with=20list=20of=20valid=20options=0A=20=09= =09=09=20*=20for=20the=20context.=0A=20=09=09=09=20*/=0A-=09=09=09= StringInfoData=20buf;=0A-=09=09=09const=20PQconninfoOption=20*opt;=0A-=0A= =20=09=09=09initStringInfo(&buf);=0A=20=09=09=09for=20(opt=20=3D=20= options;=20opt->keyword;=20opt++)=0A=20=09=09=09{=0Adiff=20--git=20= a/contrib/postgres_fdw/expected/postgres_fdw.out=20= b/contrib/postgres_fdw/expected/postgres_fdw.out=0Aindex=20= f17f3b6c29..c2565dfc70=20100644=0A---=20= a/contrib/postgres_fdw/expected/postgres_fdw.out=0A+++=20= b/contrib/postgres_fdw/expected/postgres_fdw.out=0A@@=20-167,7=20+167,6=20= @@=20ALTER=20SERVER=20testserver1=20OPTIONS=20(=0A=20=09sslcert=20= 'value',=0A=20=09sslkey=20'value',=0A=20=09sslrootcert=20'value',=0A-=09= sslcompression=20'value',=0A=20=09sslcrl=20'value',=0A=20=09= --requirepeer=20'value',=0A=20=09krbsrvname=20'value',=0A@@=20-8946,7=20= +8945,7=20@@=20DO=20$d$=0A=20=20=20=20=20END;=0A=20$d$;=0A=20ERROR:=20=20= invalid=20option=20"password"=0A-HINT:=20=20Valid=20options=20in=20this=20= context=20are:=20service,=20passfile,=20channel_binding,=20= connect_timeout,=20dbname,=20host,=20hostaddr,=20port,=20options,=20= application_name,=20keepalives,=20keepalives_idle,=20= keepalives_interval,=20keepalives_count,=20tcp_user_timeout,=20sslmode,=20= sslcompression,=20sslcert,=20sslkey,=20sslrootcert,=20sslcrl,=20= sslcrldir,=20requirepeer,=20ssl_min_protocol_version,=20= ssl_max_protocol_version,=20gssencmode,=20krbsrvname,=20gsslib,=20= target_session_attrs,=20use_remote_estimate,=20fdw_startup_cost,=20= fdw_tuple_cost,=20extensions,=20updatable,=20fetch_size,=20batch_size=0A= +HINT:=20=20Valid=20options=20in=20this=20context=20are:=20service,=20= passfile,=20channel_binding,=20connect_timeout,=20dbname,=20host,=20= hostaddr,=20port,=20options,=20application_name,=20keepalives,=20= keepalives_idle,=20keepalives_interval,=20keepalives_count,=20= tcp_user_timeout,=20sslmode,=20sslcert,=20sslkey,=20sslrootcert,=20= sslcrl,=20sslcrldir,=20requirepeer,=20ssl_min_protocol_version,=20= ssl_max_protocol_version,=20gssencmode,=20krbsrvname,=20gsslib,=20= target_session_attrs,=20use_remote_estimate,=20fdw_startup_cost,=20= fdw_tuple_cost,=20extensions,=20updatable,=20fetch_size,=20batch_size=0A=20= CONTEXT:=20=20SQL=20statement=20"ALTER=20SERVER=20loopback_nopw=20= OPTIONS=20(ADD=20password=20'dummypw')"=0A=20PL/pgSQL=20function=20= inline_code_block=20line=203=20at=20EXECUTE=0A=20--=20If=20we=20add=20a=20= password=20for=20our=20user=20mapping=20instead,=20we=20should=20get=20a=20= different=0Adiff=20--git=20a/contrib/postgres_fdw/option.c=20= b/contrib/postgres_fdw/option.c=0Aindex=2064698c4da3..6fb0288018=20= 100644=0A---=20a/contrib/postgres_fdw/option.c=0A+++=20= b/contrib/postgres_fdw/option.c=0A@@=20-81,13=20+81,20=20@@=20= postgres_fdw_validator(PG_FUNCTION_ARGS)=0A=20=0A=20=09=09if=20= (!is_valid_option(def->defname,=20catalog))=0A=20=09=09{=0A+=09=09=09= PgFdwOption=20*opt;=0A+=09=09=09StringInfoData=20buf;=0A+=0A+=09=09=09/*=0A= +=09=09=09=20*=20sslcompression=20is=20deprecated=20and=20should=20be=20= silently=20ignored=20to=0A+=09=09=09=20*=20preserve=20backwards=20= compatibility.=0A+=09=09=09=20*/=0A+=09=09=09if=20=20= (strcmp(def->defname,=20"sslcompression")=20=3D=3D=200)=0A+=09=09=09=09= continue;=0A+=0A=20=09=09=09/*=0A=20=09=09=09=20*=20Unknown=20option=20= specified,=20complain=20about=20it.=20Provide=20a=20hint=0A=20=09=09=09=20= *=20with=20list=20of=20valid=20options=20for=20the=20object.=0A=20=09=09=09= =20*/=0A-=09=09=09PgFdwOption=20*opt;=0A-=09=09=09StringInfoData=20buf;=0A= -=0A=20=09=09=09initStringInfo(&buf);=0A=20=09=09=09for=20(opt=20=3D=20= postgres_fdw_options;=20opt->keyword;=20opt++)=0A=20=09=09=09{=0Adiff=20= --git=20a/contrib/postgres_fdw/sql/postgres_fdw.sql=20= b/contrib/postgres_fdw/sql/postgres_fdw.sql=0Aindex=20= be5618f759..a143a70406=20100644=0A---=20= a/contrib/postgres_fdw/sql/postgres_fdw.sql=0A+++=20= b/contrib/postgres_fdw/sql/postgres_fdw.sql=0A@@=20-181,7=20+181,6=20@@=20= ALTER=20SERVER=20testserver1=20OPTIONS=20(=0A=20=09sslcert=20'value',=0A=20= =09sslkey=20'value',=0A=20=09sslrootcert=20'value',=0A-=09sslcompression=20= 'value',=0A=20=09sslcrl=20'value',=0A=20=09--requirepeer=20'value',=0A=20= =09krbsrvname=20'value',=0Adiff=20--git=20= a/src/interfaces/libpq/fe-connect.c=20= b/src/interfaces/libpq/fe-connect.c=0Aindex=20aeb64c5bca..318c45ec19=20= 100644=0A---=20a/src/interfaces/libpq/fe-connect.c=0A+++=20= b/src/interfaces/libpq/fe-connect.c=0A@@=20-280,7=20+280,7=20@@=20static=20= const=20internalPQconninfoOption=20PQconninfoOptions[]=20=3D=20{=0A=20=09= =20*=20compatibility.=0A=20=09=20*/=0A=20=09{"sslcompression",=20NULL,=20= NULL,=20NULL,=0A-=09"SSL-Compression",=20"",=201,=20-1},=0A+=09= "SSL-Compression",=20"D",=201,=20-1},=0A=20=0A=20=09{"sslcert",=20= "PGSSLCERT",=20NULL,=20NULL,=0A=20=09=09"SSL-Client-Cert",=20"",=2064,=0A= --=20=0A2.21.1=20(Apple=20Git-122.3)=0A=0A= --Apple-Mail=_EACC1DE2-332B-4094-A080-432105B9A1CA--