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 1nlay5-0003Sr-Bm for pgsql-hackers@arkaria.postgresql.org; Mon, 02 May 2022 18:40:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nlay4-0001J2-8f for pgsql-hackers@arkaria.postgresql.org; Mon, 02 May 2022 18:40:20 +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 1nlay3-0001Iq-VS for pgsql-hackers@lists.postgresql.org; Mon, 02 May 2022 18:40:19 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nlaxx-0003Xf-MV for pgsql-hackers@lists.postgresql.org; Mon, 02 May 2022 18:40:19 +0000 Received: by mail-ej1-x62e.google.com with SMTP id k23so29390514ejd.3 for ; Mon, 02 May 2022 11:40:13 -0700 (PDT) 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=AwFTSMPTe0ece645IG4SHMHd8ChW864iQxpEH75J2tY=; b=hNApvJXPFZa+jISgpDw5nCN+gOYyTdOM3N6wAWLPrkkMg3JWL3OtV28IQQ6rvPJOHf Jdg5Uks2+VNfgSCV/+dXIe/sPiqtzRon8JtwG0K0jQ7gUKhol6at2NE/Ez3/Wxoyp8JP edXqCjZ/Nht6a8OgKkvGFeTYQ0zlEw9vUI43E0ReJGnHADf9oyAIsc8z1alxJL6kt/bZ SL5Y36DIiq/R4WeWxql/frKjaf/lN6csXxGU9ufY174jpHeQJgHTA16lQBr3CL+J3XbV qsiOsw+tcB3qXXjFX4f2XNSEZ+sxKz3M26s1Jino5jh0R7iVJMcld8IaRVGmf8VN8JGB 5jDA== 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=AwFTSMPTe0ece645IG4SHMHd8ChW864iQxpEH75J2tY=; b=R+93Lk6i4tmRtK906tObr1/Q9S/TY8m2/pOhMewTR/lXJNFdFWDowqhJ9eGSr5NVZd QsHYUflvni0+1H/PA3EBuZ8HvgnlYTn9SK5y9ym0FvFz7zwj80DMkF2IZdGOVeJsE5CG Tz3VYBWwGw9FfsJZXE0vsBBGqLCBZRISsJ/3sjwt7gHL4OFKzaAjuWkYPXGyayUfFAE5 Q7hOfr0fNz9eAE18mB44u5pdPEEiii95MM5x6u4YDXI2UCNoHJ+RJ0IC1wIocaZZrNPM Rki62EcJ/P9ILT7uFUn0OxIJTQnt72Te3TmoJQmIl0Lvt84PZToSZh3lPBgOyz1qq2jG jxUA== X-Gm-Message-State: AOAM533lv3S9guejJJfpMWVU9oZV7lIqxofMexnWcVlAQymGgP84YRpf 6it5lK0zIRdfxiEHx+x3D55dGNIDnBfTRa6v4S4QzMjULGp/hzwIb4Wk0uJs5EWvYipA3DVghRP AbscsQkMmTWlFy980Gk7NQzfPXdWtTn7S34CHSfcOocZem/IyaXP/x9TOUmCLiKrrxwNCzofeXU yBIVRkQppzeI0IyH+uXwHHP2I9ycmqNz409hOU7jB8vP9eiTphc/xU X-Google-Smtp-Source: ABdhPJxXUo4ggFtp4V/2t6Q72In2hbVlrlTFrX0ZAhSc9WDZPshV4YNNergHuxlm8i0rYOKAVN9vVQ== X-Received: by 2002:a17:907:3e28:b0:6f4:3900:78f8 with SMTP id hp40-20020a1709073e2800b006f4390078f8mr7662892ejc.736.1651516811760; Mon, 02 May 2022 11:40:11 -0700 (PDT) Received: from [10.137.0.17] (ip-86-49-250-165.net.upcbroadband.cz. [86.49.250.165]) by smtp.gmail.com with ESMTPSA id dq8-20020a170907734800b006f3ef214e23sm3824991ejc.137.2022.05.02.11.40.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 May 2022 11:40:10 -0700 (PDT) Message-ID: Date: Mon, 2 May 2022 20:40:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: bogus: logical replication rows/cols combinations Content-Language: en-US To: Alvaro Herrera Cc: Amit Kapila , Peter Eisentraut , Pg Hackers References: <202205021751.aosyba2mh7bc@alvherre.pgsql> From: Tomas Vondra In-Reply-To: <202205021751.aosyba2mh7bc@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 5/2/22 19:51, Alvaro Herrera wrote: > On 2022-May-02, Tomas Vondra wrote: > >> pgoutput.c is relies on relcache callbacks to get notified of changes. >> See the stuff that touches replicate_valid and publications_valid. So >> the walsender should notice the changes immediately. > > Hmm, I suppose that makes any changes easy enough to detect. We don't > need a separate signalling mechanism. > > But it does mean that the walsender needs to test the consistency of > [rowfilter, column list, published actions] whenever they change for any > of the current publications and it is working for more than one, and > disconnect if the combination no longer complies with the rules. By the > next time the replica tries to connect, START_REPLICATION will throw the > error. > >> Why would we need to know publications replicated by other walsenders? >> And what if the subscriber is not connected at the moment? In that case >> there'll be no walsender. > > Sure, if the replica is not connected then there's no issue -- as you > say, that replica will fail at START_REPLICATION time. > Right, I got confused a bit. Anyway, I think the main challenge is defining what exactly we want to check, in order to ensure "sensible" behavior, without preventing way too many sensible use cases. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company