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 1rUhBi-00CVcH-1v for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Jan 2024 06:01:38 +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 1rUhBg-002guL-Gz for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Jan 2024 06:01:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rUhBg-002guC-79 for pgsql-hackers@lists.postgresql.org; Tue, 30 Jan 2024 06:01:36 +0000 Received: from mail-oa1-x31.google.com ([2001:4860:4864:20::31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rUhBd-004T0N-AR for pgsql-hackers@postgresql.org; Tue, 30 Jan 2024 06:01:35 +0000 Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-214def5da12so1762011fac.2 for ; Mon, 29 Jan 2024 22:01:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706594491; x=1707199291; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=A/dP+pCweO6qdWMuG0BJdST2tsNUmOBDWA2eStlewwg=; b=GhzWS/BmTq4xMZso9mgwixrlN5R5mIdc0UJnVgAsN5iL6CeyuNqgzyIa8Sdp9P2jqc 2wFTsKqvJQPwi6/khmqxRUTzemiFA4pdly6+ozz0tNjFArskITYxWennUDfL/C1HetsW nZX3r71IeslLekXEBP4AGfFOG0kFLEzhL7QwjvGBB8RJa9mjT8OqBGO5mWnBIDkgNR// FCK9awxbiziFGNNT3AyRRvOuXbFMHgH0a0OC63VaFYpgGWpyfYOWBgW3ZW4/DiHxpJRq eAlifzrjLqGQWJr+zqNfvrQa54Zzm/mckEMxWhK7ZVrUzKRJjzERck7Wn6CEZ281s8LO 2SgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706594491; x=1707199291; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A/dP+pCweO6qdWMuG0BJdST2tsNUmOBDWA2eStlewwg=; b=WEEdEQN8WwVXw3mC0TQC06sZGixoq1vd5uv3Vo9d0FxwJ4iAm4TC24Q6GLEppyNVxd 2ksXVjjdXqFq2Wajy0XpgDLqqblz/mVnczSQyS9pvALqYjnU6+O7NWZvMKGfdzEGDBiB 4VvZukNmG7yuGtj/9His5JB75ieK90aEYEqTNW3fjKNZgsLTZPLx8daNqiE4NAi7zHnH hdq5PJxEdx7dmMngD0T3jtvAegujyC3ztYzEuoTMmKkHkgk0ncFqPLS0Gyjwunz8sjiI 2C4cKyv8tlXCBPLLyYwECWkL/Vj6RH9oD9z9t9AcoJKDoD4451bB4cne5e6Edv7r4QkF lX4g== X-Gm-Message-State: AOJu0YxOFDFwjc2jMaSmvx7kSGH7gyyRhFeFZZfF9dt8U1vRR0hY4ghR Zol5VJkYYOBrnD0hbbWLxhso14UZLFw+lIMkzvKUo4CEnPpJGJMkcy+hACmGUA3kInC+RgGpn4k g2/D5rv4/FrA0DUpGtn7sOCB2TrM= X-Google-Smtp-Source: AGHT+IH0qyncmze0OQMCd1IOgxLG35XHiDVWE7By0euw+MQun/eyVvSYoDIcz0mXgJneVIg25fP/8FEc9kmULkm6B/Y= X-Received: by 2002:a05:6870:9385:b0:218:a29f:1f5a with SMTP id b5-20020a056870938500b00218a29f1f5amr1834086oal.22.1706594491010; Mon, 29 Jan 2024 22:01:31 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Tue, 30 Jan 2024 11:31:18 +0530 Message-ID: Subject: Re: Synchronizing slots from primary to standby To: "Zhijie Hou (Fujitsu)" Cc: shveta malik , Peter Smith , Bertrand Drouvot , Ajin Cherian , Masahiko Sawada , Dilip Kumar , Nisha Moond , "Hayato Kuroda (Fujitsu)" , Bharath Rupireddy , Peter Eisentraut , Bruce Momjian , Ashutosh Sharma , Andres Freund , pgsql-hackers , Alvaro Herrera Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jan 29, 2024 at 6:47=E2=80=AFPM Zhijie Hou (Fujitsu) wrote: > > On Monday, January 29, 2024 7:30 PM Amit Kapila = wrote: > > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > 1. > > parse_subscription_options() > > { > > ... > > /* > > * We've been explicitly asked to not connect, that requires some > > * additional processing. > > */ > > if (!opts->connect && IsSet(supported_opts, SUBOPT_CONNECT)) { > > > > Here, along with other options, we need an explicit check for failover,= so that if > > connect=3Dfalse and failover=3Dtrue, the statement should give error. I= was > > expecting the below statement to fail but it passed with WARNING. > > postgres=3D# create subscription sub2 connection 'dbname=3Dpostgres' > > publication pub2 with(connect=3Dfalse, failover=3Dtrue); > > WARNING: subscription was created, but is not connected > > HINT: To initiate replication, you must manually create the replicatio= n slot, > > enable the subscription, and refresh the subscription. > > CREATE SUBSCRIPTION > > Added. > In this regard, I feel we don't need to dump/restore the 'FAILOVER' option non-binary upgrade paths similar to the 'ENABLE' option. For binary upgrade, if the failover option is enabled, then we can enable it using Alter Subscription SET (failover=3Dtrue). Let's add one test corresponding to this behavior in postgresql\src\bin\pg_upgrade\t\004_subscription. Additionally, we need to update the pg_dump docs for the 'failover' option. See "When dumping logical replication subscriptions, .." [1]. I think we also need to update the connect option docs in CREATE SUBSCRIPTION [2]. [1] - https://www.postgresql.org/docs/devel/app-pgdump.html [2] - https://www.postgresql.org/docs/devel/sql-createsubscription.html --=20 With Regards, Amit Kapila.