From: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
To: Andres Freund <andres@anarazel.de>
Cc: Ian Barwick <ian.barwick@2ndquadrant.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Daniel Gustafsson <daniel@yesql.se>
Cc: Jonathan S. Katz <jkatz@postgresql.org>
Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: David Rowley <dgrowleyml@gmail.com>
Subject: Re: Improving connection scalability: GetSnapshotData()
Date: Thu, 1 Oct 2020 19:21:14 -0400
Message-ID: <d8c0352d-ab9e-d78c-baba-8e15b222bfc3@2ndQuadrant.com> (raw)
In-Reply-To: <20201001202201.bjff3mghwasihbzj@alap3.anarazel.de>
References: <20200816212657.3vyijoddr2yvgjjc@alap3.anarazel.de>
<20200903081554.GB8559@paquier.xyz>
<61291ffe-d611-f889-68b5-c298da9fb18f@2ndquadrant.com>
<20200908041114.5woxns33iv765fgh@alap3.anarazel.de>
<0006ffe6-6f76-c074-3e58-2801cee1c05f@2ndquadrant.com>
<d5f14b0e-58d2-56ab-0938-ab57ecc89d77@2ndquadrant.com>
<20200914231718.gg7v77fx7nvvprjy@alap3.anarazel.de>
<20200930224317.xuvsoptjg6b2ydxx@alap3.anarazel.de>
<20201001182630.7kh2tiubf2lp3tzt@alap3.anarazel.de>
<2355d1f0-0244-da9c-ef0c-7542b944e1ac@2ndQuadrant.com>
<20201001202201.bjff3mghwasihbzj@alap3.anarazel.de>
On 10/1/20 4:22 PM, Andres Freund wrote:
> Hi,
>
> On 2020-10-01 16:00:20 -0400, Andrew Dunstan wrote:
>> My strong suspicion is that we're getting unwanted CRs. Note the
>> presence of numerous instances of this in PostgresNode.pm:
>
>> $stdout =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
>>
>> So you probably want something along those lines at the top of the loop
>> in send_query_and_wait:
>>
>> $$psql{stdout} =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
> Yikes, that's ugly :(.
>
>
> I assume it's not, as the comments says
> # Note: on Windows, IPC::Run seems to convert \r\n to \n in program output
> # if we're using native Perl, but not if we're using MSys Perl. So do it
> # by hand in the latter case, here and elsewhere.
> that IPC::Run converts things, but that native windows perl uses
> https://perldoc.perl.org/perlrun#PERLIO
> a PERLIO that includes :crlf, whereas msys probably doesn't?
>
> Any chance you could run something like
> perl -mPerlIO -e 'print(PerlIO::get_layers(STDIN), "\n");'
> on both native and msys perl?
>
>
>> possibly also for stderr, just to make it more futureproof, and at the
>> top of the file:
>>
>> use Config;
>>
>>
>> Do you want me to test that first?
> That'd be awesome.
>
>
>
The change I suggested makes jacana happy.
cheers
andrew
--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: andrew.dunstan@2ndquadrant.com, andres@anarazel.de, ian.barwick@2ndquadrant.com, michael@paquier.xyz, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, thomas.munro@gmail.com, alvherre@2ndquadrant.com, daniel@yesql.se, jkatz@postgresql.org, a.korotkov@postgrespro.ru, pg@bowt.ie, bruce@momjian.us, dgrowleyml@gmail.com
Subject: Re: Improving connection scalability: GetSnapshotData()
In-Reply-To: <d8c0352d-ab9e-d78c-baba-8e15b222bfc3@2ndQuadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox