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 1nSelm-0002re-Us for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Mar 2022 12:53:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nSell-0001m8-RS for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Mar 2022 12:53:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nSell-0001jN-I9 for pgsql-hackers@lists.postgresql.org; Fri, 11 Mar 2022 12:53:21 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nSeli-0003Ov-Vs for pgsql-hackers@lists.postgresql.org; Fri, 11 Mar 2022 12:53:20 +0000 Received: by mail-ej1-x629.google.com with SMTP id qa43so18754793ejc.12 for ; Fri, 11 Mar 2022 04:53:18 -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=3xEynPCaf8ZV7Pn6jZw9mh1Fa70KQjKPCyLQfToeQK4=; b=GQ3xMO8N/n4asxp164RvZUS/jkIExs7OniWTkU6Ul7AgHqFyUS/Mt48flIIHYYzSwb srbzlrLR1UB2IYJev2AmcC1/X3G1dj4UI7Jl4laZJD6TBjvBMv0S+GGeIwWUxzLxNFCM uXgvajQ6EynPbFGCDvxgLLZL19jrKw8u6EvmIRiwD1cmzvReyTfdWvmU8LmbpvPvAyku ZPeKUkYV+ASq9EVKcVwzSSPVQ0Nr/UXcgQtEiefYHW9SAIm2cr5FQxHA8wzsoICsTixo ByhS4H9ZU/PBjroGkLxibJlrFuwe0fnXajH9sJuUKmzOoHUi1qKKp3bYtqeMV2e1L8lL onjA== 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=3xEynPCaf8ZV7Pn6jZw9mh1Fa70KQjKPCyLQfToeQK4=; b=E2mms102AErORMwCw+SkWdx1Uph7Iz5zMWmVewulfxnjwDE/ivtP5N739XpDxDbo1k qSUYCLBMHFvL6Xz7IjOAZ08tK1lTRdWNjtGhHBN3fjzSrWHJnjBqpsDhbvsU8nzwk9EM 4m6Vjsa8BYKKNfKDLUtMPpNOGwxL3xmq2KgsLkXDFtpXHG5pzfLhz0GZNeOgEbvmEw3/ Mccjxd+uXjg2lNHhbyh0ffkN0rsRnML+YijtK9C76ft6lLRV3gaU51cawHjxvRhUg3J/ NZLSoYiU76HEQOYQ24r4j39SoAh+q61A2ijzvM6N7ROjeq/mT0Q2/Zj36h8ED0TYheV9 ZCXQ== X-Gm-Message-State: AOAM5330CPbLBFeqg6XOdn17M2rAnGzILHzmftiip00Wv+JpDD68Q6tj uiSyykKttSPb/j6xeJk/wih1Ddj4olv4qrUC6d04NeAQpUDEk1rBiDRqP6F8xYOsMLaXu2Cpybb dLGkomwyJTRd3dvt0NC3JESz5R3zwjRyf9qUs83wY3utnqEKZLDGTLtQT1EmKVAAKljprLz8pso /AF3fdYhC1fKeykFBIrOUGcRq+DK6ySkzdOS7Nxath0VsRCfktU6l0gXn81vcz X-Google-Smtp-Source: ABdhPJxH+N1tCh/aPhETkKI9Ym7YyPmGzJD3xS8tOJBbFqacaY/FBdwEsjv15qiUNjLnceUVNTWlGQ== X-Received: by 2002:a17:907:3f9b:b0:6da:6f2b:4b1c with SMTP id hr27-20020a1709073f9b00b006da6f2b4b1cmr8291195ejc.765.1647003197359; Fri, 11 Mar 2022 04:53:17 -0800 (PST) Received: from [10.137.0.18] (ip-86-49-251-241.net.upcbroadband.cz. [86.49.251.241]) by smtp.gmail.com with ESMTPSA id b7-20020a170906708700b006da8440d642sm2990517ejk.113.2022.03.11.04.53.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Mar 2022 04:53:16 -0800 (PST) Message-ID: <4c1e9b47-f00c-8a60-d10b-a42995ccc5e5@enterprisedb.com> Date: Fri, 11 Mar 2022 13:53:15 +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: logical decoding and replication of sequences Content-Language: en-US To: Amit Kapila Cc: Peter Eisentraut , Petr Jelinek , PostgreSQL Hackers References: <90b4e402-3f07-14f4-deca-5eaca31f70a3@enterprisedb.com> <22aef14d-0ea1-9044-c2e7-29f88762eaec@enterprisedb.com> <32540e16-fab6-f790-b99b-5a8fca8bde52@enterprisedb.com> <3B014BE4-EE61-4834-8FF6-937B43C46BC7@enterprisedb.com> <3d68b45a-ceb5-6824-3a39-f53411fd0c88@enterprisedb.com> <802f8b1b-a798-be52-c829-7f0fb9faafd5@enterprisedb.com> <983bf0c7-9757-fd13-3896-8452cf4c4c52@enterprisedb.com> <9211312a-6501-1caf-ee7b-c0d4814b6091@enterprisedb.com> <41ada110-bc7c-32a3-08bd-fb5023dd74ba@enterprisedb.com> <5bd18c76-c38b-86e1-78d3-73c44ac59a7f@enterprisedb.com> <93af17c3-a78d-4918-5f6b-76dfeb2d48bd@enterprisedb.com> <5709e125-a50c-e386-3dce-1d662b588ac7@enterprisedb.com> From: Tomas Vondra In-Reply-To: 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 3/11/22 12:34, Amit Kapila wrote: > On Tue, Mar 8, 2022 at 11:59 PM Tomas Vondra > wrote: >> >> On 3/7/22 22:25, Tomas Vondra wrote: >>>> >>>> Interesting. I can think of one reason that might cause this - we log >>>> the first sequence increment after a checkpoint. So if a checkpoint >>>> happens in an unfortunate place, there'll be an extra WAL record. On >>>> slow / busy machines that's quite possible, I guess. >>>> >>> >>> I've tweaked the checkpoint_interval to make checkpoints more aggressive >>> (set it to 1s), and it seems my hunch was correct - it produces failures >>> exactly like this one. The best fix probably is to just disable decoding >>> of sequences in those tests that are not aimed at testing sequence decoding. >>> >> >> I've pushed a fix for this, adding "include-sequences=0" to a couple >> test_decoding tests, which were failing with concurrent checkpoints. >> >> Unfortunately, I realized we have a similar issue in the "sequences" >> tests too :-( Imagine you do a series of sequence increments, e.g. >> >> SELECT nextval('s') FROM generate_sequences(1,100); >> >> If there's a concurrent checkpoint, this may add an extra WAL record, >> affecting the decoded output (and also the data stored in the sequence >> relation itself). Not sure what to do about this ... >> > > I am also not sure what to do for it but maybe if in some way we can > increase checkpoint timeout or other parameters for these tests then > it would reduce the chances of such failures. The other idea could be > to perform checkpoint before the start of tests to reduce the > possibility of another checkpoint. > Yeah, I had the same ideas, but I'm not sure I like any of them. I doubt we want to make checkpoints extremely rare, and even if we do that it'll still fail on slow machines (e.g. with valgrind, clobber cache etc.). regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company