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 1kO7t9-0000ER-Kh for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Oct 2020 23:21:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kO7t8-0003wK-Jd for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Oct 2020 23:21:26 +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 1kO7t8-0003wD-Cr for pgsql-hackers@lists.postgresql.org; Thu, 01 Oct 2020 23:21:26 +0000 Received: from mail-oo1-xc41.google.com ([2607:f8b0:4864:20::c41]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kO7t1-0006Dg-KU for pgsql-hackers@postgresql.org; Thu, 01 Oct 2020 23:21:26 +0000 Received: by mail-oo1-xc41.google.com with SMTP id r4so87666ooq.7 for ; Thu, 01 Oct 2020 16:21:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:references:autocrypt:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=QnRULtRob2gyQfzJZyhsGUqoF0cX6GEa215G4YYGJzM=; b=WsP6WNAlkXI1Yv5xM44lvaqTOCn5DKovPPR1pZEsgmLuzkixw3awk6aPsgX8Z4nN5P qMiWE4LULGwQhhJQjgKWfj9TJNWSXBQXJbbWQgPDs1AWjQipFdcD8hOyfKqDCNj9quvP dTfsJ9x5OsB6owPk9MPNMYVkZjscyl0rjsGSMEqzTCAc2Sf0zBhfCfI2R2Sw0YHm1MUy 0oP3rUuC6zYJ/AtFJBi9/N/ksSyYpbr50qpUP4P0sUb/DuetcgVZ8xCoJt+fpicZIAvc 05xImvAn6215FxKt/Bfd0YMYmeyWEq7HTSC8ZvIAeunm+ntG7WFB/ZUQxUyIRnddPm8O /fLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=QnRULtRob2gyQfzJZyhsGUqoF0cX6GEa215G4YYGJzM=; b=LI0hHudLPfi3qHMGu0J+js96Mh3HJb7gHcCAvRbbuDB9TcwPXQ8Efv0q0/VbOpvcbx Vrz8Fe3LH4/n0ypeI8RCVWSahEnjHwI9dG/3CEiWU1FVnQca3D800/P20te4Thg4lOoR NeXOxSoRr98NuyWsOwTinfJurbwVo0JWYOmcIDuh0UZzzYPl5uNm8tuExLRLx6sTWu46 nCHlEOSff2o6IVIHiuiRo4UgOrDBbnDBfj19y4+Jr3aS/jQIsvkLHOHgHLmzBmT+p3fr mhJXqrLqEZ0OrJvlttkOQPhUCE82xMWpGThZqXRmzdxxiJx9mE3thb9eMG5CLQCHAGwD XILg== X-Gm-Message-State: AOAM533jXjMtRR882dkGor5QF7946aqyY34i6lGa5N0EuLuutCOKF7CI cmBQd3pi9KUkxRIHnOGPJI3w X-Google-Smtp-Source: ABdhPJxBOYJTnjHiowPwuFiv+jxYbidKqBnUOfMM9fuhuZpdQW8YIyd1Q1bqJEPTPMjCTNyYkn28ng== X-Received: by 2002:a4a:614f:: with SMTP id u15mr7370613ooe.70.1601594477866; Thu, 01 Oct 2020 16:21:17 -0700 (PDT) Received: from ?IPv6:2600:1700:722:4630::43? ([2600:1700:722:4630::43]) by smtp.gmail.com with ESMTPSA id d63sm1411927oig.53.2020.10.01.16.21.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Oct 2020 16:21:17 -0700 (PDT) From: Andrew Dunstan X-Google-Original-From: Andrew Dunstan Subject: Re: Improving connection scalability: GetSnapshotData() To: Andres Freund Cc: Ian Barwick , Michael Paquier , Tom Lane , Robert Haas , Thomas Munro , Alvaro Herrera , Daniel Gustafsson , "Jonathan S. Katz" , Alexander Korotkov , PostgreSQL Hackers , Peter Geoghegan , Bruce Momjian , David Rowley 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> <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> Autocrypt: addr=andrew.dunstan@2ndQuadrant.com; prefer-encrypt=mutual; keydata= mQENBE7KWFkBCAClridxur2AIc7eW2AR7izbfp3EnNefie2HbLF0izW5Ik5UjX2HBXBx4syI gY6b0ugohXrr274+baoAlvSbq6cAoQuEVrk5IZFzt20b1Xkx65FwGSEj526yiKLocqkJceSq Xr9xcA5SGY+FZv441chh5SU92v4q6z+6LPpoHOh97ptAVXZYNTtU0LevyvD5lja0TzbvJm6C eFXitJfnm1pLEr0DGJCR/iUOl/N62Kh4855zZC7NHIjQHPOvV5Stz/l5ilDhvGVk+xkXFPys SjZoUr1rXhYLpiyi5sR0X9FHXT0KnGuz1F5ERO7ZTLSSQ6fJwPj6gOk9K+vvoKvoeql5ABEB AAG0L0FuZHJldyBEdW5zdGFuIDxhbmRyZXcuZHVuc3RhbkAybmRRdWFkcmFudC5jb20+iQFY BBMBAgBCAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQ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CqurIu9vTLXKFWX623vCmqRDHJ6e5GCDHbH8USU+4wJBfPymZkd cA7NGm/mmWeJiWBFIDyjzYxrjku8ty9TZJVsaRXnS+OFQzXz9Eu2wTpKdHij46uY Message-ID: Date: Thu, 1 Oct 2020 19:21:14 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20201001202201.bjff3mghwasihbzj@alap3.anarazel.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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