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 1ipFod-0000nP-0Z for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jan 2020 18:12:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ipFob-00028t-06 for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jan 2020 18:12:21 +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 1ipFoa-00028m-FD for pgsql-hackers@lists.postgresql.org; Wed, 08 Jan 2020 18:12:20 +0000 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ipFoT-0005sM-R1 for pgsql-hackers@postgresql.org; Wed, 08 Jan 2020 18:12:19 +0000 Received: by mail-qv1-xf41.google.com with SMTP id x1so1802338qvr.8 for ; Wed, 08 Jan 2020 10:12:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=BHOI+20xWbjQln0LVP28Gf1ICt78tI2SYHac1gifuvw=; b=IA1acoaFg5iD7EahwExzWih5WiBFBvPuRT9HSnfnjAWRmMO5jmHHtB5HI7z5RgfdmG p259InenI5DPhqXzMV1xdOl8x8GjAR3vkPOAEKFvtnIXTelyb1AKZLZeNvxi3MGIpPhD 4wb/znjZOD5019aV3VpiUC4ZlhDKjv3Np+J6SbZe550sTD4Rc7g/ZzFswid6DSZvU4CV ZoB3aobxe6Ow7i5Uy5K/YF1oQzSLC4HS4x/KreH+mkxqWTOzmeUmA2HkjZtQBXS5zZZl hZaAD8umZn2uwj5BWpkrkLZyJEYbELnuvHyHf+6sriZTER7QFB5LHN1JWpneuokUWqrv inGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=BHOI+20xWbjQln0LVP28Gf1ICt78tI2SYHac1gifuvw=; b=c1vYWXt3eYZHyRMUc4QVMCDBafHNHUzOchwZUhF9ZqSmxZCx4fHKZzNWWl+i4hmnW3 EpZOsm/ayVpYVoe8JlM9AfyPXy1+7l3PyEeooAPS8r/AjT/7CcAna6a0C2vjJFtsL4od 9dcacL83A49OYsXllPLIrwNjH+TttL/T9c19ApQYtRxpJALPPUK4eFdKkwrmNNVuq/tI UJCaAH8wqUpw/QYDZs1EMQfT9vbgqtdcCNQBYl4wzDHPwPa5aruyp2L+LNnJmL2iLVS8 tC7t+UOiXKXBJQIGqyl3QoF6TuhFppq5YwiqCse8FjYjMbhxN8iISpabVmgnc2x5UHLO u8Ag== X-Gm-Message-State: APjAAAUUbxITh4wZuERtTf17TTx416qtqrkxPyakYyVCAlu2ckrIT3T3 ev4GuIMyu7/7x4CI3YcTfE7Spw== X-Google-Smtp-Source: APXvYqw90YJF8ExhEd4el7g1I/WgyMzCjrzmr7Vpv5IgmVgeeE+9VmlpfWJR2hAamNs6usEAx75SUQ== X-Received: by 2002:a0c:e610:: with SMTP id z16mr5229161qvm.215.1578507132764; Wed, 08 Jan 2020 10:12:12 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([190.95.19.128]) by smtp.gmail.com with ESMTPSA id t198sm1745332qke.6.2020.01.08.10.12.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 10:12:07 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 690C4301D29; Wed, 8 Jan 2020 15:12:05 -0300 (-03) Date: Wed, 8 Jan 2020 15:12:05 -0300 From: Alvaro Herrera To: Tom Lane Cc: Tomas Vondra , Kyotaro Horiguchi , craig@2ndquadrant.com, pgsql-hackers@postgresql.org Subject: Re: xact_start for walsender & logical decoding not updated Message-ID: <20200108181205.GA3387@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5016.1578444168@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Jan-07, Tom Lane wrote: > Alvaro Herrera writes: > > On 2020-Jan-07, Tom Lane wrote: > > That seems a pretty simple patch; attached (untested). > > I think you want && not ||, but otherwise that looks about right. Thanks, you were right; pushed. > > However, my > > patch seemed a pretty decent way to achieve the goal, and I don't > > understand why it causes the failure, or indeed why we care about > > stmtStartTimestamp at all. I'll look into this again tomorrow. > > I'm not 100% sure why the failure either. The assertion is in > code that should only be reached in a parallel worker, and surely > walsenders don't launch parallel queries? But it looks to me > that all the critters using force_parallel_mode are unhappy. I reproduced here with force_parallel_mode=regress, and indeed what is happening is that log.rep. subscription walsenders (???) are running queries per commands/subscriptioncmds.c::fetch_table_list(), and under that GUC they beget parallel workers; and because the parent has am_walsender=true then they pass a timestamp of 0 to the children; but the children retain am_walsender=false, so the assertion fires. I didn't spend more time on that, but it seems strange and possibly dangerous, since am_walsender is used to implement some restrictions. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services