Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1feeuh-0001MZ-MP for pgsql-hackers@arkaria.postgresql.org; Sun, 15 Jul 2018 11:10:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1feeuf-0003JX-3C for pgsql-hackers@arkaria.postgresql.org; Sun, 15 Jul 2018 11:10:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1feeue-0003Au-Pf for pgsql-hackers@lists.postgresql.org; Sun, 15 Jul 2018 11:10:00 +0000 Received: from mail-oi0-x243.google.com ([2607:f8b0:4003:c06::243]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1feeuX-0001WD-3X for pgsql-hackers@lists.postgresql.org; Sun, 15 Jul 2018 11:09:59 +0000 Received: by mail-oi0-x243.google.com with SMTP id v8-v6so69834445oie.5 for ; Sun, 15 Jul 2018 04:09:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=SheDNxrliqzofPAtjX73xK+SvDqqZbFQpwWTU25CGzQ=; b=U9LNCI5yvqJqh6YnwYhVKdEZ0kQRA+VU6gJKnguLIz7eHjQKHULs9SPyHZvDIX0q7A mdPD9QA7Cr/OGAAj5HT9DafLhWp+svdUqpNNq+Rfuq+jeGX0QDfuB0JdcxkCm6QJQbaQ ENJA+zituIDcHDTKuYMuvr/Pm1IzhZ1q4vuizGh9tHXIM3uqH9pC7ZpFe3EJPoBoLW10 Llez/Eio3Vokljj8Yp55+d/ZwyUFffGAB7pP4yLUlTOgI379ybg6Y+swI5X3xVpOOddU DfzjrqkaWbjzes6Snf+4E3t2vBnnWloM5RHt+qM9Kg1z621sF4cVP88CpZBg3Mc1uXXs X2Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=SheDNxrliqzofPAtjX73xK+SvDqqZbFQpwWTU25CGzQ=; b=fR3ndDTSFnfdWnI8eKC5Pwd2pRkHNpxhloiEWX8A+t65sZS1woXR3SDSE+XygrSJrO 8Omqjp7vwBQJQmh6Whbl4IWpboULf2SWrFjxKWIHccY/ijcO7UuDG+Iic1YqEeya4v4D iO/KnUQsql4foM6TcQGtBCLknJZow6m0uCanNPk2jH6/Ordo0nTbuJCHzbxaXKOSTd53 QB5AVRhR6WPBelXSf3gw9bthxEImfldf+b78NQl4xnN2kOTEsPmi3M2ewVfLD4AoXGRf 3thRxq3t6dHKqyXtV9BbmLWnqkJ/++jRKughIka2H5eBVqRdzB7yYa49TJ5M65kGKviB 5Iyw== X-Gm-Message-State: AOUpUlHOo6oipUEfEwNKryZe/gss4fc5TMTAtSwPtWCcvtKOXHDiUyuA /f39/iugbQF6JwQK/ZESW/5mhOvmk8Eq3lSLYus= X-Google-Smtp-Source: AAOMgpciJ8qQAvE/TcGpS7Jqk0WHAxWCXsoTbYRW5228n8nEIEUtacLdy3t0lhq+6Up8CPWmwUX3j5YlFlWZgmxT0EI= X-Received: by 2002:aca:d0d7:: with SMTP id j84-v6mr12867182oiy.189.1531652990580; Sun, 15 Jul 2018 04:09:50 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:795a:0:0:0:0:0 with HTTP; Sun, 15 Jul 2018 04:09:50 -0700 (PDT) In-Reply-To: <1922.1531592205@sss.pgh.pa.us> References: <20180712075909.GG7352@paquier.xyz> <11887.1531432634@sss.pgh.pa.us> <1922.1531592205@sss.pgh.pa.us> From: Amit Kapila Date: Sun, 15 Jul 2018 16:39:50 +0530 Message-ID: Subject: Re: YA race condition in 001_stream_rep.pl (was Re: pgsql: Allow using the updated tuple while moving it to a different par) To: Tom Lane Cc: Michael Paquier , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sat, Jul 14, 2018 at 11:46 PM, Tom Lane wrote: > I wrote: > > I can reproduce the failure pretty reliably with a hack like the one > attached, which makes it unlikely that the walreceiver will send a > feedback message instantly when it gets the SIGHUP. > > So the issue boils down to this: the test script is, effectively, > assuming that it's guaranteed that the walreceiver will send a feedback > message before it shuts down; but there is no such guarantee. Is this > a bug in the test script, or a bug in the walreceiver logic? I can > see the value of having such a guarantee, but I also think it would be > nigh impossible to make it a bulletproof guarantee. We could perhaps > add "XLogWalRcvSendHSFeedback(true)" somewhere closer to process exit, > but that might add more failure modes than it removes. > > Or we could change the test script to wait for feedback before it > issues the shutdown, but then I think the test is a bit pointless. > Currently, neither the code nor our documentation suggests that we can expect HSFeedback before the shutdown, so it is better to adjust the test. If the sole purpose of the test is to test feedback after shutdown, then it is worth considering to remove the test altogether. -- With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com