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 1pqq24-0002zV-Va for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Apr 2023 06:50:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pqq23-0003cW-J2 for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Apr 2023 06:50:39 +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 1pqq23-0003aB-8f for pgsql-hackers@lists.postgresql.org; Mon, 24 Apr 2023 06:50:39 +0000 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1pqq21-004kh4-MS for pgsql-hackers@lists.postgresql.org; Mon, 24 Apr 2023 06:50:38 +0000 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-63b5c4c769aso5612317b3a.3 for ; Sun, 23 Apr 2023 23:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682319035; x=1684911035; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Ab1/znhgmMjwtdzwSUrrSZTp4uOpo4BZNAn8zKAMtWo=; b=f9G8rV7bEbthkDXMrlK6n1PpiSQJJTQ1dXNppy6g7Rf7Gp1eC4s8p79Wd8hgWYkuVc qmB5TBBEmSsIwxn/wBUYTps55m6yDAKVYiyTERQ24N1v/BuOwnHjSy1RrhzNXLz/imeS ILzd/6DKFgIqEotdW5+qTYXcu9ZyXjID/nEWsfIofc1ANIdmxRmKgDi2vfV+DCDvnLvR 9hQaGEpUeWe9pPiRFgnJBfIZoYFxKIJBFuMoYytD3jgzk1VebzgLguxZH8lJpXzpOURb PeRkKoTe+/ASc7YEKoqWrBXv+vxfMVZxbVnWbYXbc9I8GplnJnIt+CXiu8rexs17etpL yXjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682319035; x=1684911035; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Ab1/znhgmMjwtdzwSUrrSZTp4uOpo4BZNAn8zKAMtWo=; b=WNOhsVKWKWajj8th8eZQT3dpmEGs7+wZjeiP07e3NuZHJTBohTiJUzUMLdZvdE9Do9 Xn46joOPtoBVkOyvnuzdYf9a2C8LFIxsAe0lX4dLpAn5S7cDsWvfi7ZiKstKhIFXcMHd IN4ptT+8QADvDq3NDcwu7zMT/uuiLP995ynMWd/KkNyJLu6obqTlHZRdTmdauKg8Dgt8 Z11upMq7/dWe1WErfenaFH05RC/OEG35ICjOTjVb23LMzAx6gSUalNU1oII+V+LD/rHe CnYQdteXtmxtS/GGGwZeVgK6Z8lZ9Ew3ZFO1BmFdnoiiQDnSw9HyhoJigkfLqdgnqvr0 XQqg== X-Gm-Message-State: AAQBX9ditE7snd2V1L4VY0wZRrM7K+zJ3Ydcg9IAfrJFdg0pm+hprL4I rdnDjrda4j0hxm1wkgg4VTE= X-Google-Smtp-Source: AKy350YNGQMx+q/fEW1VtSjJJ37TNbogIXgl3qOJljUjYbnkKbTozuWD2UPRmCTlbsLuz6LA2zggVg== X-Received: by 2002:a05:6a21:6d9b:b0:f3:5cf7:581b with SMTP id wl27-20020a056a216d9b00b000f35cf7581bmr5979918pzb.28.1682319035383; Sun, 23 Apr 2023 23:50:35 -0700 (PDT) Received: from jrouhaud (2001-b011-1005-b574-0599-bb02-1709-d376.dynamic-ip6.hinet.net. [2001:b011:1005:b574:599:bb02:1709:d376]) by smtp.gmail.com with ESMTPSA id j12-20020a056a00174c00b00634b91326a9sm6894396pfc.143.2023.04.23.23.50.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Apr 2023 23:50:34 -0700 (PDT) Date: Mon, 24 Apr 2023 14:50:32 +0800 From: Julien Rouhaud To: "Hayato Kuroda (Fujitsu)" Cc: PostgreSQL Hackers , Amit Kapila Subject: Re: pg_upgrade and logical replication Message-ID: <20230424065032.4w7vm33qmaput3al@jrouhaud> References: <20230309083456.xpjcsuycyn7d2yvr@jrouhaud> <20230327084955.m624nwfaf7mbzo6j@jrouhaud> <20230407022802.jqmdhgjhrnj5lpcl@jrouhaud> <20230413025110.gt6nahvrerngoz2m@jrouhaud> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Fri, Apr 14, 2023 at 04:19:35AM +0000, Hayato Kuroda (Fujitsu) wrote: > > I have tested, but srsublsn became NULL if copy_data was specified as off. > This is because when copy_data is false, all tuples in pg_subscription_rels are filled > as state = 'r' and srsublsn = NULL, and tablesync workers will never boot. > See CreateSubscription(). > Doesn't it mean that there is a possibility that LSN option is not specified while > ALTER SUBSCRIPTION ADD TABLE? It shouldn't be the case for now, as pg_upgrade will check first if there's a invalid remote_lsn and refuse to proceed if that's the case. Also, the remote_lsn should be set as soon as some data is replicated, so unless you add a table that's never modified to a publication you should be able to run pg_upgrade at some point, once there's replicated DML on such a table. I'm personally fine with the current restrictions, but I don't really use logical replication in any project so maybe I'm not objective enough. For now I'd rather keep things as-is, and later improve on it if some people want to lift such restrictions (and such restrictions can actually be lifted).