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 1nJIMW-0007I8-Se for pgsql-committers@arkaria.postgresql.org; Sun, 13 Feb 2022 17:08:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nJIMU-0002dy-MF for pgsql-committers@arkaria.postgresql.org; Sun, 13 Feb 2022 17:08:34 +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 1nJIMU-0002bS-3O for pgsql-committers@lists.postgresql.org; Sun, 13 Feb 2022 17:08:34 +0000 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nJIMQ-0000Li-1p for pgsql-committers@lists.postgresql.org; Sun, 13 Feb 2022 17:08:33 +0000 Received: by mail-ed1-x52c.google.com with SMTP id h18so1556978edb.7 for ; Sun, 13 Feb 2022 09:08:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=gp6bClTp7vF5LMsDnF01QIknjMycy6tGtjs+V2LMT3o=; b=NcoyTdzcVYwjfVDtbFuaSlZ7xpcFS17B/F2TEwTixSVPUzBYWw2wMZ8DpwwIwusUsH lF72VqIgmQmLHkOhxXDXjRJYn9sBRQtGSaZrfJu5CpUsF6/H77gVI7sOM2dy+5MWq4od 2hxlHKzohyWc5930d+bBZOskSiubReZP8f+AVBCtBZBc/qWXSF8QIpnl9Xt1ZrZvugAG YE7LCb8AX7Z8CCYabbHk3iGh6k0ssEpvaySJcUoruZk7z5zDJ0hRQAipfB9i3GIAgDyC h5y0pWBgddf4g1G/hUZl7inc+0+8fGgvEvUbGj3Oxl0mHW2KFGrC7yGFSwRbkYuq9pHX kz4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=gp6bClTp7vF5LMsDnF01QIknjMycy6tGtjs+V2LMT3o=; b=YBKtPeqAxfFjynH3vOCRwyjFbC289AgtHppBkyL2rH9YApJQKssqgnBMoLinp0+ecW lxTuFrZh8xvXc5zE+69KndRPGa25XA1dePWKtOxQPy9MFV9oufj8unpCNo7xgIzr9/je betNIo33SNvfxq/Jtf4zD9otOQWmnkQ3m1rcCQp5EhxPh8y7U6CqpyhaU9Cwc47/KXxA w3cVAfGY4ipMyiLOL0YBrDGcE/Lzvh+DijzI1Z/ma7mD9UT5VkiAVpxi5qY+Kx69jN76 6IXOxl6XDhB0MHrIfdeONehl/5o0XnobBxq7mZu+67L5THkCxDwRw/l0TiXadJ6ulhs9 tmxQ== X-Gm-Message-State: AOAM532XgShIIIRFQdSzdiurWJ1SepiYBuCru+NPUUASpRM/zeNLLjIh WSDK8GpDZyibROicfsbUDgdzsNRpG+QXAnVuZghtmJZ5T6YxExED3VIVhB84VbYHSLnHMDCp1BX Lqd6aHpRJXQcpYZlNVRagSaFV6/tUosiAYz2JMjVIZdkz4kO2vPUQ86tV+kxbwjfUC8HdpNWv0K OnLkZzuD72jub8vsbagrzsFoIVcoWAqepHoyVFpry7fKQDdzlGbojQ7LaPB15s X-Google-Smtp-Source: ABdhPJydNqSxfaDYbX1jt8BmYRXveK7/kJJYRy+t4d/7pmRIXRy8g1P/TdMr8Pzk2d9MyW/ERWLOxw== X-Received: by 2002:a05:6402:2789:: with SMTP id b9mr11599717ede.308.1644772109029; Sun, 13 Feb 2022 09:08:29 -0800 (PST) Received: from [10.137.0.19] (ip-86-49-251-241.net.upcbroadband.cz. [86.49.251.241]) by smtp.gmail.com with ESMTPSA id t4sm607609ejo.194.2022.02.13.09.08.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 13 Feb 2022 09:08:28 -0800 (PST) Message-ID: <3dd2a8ed-f757-5c22-7a0a-91b0b4f11174@enterprisedb.com> Date: Sun, 13 Feb 2022 18:08:26 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: pgsql: Fix skip-empty-xacts with sequences in test_decoding Content-Language: en-US To: Alvaro Herrera , Tomas Vondra Cc: pgsql-committers@lists.postgresql.org References: <202202131526.2n2bcdx2cjse@alvherre.pgsql> From: Tomas Vondra In-Reply-To: <202202131526.2n2bcdx2cjse@alvherre.pgsql> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2/13/22 16:26, Alvaro Herrera wrote: > On 2022-Feb-12, Tomas Vondra wrote: > >> Fix skip-empty-xacts with sequences in test_decoding >> >> Regression tests need to use skip-empty-xacts = false, because there >> might be accidental concurrent activity (like autovacuum), particularly >> on slow machines. The tests added by 80901b3291 failed to do that in a >> couple places, triggering occasional failures on buildfarm. > > I think you meant "... need to use skip-empty-xacts = true", since you > changed the value from 0 to 1, and the point is precisely to *skip* > those transactions. (The hidden double negative "skip=false" seems > quite confusing BTW.) > Yeah, that's what I meant :-( >> Fixing the tests however uncovered a bug in the code, because sequence >> callbacks did not handle skip-empty-xacts properly. For trasactional >> increments we need to check/update the xact_wrote_changes flag, and emit >> the BEGIN if it's the first change in the transaction. > > Hmm. Perhaps there should be a separate test script that runs various > things under skip-empty-xacts=0 and somehow protected against ancillary > activities (maybe a TAP test using autovacuum=0), just so that this new > code is covered ... > I'm not sure what exactly would be the benefit? I mean, it'd be testing exactly the same thing as now - actually less than now, because instead of ignoring empty transactions in the last step (output plugin), we'd make sure not to have any empty transactions. For the record, the new code in sequence decoding is tested already, at least for transactional increments. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company