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 1kO5R3-0002D9-65 for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Oct 2020 20:44:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kO5R1-0003NB-AO for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Oct 2020 20:44:15 +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 1kO5R1-0003N4-3R for pgsql-hackers@lists.postgresql.org; Thu, 01 Oct 2020 20:44:15 +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 1kO5Qv-00051U-3U for pgsql-hackers@postgresql.org; Thu, 01 Oct 2020 20:44:12 +0000 Received: by mail-oo1-xc41.google.com with SMTP id w25so1850094oos.10 for ; Thu, 01 Oct 2020 13:44:08 -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=5rzOEVi9q6zs/XhBnB2bC/5Smhap0wLNH2acvizNgIE=; b=yw8+A23w2p2cGPB/IHZM+i0gCOgrcpDCPHYF/2IXiER/CuGF3cLoFdyq3u7q3COS0T mJ3mhuBcNff1R4K0NyLq/TJkQxedstOU2HX/HrDBLYc9qD1Zr2XLNtu9TlL8fDnwPAea 3yqihcpkAXN7MyQXvjPRJSrNqVk1nR2Yz7G7cFsVs9Q5LbyA53FPRKvng3PEEDl3BxVv 4s5gDVRhzu7T+8uxb+pbCOG7p2jyhrtNcwRISc2X5SrvxZvLpqaB1/kK8QbcdGMdzvj3 3pfhjcDd5/yU6b42UCU1n6cW9ttFRXZH+xKNtikF8JuVs7yQiwq5hSFnF5pikU1AE2u9 qcLQ== 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=5rzOEVi9q6zs/XhBnB2bC/5Smhap0wLNH2acvizNgIE=; b=kav/0i/v0McYePQunhOYDG1XDd0JBFNT+d2rk/pW/tT3E64RKNou8BTPl8fzYp1l3x wAs6S/+QI2ihgFhOwbjprR0v0w+k4QZHgMuKH8X8IEJngMqtFN1fZYadNrbpOesyfVhQ 8QKlDIiAQ98675S9P8XoBnJUFMPx4/7V+qSUBcbUSTKKHZlK9YXgDbS2xaZ+yGLckM9+ ZmLws5pTaV5GWVWe7TJZMpNT6r/YgNN06wnkOuXnmf4rPRBBmBaH5B3gO97giHILyGxr r32ndbqHw5+hXXrEyEJL19fXP4JEUL7U6T4yNBRmqmHJYzUvnWhGuvmUGMBIyOiBWdvi YOGw== X-Gm-Message-State: AOAM532NyaAepBnLM0tIYAIZxTe15PhWWrI/+YQ05OPU/O8dbLtwffMW h2cUjdrnli4c+rPO8MrW2vbd X-Google-Smtp-Source: ABdhPJxnAQTxFOoFgDw7bJPEMKBx8oF4eyv1LWD8DqDoQAVYSJzteHm9croWuHnpxlU9T3t1YRUwFQ== X-Received: by 2002:a4a:3b44:: with SMTP id s65mr7084329oos.85.1601585047058; Thu, 01 Oct 2020 13:44:07 -0700 (PDT) Received: from ?IPv6:2600:1700:722:4630::43? ([2600:1700:722:4630::43]) by smtp.gmail.com with ESMTPSA id k3sm1610288oof.6.2020.10.01.13.44.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Oct 2020 13:44:05 -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 16:44:03 -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? > > sys (jacana): stdio native: unixcrlf cheers andrew -- Andrew Dunstan https://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services