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 1i5Jzf-0002hZ-6C for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Sep 2019 01:21:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i5Jzc-0000id-E1 for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Sep 2019 01:21:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i5Jzc-0000i8-2s for pgsql-hackers@lists.postgresql.org; Wed, 04 Sep 2019 01:21:52 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i5JzZ-0005dz-3c for pgsql-hackers@postgresql.org; Wed, 04 Sep 2019 01:21:51 +0000 Received: by mail-pg1-x544.google.com with SMTP id x15so10241433pgg.8 for ; Tue, 03 Sep 2019 18:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:message-id:in-reply-to:references:subject :mime-version; bh=3ns3ITdlUO0R8dJwCQlRivG35zsNJT/FYxD7gwZoysA=; b=Uan1lifZEDjIaw/0zRwNYFXzB3yfVsfmjP8LLzVN36nQZJ0anXVWBQsEurg5p/mkSd XEkHEA7cQds3FbXimiU8FKOEjTT954ywzRliK8X4EykE2uH6W9Tgu1BB77ZL0tpnbN2B ZehGbo9a2rdF9AA9mstC3hXIGq5ATbm/6A6ZprSOxmQqtnD4MQP6hxFj3/XAITqqBdwJ ccjrSsGlnQsNdaSrC31cUbJOmdE0zro7zwLX0LOKKNTzM0SJRJCsj9cWVNl0T3OcH0bE 5NBo7S3KLD3OMSNxhvXsNX3nNltiLO0vHuLK8Dd7I4N/iOZHM7ZyKUiZTfhjFmbzHb9a FL3w== 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:message-id:in-reply-to :references:subject:mime-version; bh=3ns3ITdlUO0R8dJwCQlRivG35zsNJT/FYxD7gwZoysA=; b=RErw/0A/+oJi8nfQVUmFoZTzXfLzQQmsZsnYw90RRP5wNa1MJGBkf6dGC2FovL8O5U kfsOIYw084zbiXD4VirdZeqW3hJGlxQZ+vjP/bNUMwiZAtqMPyvE6Iuh5YmaTrKVDSU3 9Zp5EPjqBFE1Ldu32vSwA7MD8q7hUGskhNjaaBsQNDacix2uUVUeuQZFdapjf1f1/uVH c6MYZSWsZdTxio9ajd0SGPtcBOVFMPGFV7gNzGPRVwXIW1qQu8voerjqNvUlZtySDBqM bh6rJdSiF/yeiek9YnmkYwzwGbEVpbnf/YNPl7FhHPMxHzOjc+H5gQdUVFz810Cw+jzQ GFxg== X-Gm-Message-State: APjAAAVOpJcFBPGhTZKMltCu5SnJl3s/as5wTgNVnTF1gz05X9zRXRhl 4SIiBQLjp4ZD1a+CDtvT1MY= X-Google-Smtp-Source: APXvYqxedn0gaH86qnYbdt3jqeYRotdtTpQzS1RLNIZA9nXm+fAU4lP3pgfThRyrvqWCXnEksZw11w== X-Received: by 2002:a62:e30d:: with SMTP id g13mr23328953pfh.42.1567560105635; Tue, 03 Sep 2019 18:21:45 -0700 (PDT) Received: from [192.168.1.31] ([183.88.220.227]) by smtp.gmail.com with ESMTPSA id q33sm856649pja.29.2019.09.03.18.21.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Sep 2019 18:21:44 -0700 (PDT) Date: Wed, 4 Sep 2019 08:21:27 +0700 From: Alexey Zagarin To: Euler Taveira , Erik Rijkers Cc: Andres Freund , Petr Jelinek , pgsql-hackers , Suzuki Hironobu , a.kondratov@postgrespro.ru Message-ID: In-Reply-To: <9f25bd90d9f959f364efe79d92468682@xs4all.nl> References: <7106a0fc-8017-c0fe-a407-9466c9407ff8@2ndquadrant.com> <20190203101439.26xgw5sv7vhgdcz2@alap3.anarazel.de> <94b31725538135038f2fccaf08bf3811@xs4all.nl> <5720d79c-3d09-4ac2-b233-355220471838@Spark> <9f25bd90d9f959f364efe79d92468682@xs4all.nl> Subject: Re: row filtering for logical replication X-Readdle-Message-ID: c6a2bd52-c5cb-4ca3-aace-ebfe5a330b91@Spark MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="5d6f119c_cc1016f_180" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --5d6f119c_cc1016f_180 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline > OK, I'll consider Alexey Kondratov's set of patches as the current > state-of-the-art then. (They still apply.) Alexey's patch is the rebased version of=C2=A0previous=C2=A0Euler's patch= set, with slot type mistake fixed, and adapted to current changes in the= master branch. It also has testing improvements. On the other hand, the = new patches from Euler include more fixes and the implementation of filte= ring in COPY (as far as I can tell from code) which addresses my particul= ar pain point with BDR. Hope they'll be joined soon. :) > It turns out this did not work until I added a wait state after the > CREATE SUBSCRIPTION. It always fails without the wait state, and always= > works with the wait state. > > Do you agree this is a bug=3F I'm not sure this is a bug as after the subscription is added (or a new t= able added to the publication and then the subscription is refreshed), th= e whole table is synchronized using COPY statement. Depending on size of = the table it can take some time. You may want to check srsubstate in pg=5F= subscription=5Frel instead of just sleep for more reliable implementation= . Alexey --5d6f119c_cc1016f_180 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
OK, I'll consider Alexey Kondratov's set of patches as the current state-of-the-art then. (They still apply.)

Alexey's patch is the rebased version of&=23160;previous&=23160;Euler's patch set, = with slot type mistake fixed, and adapted to current changes in the maste= r branch. It also has testing improvements. On the other hand, the new pa= tches from Euler include more fixes and the implementation of filtering i= n COPY (as far as I can tell from code) which addresses my particular pai= n point with BDR. Hope they'll be joined soon. :)

It turns out this did not work until I added a wait state after the<= br /> CREATE SUBSCRIPTION. It always fails without the wait state, and always works with the wait state.

Do you agree this is a bug=3F

I'm not sure this is a bug as after the subscriptio= n is added (or a new table added to the publication and then the subscrip= tion is refreshed), the whole table is synchronized using COPY statement.= Depending on size of the table it can take some time. You may want to ch= eck srsubstate in pg=5Fsubscription=5Frel instead of just sleep for more = reliable implementation.

Alexey
--5d6f119c_cc1016f_180--