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 1rwdGE-0035b9-5r for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Apr 2024 07:29:46 +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 1rwdGB-001lTo-4S for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Apr 2024 07:29:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rwdGA-001lTe-Op for pgsql-hackers@lists.postgresql.org; Tue, 16 Apr 2024 07:29:42 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rwdG4-0036Ay-61 for pgsql-hackers@postgresql.org; Tue, 16 Apr 2024 07:29:41 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-41884f8f35bso5941385e9.0 for ; Tue, 16 Apr 2024 00:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713252574; x=1713857374; darn=postgresql.org; 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=38F6zAW6+VEdMyS8YkRUSv8j1AqaLF7hFTyMokUu8Y8=; b=Q/TxE4y71rs4teqYC/5X+44iLYBZbMigAUmInNrMH3DBty11J5UQcO+4W4gqQXefXQ TEgnO8E8/2k8a/keLC2K9TKet0jpu01Lgky7lmOih9bBL+JG+CtN43sBh+5kKAlmw/oS jAsuvlEaqMN1wsr1Jbi7PgLE/vlmP0IpkJuTg+FLpf2aZO1Xsgi5PTf0RCbPC6yCPbgk nWGj+sEuljL8wVcfkXoOr7tqW06rs+7QQ9Poj0gRccIUzt6Btbx8GJKFqcdBeHNr6fDg SR7uleBF0SDHjXv0nEWM30i+n0oWZDn6IRSxePKBvJttVZckuhR4mHX7A6RMVG1VO6VF VQNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713252574; x=1713857374; 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=38F6zAW6+VEdMyS8YkRUSv8j1AqaLF7hFTyMokUu8Y8=; b=jeCyL9whBHfuJ1G9qhRgYDL19Oc4bbeBqPYNUYXfO+DCPv6rus/bYDqgJf4C7TEv7/ LvhPZNZ7um07n0Rgi+W/AuH65FaZAn+QkdITSkyGLYsaTLNM3+amjTks/LnXK1MG3PiA 62zm8D/RR3mymWHd+CEiyr6dKL+U/cS7w71WiQNOXosDdHTP7IhbXMrFAuBJzR+RClw4 SZb0kbDxxcd0AQzfKujUiz8aQAoXTr/XO037VGQFfsW9yHmIK4V7yNSJLsXCWEfohK39 sZ0rSXpqZwqVWf3P7gY+w6RjdN4sUaDqhru5PmPep5AD+gnx12tfIq5jspfGMyJKBCli rpaw== X-Gm-Message-State: AOJu0YxXQFFnoZicpuDnt0grJ3XscdUxjYNgCfC6QBF8g9UU4+3x0sio 2ei88nMPiIsqnold/I6tdboBOKuV0gPJyjj8eHjPZN8o/89LGnL5 X-Google-Smtp-Source: AGHT+IGawkDm5pcveCL7TZOGZHtSd4QtXfu65uDXQVPZJ/45CoiK7svmHx0+Gp8mbsHup3p67fishg== X-Received: by 2002:a05:600c:354f:b0:418:2ab6:712c with SMTP id i15-20020a05600c354f00b004182ab6712cmr6815597wmq.7.1713252574395; Tue, 16 Apr 2024 00:29:34 -0700 (PDT) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-236-134-5.eu-west-3.compute.amazonaws.com. [15.236.134.5]) by smtp.gmail.com with ESMTPSA id s12-20020a05600c45cc00b00417e8be070csm17271321wmo.9.2024.04.16.00.29.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 00:29:34 -0700 (PDT) Date: Tue, 16 Apr 2024 07:29:32 +0000 From: Bertrand Drouvot To: "Zhijie Hou (Fujitsu)" Cc: pgsql-hackers , "Hayato Kuroda (Fujitsu)" , Amit Kapila Subject: Re: Disallow changing slot's failover option in transaction block Message-ID: References: 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 Tue, Apr 16, 2024 at 06:32:11AM +0000, Zhijie Hou (Fujitsu) wrote: > Hi, > > Kuroda-San reported an issue off-list that: > > If user execute ALTER SUBSCRIPTION SET (failover) command inside a txn block > and rollback, only the subscription option change can be rolled back, while the > replication slot's failover change is preserved. Nice catch, thanks! > To fix it, I think we can prevent user from executing ALTER SUBSCRIPTION set > (failover) inside a txn block, which is also consistent to the ALTER > SUBSCRIPTION REFRESH/DROP SUBSCRIPTION command. Attach a small > patch to address this. Agree. The patch looks pretty straightforward to me. Worth to add this case in the doc? (where we already mention that "Commands ALTER SUBSCRIPTION ... REFRESH PUBLICATION and ALTER SUBSCRIPTION ... {SET|ADD|DROP} PUBLICATION ... with refresh option as true cannot be executed inside a transaction block" Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com