Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rAsIf-008XyT-Ob for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Dec 2023 13:50:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rAsIe-009lVF-Da for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Dec 2023 13:50:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rAsIe-009lV7-4J for pgsql-hackers@lists.postgresql.org; Wed, 06 Dec 2023 13:50:52 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rAsIa-0095Sr-Rw for pgsql-hackers@lists.postgresql.org; Wed, 06 Dec 2023 13:50:50 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a1915034144so111179366b.0 for ; Wed, 06 Dec 2023 05:50:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1701870647; x=1702475447; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=VR5dFiwQ7PUrPfwOar3FoGQfthaaLNcOiStqNHFqGvg=; b=YTojXU9vwjDa7140axCIcZlj6BBn7j43E/ab0gkcpixwem7yefveL1F4+Dp5qeGaLP 9PEJ56bIwhlNpgHaTYEYXIYd7uD638+8I1DRHi6VWMErTNx84o1klRV2GAqfqb59s/3P CwBFNe8k/Is8O5EYFt/xZtmdtdbBRvX/Emqvlm7i/X/9/qIxc4CDlx0/9ef6w+BQAwbB iZNNDnu7pUf76WweDFXZb7zDALOptYHw1EeOTSxssMq10N7LVpaO5lx2wm/oSc9F/Npg AliaXgW60WIZxJTTHkCFuLHjopvEWx/nYLO1e9cBf495ciV5ZT7k5XvaLAgy+wtVQKHs 0eGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701870647; x=1702475447; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VR5dFiwQ7PUrPfwOar3FoGQfthaaLNcOiStqNHFqGvg=; b=fOTAdVibhD2boDnTxOfcxpk2G1NRw8gIpoIYLvun+7G8XXSLh5JJNCQR9U24hstooM jmn52gFNlMA2T8uVrWk5puWtYy8Eq2redHMllC3XCsyrI5Tr5t8vXIs2hyaIaG9C15Wq t9hbhYAPYducNYAnxlL98LZfCm6n2qdLP5Z23lYCYfainhlnu3MDx6f2GF+DsPk5s6xB SDk3uw232Y3IMpXTvO9J3s4Df5k7HIssLzM/IJRS3p06aEJ++F4VyrFM9cOSvHAnQ2cC ChHlgHCI7cK+CM5kg9xGBEg4i0nJtRrqDne4zarrzBQqRAiuJRn5DXfjhLvo6R6Cuk7q USpw== X-Gm-Message-State: AOJu0YzD3b/OEP1idotDHrVj8SXG+u1EIFiPFvG5JDTHYntBmjfQ76rr ObPzMNv+ndl8Er7CGgziX5/pLQ== X-Google-Smtp-Source: AGHT+IEq0IT3p99wxDE5Q6Rm45GDZEJV9kvcXP5qw+NewtSeoJ/resg99U0QNpcYEjoe+wOlsodXCg== X-Received: by 2002:a17:906:3f58:b0:a19:a19b:c702 with SMTP id f24-20020a1709063f5800b00a19a19bc702mr710547ejj.82.1701870647177; Wed, 06 Dec 2023 05:50:47 -0800 (PST) Received: from [10.137.0.17] (ip-86-49-229-30.bb.vodafone.cz. [86.49.229.30]) by smtp.gmail.com with ESMTPSA id o14-20020a1709061d4e00b00a1caa9dd507sm2304166ejh.52.2023.12.06.05.50.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Dec 2023 05:50:46 -0800 (PST) Message-ID: <421b4920-4c59-ad72-281c-4d578d889355@enterprisedb.com> Date: Wed, 6 Dec 2023 14:50:45 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: logical decoding and replication of sequences, take 2 Content-Language: en-US To: Amit Kapila Cc: "Hayato Kuroda (Fujitsu)" , "Zhijie Hou (Fujitsu)" , Ashutosh Bapat , PostgreSQL Hackers , Masahiko Sawada , Peter Eisentraut , Dilip Kumar References: <36f3a200-f185-887c-da08-fdc866436e6c@enterprisedb.com> <195be236-7580-72c6-97c7-59f06c4e093c@enterprisedb.com> <4954a4f8-ba9d-d352-571b-7b94372ea5ae@enterprisedb.com> <418ff5ac-1664-9038-8ac6-0dd308b5df07@enterprisedb.com> <8a2f25d8-23d4-4ab8-2a23-7c8d2d976209@enterprisedb.com> <44abc443-3266-0227-4d45-4dacadd4cec9@enterprisedb.com> From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/6/23 11:19, Amit Kapila wrote: > On Sun, Dec 3, 2023 at 11:56 PM Tomas Vondra > wrote: >> >> On 12/3/23 18:52, Tomas Vondra wrote: >>> ... >>> >> >> Another idea is that maybe we could somehow inform ReorderBuffer whether >> the output plugin even is interested in sequences. That'd help with >> cases where we don't even want/need to replicate sequences, e.g. because >> the publication does not specify (publish=sequence). >> >> What happens now in that case is we call ReorderBufferQueueSequence(), >> it does the whole dance with starting/aborting the transaction, calls >> rb->sequence() which just does "meh" and doesn't do anything. Maybe we >> could just short-circuit this by asking the output plugin somehow. >> >> In an extreme case the plugin may not even specify the sequence >> callbacks, and we're still doing all of this. >> > > We could explore this but I guess it won't solve the problem we are > facing in cases where all sequences are published and plugin has > specified the sequence callbacks. I think it would add some overhead > of this check in positive cases where we decide to anyway do send the > changes. Well, the idea is the check would be very simple (essentially just a boolean flag somewhere), so not really measurable. And if the plugin requests decoding sequences, I guess it's natural it may have a bit of overhead. It needs to do more things, after all. It needs to be acceptable, ofc. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company