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 1sTK3E-00F3uB-9L for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Jul 2024 11:39:28 +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 1sTK3C-009qHB-Tq for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Jul 2024 11:39:26 +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 1sTK3C-009qH3-KK for pgsql-hackers@lists.postgresql.org; Mon, 15 Jul 2024 11:39:26 +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 1sTK3A-002EBL-BF for pgsql-hackers@lists.postgresql.org; Mon, 15 Jul 2024 11:39:25 +0000 Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-25e3d388580so2050250fac.0 for ; Mon, 15 Jul 2024 04:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721043562; x=1721648362; darn=lists.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=i2IYlPye78tB6M2By1++Wt5x7XlvYsKpTX6s0v8j2Jk=; b=mI2J6pQCm+5cs46leXbuGTBNzZzWCgkIp9fGpxfKdsPkxu2uheq8OxvQoaTWwDg9Ol wuND5zVc0pBe4r41856RLnIclxOXAZXSgLfPu3GKb0E5OWKRHRWesGexg3WfRimHvL3Z mxHoBUArdtZZ0siPM3jyxZUJOdlRhceXULgzz8+TccYfJPRNE62AvASP2R3xXnFSHYNe SFVHjj4z3inrGZq/GJ+LdshoWaaYI+UUYvmjJS4G2WC8PQBBSjFIEHti4Hu0uip9lu95 8ddhJ3aFvmGSgn4tHE5q7+XkKzYkvMCecmhLB2ERJrQaP7Yu5aq3OsoJBfAkS1YuLa0J tUdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721043562; x=1721648362; 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=i2IYlPye78tB6M2By1++Wt5x7XlvYsKpTX6s0v8j2Jk=; b=UClRQZ3BcNZ2aSbYNZxK+XTH+E+8vs8E5sjhrHgWDpFIAG2luzoIS2qxOyePFYP4Lz KTnaTOHhKXFg6JJVKLASGkwmcm2FMwX4CE5crEEBODgzyJ8SO92MviPKV92I2d9OHeFt KF3Dyn12LWNBE+M3070WDNXEpUyfyO/KDgbdOFFokM/LzlLMR8iRPkf81R9/k0VdEQXM TRgdcHxBtPCfr7RWNHxom9hpBIxx3PvIxtF525s2Zb7FIzZVMPr5phrxnhZcgi/QZTXU wcRB7nhPQsc89ccm1mlCSunaPiT4+FXNFrvA7boz5ShrkZX2qUmtN5p+JCyDy6Ikt6TK L0bA== X-Gm-Message-State: AOJu0Yx10GarNt2Su2exyLeKa+iMSyq/GFgLGU4IN7iQqcUMaINboOg+ KbIuCxlCWbuUwDxW7+UzHVNwxntH9kL21wJzHGaQzrYUiQSFQ/MB3PNOY0O+9pW53R3yhPjtqIW rgCSnqLbcEKvV5k4So+fWRr7kH1s= X-Google-Smtp-Source: AGHT+IHmtbcJ6cZwJa6fVnSSX/ITKCTFs2cHgeTfdKwtneL4qq0SvV+FiYNhlQcIUD6gy0A7AbA2BwMpIEU2GJWAk6Q= X-Received: by 2002:a05:6871:88d:b0:25e:bdf7:7e08 with SMTP id 586e51a60fabf-25ebdf84150mr15107461fac.0.1721043562251; Mon, 15 Jul 2024 04:39:22 -0700 (PDT) MIME-Version: 1.0 References: <8fab8-65d74c80-1-2f28e880@39088166> <99df2-65d8d200-1-63c26880@172687752> In-Reply-To: From: Amit Kapila Date: Mon, 15 Jul 2024 17:09:10 +0530 Message-ID: Subject: Re: Slow catchup of 2PC (twophase) transactions on replica in LR To: "Hayato Kuroda (Fujitsu)" Cc: "pgsql-hackers@lists.postgresql.org" , Vitaly Davydov , Ajin Cherian 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 Tue, Jul 9, 2024 at 6:23=E2=80=AFPM Hayato Kuroda (Fujitsu) wrote: > > Previous patch set could not be accepted due to the initialization miss. > PSA new version. > Few minor comments: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 0001-patch 1. .git/rebase-apply/patch:253: space before tab in indent. errmsg("slot_name and two_phase cannot be altered at the same time"))); warning: 1 line adds whitespace errors. White space issue as shown by git am command. 2. +/* + * Common checks for altering failover and two_phase option + */ +static void +CommonChecksForFailoverAndTwophase(Subscription *sub, const char *option, + bool isTopLevel) The function name looks odd to me. How about something along the lines of CheckAlterSubOption()? 3. + ereport(ERROR, + (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("cannot disable two_phase when uncommitted prepared transactions present"), We can slightly change the above error message to: "cannot disable two_phase when prepared transactions are present". 0003-patch Alter the altering from + true to false, the publisher w= ill + replicate transactions again when they are committed. The beginning of the sentence sounds awkward. --=20 With Regards, Amit Kapila.