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 1nnlNH-0001OV-Il for pgsql-hackers@arkaria.postgresql.org; Sun, 08 May 2022 18:11:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nnlNF-00079Q-Sb for pgsql-hackers@arkaria.postgresql.org; Sun, 08 May 2022 18:11:17 +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 1nnlNF-00079F-2r for pgsql-hackers@lists.postgresql.org; Sun, 08 May 2022 18:11:17 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nnlNA-00032M-R5 for pgsql-hackers@lists.postgresql.org; Sun, 08 May 2022 18:11:16 +0000 Received: by mail-wm1-x331.google.com with SMTP id bd25-20020a05600c1f1900b0039485220e16so839806wmb.0 for ; Sun, 08 May 2022 11:11:12 -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=fU8x7bcNpA/CmWI7L8/sz2rkKCvNpkRbDJqpQ4XAolE=; b=JiXijFND+UqnbL4CupK7XzWAV2HPye50Q+NO2l9igo2ZOpMV0Hv7lqgHXhIt9fuaJo dsSHzM7SY52RNYT5HqbpoTNuWog6lI6TaGfqcRHvJo6IayaenD2SbsEgvHBvCAv24d9P qd864S3yxebTNEbeVuv+qGH1JrJ4t2oOYGjMuTUalCxxWDGMGrnqB0QhswH/NiPZd9NT NvHefIn10YHOCEEQ9Mxd5MHGyO55LEr5GnW24msCpUSvTIQbW25wenq4XDisHyFVHJua btTRr7ptwigqL4H6OrLl/eLWot3vKBiA7XGmUrWlg74KkYUzgnR+Xdhf3CkatKlqs4sg U8Yg== 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=fU8x7bcNpA/CmWI7L8/sz2rkKCvNpkRbDJqpQ4XAolE=; b=H37f/PtGrKPv/0ltW9RSz3kQOoMzH/1VUa9gYHSiE+4yOr51cX8b06CUixK0IS2LIf NyfoMsqmdXa5V4++c1rW3b+8ID2fnk2ATQdVAEVL+oD0gdhPdyHhKp3ZAMn7CR9PUj61 A5buD7gvAbY9MSv95pcEyg0en8o8US9NYreElmuUP0k8cpd3vCvxKO++2NFa5TJ2DVp7 Q0QSqIsUu846G7qxkSA+23eptYQhTFaIebxe7pmKCy6tcbo94TUm4rFFYcbLLK8o6dru TEoFKmXGYjVn15DTtfArooCq6vZAoBMkJxDQyN/Tvjdh4PQhZgxyWPVuL3TuBAcmC5xM JgbQ== X-Gm-Message-State: AOAM531EnixC151ScMOMXXFm/0fRN0xD9fly+YRwPeHnWdd57sKZ7T4E Oqk2Vm+ReMNkwb3oYEq/f296CNax8My6NGPtOnpgybzH6lCvax66Axk9DvAT/WKJ2ec0iO4Xo6I nmdBOTmvvOVkzulDFVb/mETaBwX3HQPJ4jOIf1Cuh//PKK/JLQoAZUOVGRdQ9kWIpnNQq5sJulJ BoseEFzhPNjKfdB9zdlBYMVvHXTdWQWy1cEzGSQvnpBGRwGjDP17q0 X-Google-Smtp-Source: ABdhPJyABdQlVArifxZ2Egx3F5EWTBhlJ/qBlNK4kUJP1i/9uSzQZW3GQpNAF7NvnVURf5nnYhuugg== X-Received: by 2002:a05:600c:2249:b0:393:fac7:476b with SMTP id a9-20020a05600c224900b00393fac7476bmr12689502wmm.151.1652033471244; Sun, 08 May 2022 11:11: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 y11-20020a1c4b0b000000b003945781b725sm12869893wma.37.2022.05.08.11.11.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 08 May 2022 11:11:10 -0700 (PDT) Message-ID: Date: Sun, 8 May 2022 20:11: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: Amit Kapila , Alvaro Herrera Cc: Peter Eisentraut , Pg Hackers References: <202205021144.zkbvyekn52v7@alvherre.pgsql> 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 5/7/22 07:36, Amit Kapila wrote: > On Mon, May 2, 2022 at 6:11 PM Alvaro Herrera wrote: >> >> On 2022-May-02, Amit Kapila wrote: >> >> >>> I think it is possible to expose a list of publications for each >>> walsender as it is stored in each walsenders >>> LogicalDecodingContext->output_plugin_private. AFAIK, each walsender >>> can have one such LogicalDecodingContext and we can probably share it >>> via shared memory? >> >> I guess we need to create a DSM each time a walsender opens a >> connection, at START_REPLICATION time. Then ALTER PUBLICATION needs to >> connect to all DSMs of all running walsenders and see if they are >> reading from it. Is that what you have in mind? Alternatively, we >> could have one DSM per publication with a PID array of all walsenders >> that are sending it (each walsender needs to add its PID as it starts). >> The latter might be better. >> > > While thinking about using DSM here, I came across one of your commits > f2f9fcb303 which seems to indicate that it is not a good idea to rely > on it but I think you have changed dynamic shared memory to fixed > shared memory usage because that was more suitable rather than DSM is > not portable. Because I see a commit bcbd940806 where we have removed > the 'none' option of dynamic_shared_memory_type. So, I think it should > be okay to use DSM in this context. What do you think? > Why would any of this be needed? ALTER PUBLICATION will invalidate the RelationSyncEntry entries in all walsenders, no? So AFAICS it should be enough to enforce the limitations in get_rel_sync_entry, which is necessary anyway because the subscriber may not be connected when ALTER PUBLICATION gets executed. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company