Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSOtW-0001kr-Fz for pgsql-bugs@arkaria.postgresql.org; Sun, 19 May 2019 16:42:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hSOtS-0004tg-U7 for pgsql-bugs@arkaria.postgresql.org; Sun, 19 May 2019 16:42:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSOtS-0004s1-C5 for pgsql-bugs@lists.postgresql.org; Sun, 19 May 2019 16:42:38 +0000 Received: from mail-oi1-x243.google.com ([2607:f8b0:4864:20::243]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSOtK-00005V-W8 for pgsql-bugs@lists.postgresql.org; Sun, 19 May 2019 16:42:37 +0000 Received: by mail-oi1-x243.google.com with SMTP id y10so8336082oia.8 for ; Sun, 19 May 2019 09:42:30 -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:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=klvI2CYdIJZLLX4fSAGQphc6yBwIVUnwRRdDXKqduUQ=; b=Uaarshb+hncwe7H754wtER84g1KyqXTUbe4iTWVZfikqsS39n3odxBA6MVWCEmDYNy niVHEinDIGtQlBWub9vs8dw+EUZtpImxa1XdX5fxiMYzDP90fTPBoUQ7vRSzCfM3NoPF UoD0HTXGWamHmgM/OOcpLcbHEzTm3E5d8dsgSND9KQEjwpOvNc3+xfoogEYykk19ftY5 dftKzsuUQ5nfR/oJ0QVe88Sf0Om68RSZM2RhMQThSfxM3TYnJ6uBvRQcjmIrnsxBvyLo ySUS0AEG9PY5xTOruLscFDNCvoXes+JauZw0E5MuFcdVblpmKAm/Dnd9/LWuQ3IpiHJM 2WDw== 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:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=klvI2CYdIJZLLX4fSAGQphc6yBwIVUnwRRdDXKqduUQ=; b=YysPo3bPsVab6Aef8R3mIkSmKq45GsANdDYDmOpE679Tf0VPmIQZix8UP8Qy8ajwsa +LXbL978RPcznWVnMKDYnN5lTMVt8cL2WGybAKk9caPdVvNVZnwggN8W1D5pbYTKZDrL qTzWZ1Pq9fEO0dcOO+ylESA4oOT2LRfK8YFs20p62Hap8YW2LBpUdjfxAIDrPpnaZYFh SFTW8fyozt/1PJaTF5GUQgeXZBuOrKzwm6dQw+gLlvoxCKTo6s1zbLJPGFOMHVLj43UT tGQk2DABNxv2yYoS+cauQySGpysddUGm9A/LaLon+jsIu2VOM6dBxEHO7C9w5VTBYV3M nXgw== X-Gm-Message-State: APjAAAUyhWXE77TdB2SQ1B1gBb27xaV4akeyL0tLMASbJEdcNK+tuNGl 6Zkg+nHgMdA8zZWnl9p+mCgIjnpdjlq5IEQ3ws1Zm/y9+r+44BqslCQYx3dFnsGCRj76nXbvYM8 BSGVrhDwVlN3pOM+G8ozuytmG7qR6uxtDjfxux/Q1V2iF/Tf0yVRkLpHwLKHGGXtafkq7uTmOLT oVToIXRCAqM31pZulzIz8= X-Google-Smtp-Source: APXvYqxiZ3uD8SRy8ZpuDV3dQ/TJQoNvJ2JgPNCqZawgtnE48mRz5Dcr0FETpko1mE1F/4RQPLKc+A== X-Received: by 2002:aca:ba56:: with SMTP id k83mr5948480oif.7.1558284149930; Sun, 19 May 2019 09:42:29 -0700 (PDT) Received: from [192.168.10.146] (99-10-92-30.lightspeed.rlghnc.sbcglobal.net. [99.10.92.30]) by smtp.gmail.com with ESMTPSA id l126sm5234074oia.40.2019.05.19.09.42.28 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Sun, 19 May 2019 09:42:29 -0700 (PDT) From: Andrew Dunstan X-Google-Original-From: Andrew Dunstan Subject: Re: BUG #15804: Assertion failure when using logging_collector with EXEC_BACKEND To: Tom Lane , Michael Paquier Cc: Andres Freund , Peter Eisentraut , Yuli Khodorkovskiy , pgsql-bugs@lists.postgresql.org References: <20190516021903.GB1415@paquier.xyz> <28927.1557977558@sss.pgh.pa.us> <20190516035617.GC1415@paquier.xyz> <20190516043618.GD1415@paquier.xyz> <31437.1557982294@sss.pgh.pa.us> <20190516060628.GE1415@paquier.xyz> <20190517042536.GM20887@paquier.xyz> <20190517202443.gw4zdfkpwgsjdel6@alap3.anarazel.de> <20190518093522.GA19212@paquier.xyz> <28565.1558196308@sss.pgh.pa.us> <20190519004344.GA3653@paquier.xyz> <22995.1558278322@sss.pgh.pa.us> <27719.1558282181@sss.pgh.pa.us> Openpgp: preference=signencrypt Autocrypt: addr=andrew.dunstan@2ndQuadrant.com; prefer-encrypt=mutual; keydata= xsBNBE7KWFkBCAClridxur2AIc7eW2AR7izbfp3EnNefie2HbLF0izW5Ik5UjX2HBXBx4syI gY6b0ugohXrr274+baoAlvSbq6cAoQuEVrk5IZFzt20b1Xkx65FwGSEj526yiKLocqkJceSq Xr9xcA5SGY+FZv441chh5SU92v4q6z+6LPpoHOh97ptAVXZYNTtU0LevyvD5lja0TzbvJm6C eFXitJfnm1pLEr0DGJCR/iUOl/N62Kh4855zZC7NHIjQHPOvV5Stz/l5ilDhvGVk+xkXFPys SjZoUr1rXhYLpiyi5sR0X9FHXT0KnGuz1F5ERO7ZTLSSQ6fJwPj6gOk9K+vvoKvoeql5ABEB AAHNL0FuZHJldyBEdW5zdGFuIDxhbmRyZXcuZHVuc3RhbkAybmRRdW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QDMIy1fU6KyQFLmQJp/QJyhKWzm9jWh8ee w8jVaoMY0Kbq5N7RqisEx1Lu/Iw646UphdYzQNymf+kbiU5Kf4I6DhzV8w9sie1Bo1juNj3I c5/fFJsmxljbnaDbXPcnFsur1Oo9mIHFakgWgOBMuxoWfjONiLjjLh/9+ZIqSSLX Message-ID: <16df9d01-8b03-2664-a18c-16c40186f5ab@2ndQuadrant.com> Date: Sun, 19 May 2019 12:42:27 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <27719.1558282181@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-MW List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 5/19/19 12:09 PM, Tom Lane wrote: > I went back to take a closer look at why the existing regression tests > failed to detect this problem. As Michael already noted, > src/bin/pg_ctl/t/004_logrotate.pl does try to exercise the logging > collector, and we do have a couple of Windows machines that run the > TAP tests, so how'd it escape notice? > > The answer indeed seems to be that it *was* noticed, but Andrew failed > to realize what he was seeing: > > Author: Andrew Dunstan > Branch: master [d611175e5] 2019-03-03 18:19:44 -0500 > > Don't do pg_ctl logrotate test on Windows > =20 > The test crashes and burns quite badly, for some reason, but even i= f it > didn't it wouldn't work, since Windows doesn't let you rename a fil= e > held by a running process. > > But even when we do run it, it fails to detect any problem, because > it's only testing for the existence of a log file not whether anything > ever gets written into it. As it happens, SysLogger_Start() creates > the initial log file right in the postmaster (to validate the logging > parameters), so as 004_logrotate.pl is constituted it fails to prove > that the syslogger process got launched at all. That's why it > "passes" even when the syslogger is crashing instantly on launch. > > Given the current unpleasantness, I think it's quite important that > we fix 004_logrotate.pl so that it (a) poses an end-to-end test > and (b) works on Windows. I think (a) could be managed by having > the test execute guaranteed-to-fail SQL commands ("select 1/0" or > the like) and making it look into the log file to verify that the > expected error messages appear there. (b) is a little harder in > view of Andrew's point that we can't just summarily rename or unlink > the log file. But I don't much like using a fixed log file name > in the test anyway. I propose that we let it use the default logfile > pattern (postgresql-%Y-%m-%d_%H%M%S.log), and that we just sleep for a > couple of seconds before requesting rotation, and that we verify that > the file name actually changed. We can avoid difficult issues of > guessing what file name got used by having the test script look into > "current_logfiles" to get the name --- which is another feature that > there's exactly zero test coverage of right now, so that seems like > a win all around. > Worth a try. cheers andrew --=20 Andrew Dunstan https://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services