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 1pKKjx-00014B-Ai for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Jan 2023 14:57:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pKKjv-0008Pi-LU for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Jan 2023 14:57:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pKKjv-0008PZ-4a for pgsql-hackers@lists.postgresql.org; Tue, 24 Jan 2023 14:57:35 +0000 Received: from esa18.fujitsucc.c3s2.iphmx.com ([216.71.158.38]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pKKjr-00070F-J5 for pgsql-hackers@postgresql.org; Tue, 24 Jan 2023 14:57:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fujitsu.com; i=@fujitsu.com; q=dns/txt; s=fj1; t=1674572251; x=1706108251; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=og3H1xQ99b3koxXnOvyqzzHFUiM5dwddzCjDgN4bEWY=; b=FPYjjrT1vKxyK9/EamHEb9B27aBk8OLn4qvyRg3OLDVJ2dsAt3e6Je8V KUnnbBXyLmHTkA+ngGYQUrE6RqmoQHDA/eqL7k5Oeih/exmA4+GXXW9Qq WD0YbSpqZD4SFEFkVgTDIM5I3T+Bm3qufKpSzKCAkzgSRb2jcFvelc2pD avV6dC/c0CgMvQ4bIpyQYx0KdLyYfsGHHL/y4NTi4x9DOdddcTWhVELxj ucHtz9OERKllrVsO0HAXChzsbUeCbVHbH/0dw6HyVRAUVAYm4MPG3dN7j th0KKIo7JOML2wOFqliNSYSdd7Zf4gNOsbWfX4Vjnm9sADvug0QBiFisr g==; X-IronPort-AV: E=McAfee;i="6500,9779,10599"; a="77382201" X-IronPort-AV: E=Sophos;i="5.97,242,1669042800"; d="scan'208";a="77382201" Received: from mail-tycjpn01lp2176.outbound.protection.outlook.com (HELO JPN01-TYC-obe.outbound.protection.outlook.com) ([104.47.23.176]) by ob1.fujitsucc.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2023 23:57:25 +0900 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CR/vKtm7jxZz9++yLOLy6Jzz2D1gqpr4ga6/mtrp7fNqXO0A5yD4FRPndddsfhAa4XVFUFrzvv9Jsatovl75G9HccIcqqr1grJukrGI4JU+HanmL2CdLkrlY07+Tn9ejQ+rylQY+CG8Q0FLpJDMn2XCr6JYoBPcyup3GccqZBKQBjH/t3HljGPrGfG59JIi9Zbqc81Jdm8lJNr9FQ6ugrHW/4+a9rKKT8LttW3Pkv/8TqGXKwbhfb0zMnRq5PWOm5aBxNo5qNiNTlN8Q8h8phc/5RJi+TZkRIEOY1ED02ZXsmaTJ4ITyIsoNjbDbDWQ6EHQzc47Fi/WBPhnxsS7uxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=H0W4HvhYJzUYI4ApSM9ErvpMLn5Cr0L8kbC5qdnoVQQ=; b=DHV7qr5BnEfdRcEzX0R7rgGadVmBW44RCMfDUpuctOa41Mi/JhUGWwF0F1ltv85Cge3DdHKpFeJq/VfPdrJW6U3EVwpBbf9pLlUGKywRqxRgI6HGdLsVeAyJKondeiMIofQ9/UZGoJhA2VrKguLAveLkXRnsFaxswuL8GW/AXX36plvcDTUlCwlwXtMokNo7kTbPvQ0xVpbZeceWFomdC6dgYLmbIRneCo/j1J2+39abAZIEikQmdOf21zK7A36ioRtl6HfPrw3JfqoMfT5hjzUdEd+ItPNFGexTTP/yT2VYsHbR3t7qLoav5WbID5V4evulJ9yx+fZd9b2omYjiwA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=fujitsu.com; dmarc=pass action=none header.from=fujitsu.com; dkim=pass header.d=fujitsu.com; arc=none Received: from TYCPR01MB8373.jpnprd01.prod.outlook.com (2603:1096:400:15f::9) by OSYPR01MB5336.jpnprd01.prod.outlook.com (2603:1096:604:8b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.33; Tue, 24 Jan 2023 14:57:22 +0000 Received: from TYCPR01MB8373.jpnprd01.prod.outlook.com ([fe80::941f:893d:69b8:e21a]) by TYCPR01MB8373.jpnprd01.prod.outlook.com ([fe80::941f:893d:69b8:e21a%9]) with mapi id 15.20.6002.033; Tue, 24 Jan 2023 14:57:22 +0000 From: "Takamichi Osumi (Fujitsu)" To: 'Euler Taveira' , Peter Smith CC: vignesh C , Kyotaro Horiguchi , "Hayato Kuroda (Fujitsu)" , "shveta.malik@gmail.com" , Dilip Kumar , Amit Kapila , Melih Mutlu , Andres Freund , Marcos Pegoraro , pgsql-hackers Subject: RE: Time delayed LR (WAS Re: logical replication restrictions) Thread-Topic: Time delayed LR (WAS Re: logical replication restrictions) Thread-Index: AQHY9/SeVGNfJ+eMH0OkVO9Bch6SIa49/p8AgAAf6ACAABrAgIAALyYAgAEoiICAGrgLgIAGnftQgAEcg4CACAUGgIAAVUUAgADhA4CAAJ9SgIAA6ooAgACaBYCAAPtugIAAI30AgAsiVvCAAjbLEIAEQWWAgAGfSACACtcCAIALd3wAgAFMWoCAAC9FAIAA74IAgADRMqCAAoxsgIAFAcUwgAFSZoCAATnAAIAAT5jQgAGYWYCAAMMv4IACwUswgAJI7wCAAQECIA== Date: Tue, 24 Jan 2023 14:57:22 +0000 Message-ID: References: <20230112.120338.534662300633460797.horikyota.ntt@gmail.com> In-Reply-To: Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_a7295cc1-d279-42ac-ab4d-3b0f4fece050_Enabled=true; MSIP_Label_a7295cc1-d279-42ac-ab4d-3b0f4fece050_SetDate=2023-01-24T14:57:20Z; MSIP_Label_a7295cc1-d279-42ac-ab4d-3b0f4fece050_Method=Standard; MSIP_Label_a7295cc1-d279-42ac-ab4d-3b0f4fece050_Name=FUJITSU-RESTRICTED?; MSIP_Label_a7295cc1-d279-42ac-ab4d-3b0f4fece050_SiteId=a19f121d-81e1-4858-a9d8-736e267fd4c7; MSIP_Label_a7295cc1-d279-42ac-ab4d-3b0f4fece050_ActionId=eabcfe3a-e41b-4698-8b28-2fdb569c612a; MSIP_Label_a7295cc1-d279-42ac-ab4d-3b0f4fece050_ContentBits=0 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=fujitsu.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: TYCPR01MB8373:EE_|OSYPR01MB5336:EE_ x-ms-office365-filtering-correlation-id: 9c96567e-5c58-40ee-4fc3-08dafe1b4c44 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: FnZzGHudcAM0sVe2VAxfLXqbF+MUdzFf0ckhZnz0ee+Tr8sn0564nYc9uvwfEy6/IOvH8ddj+5BVhIHTFcl/XxvPmr/mcyUe2FIR57z2rJd7T9aYQgDOo4yRhPY9GnCM/F/gB7MrbJGzh3QW1qBmHk3SVjaq+cDoNYd/0TQETtP4QCLzlHVBFw6CVdneSRlrsw8GGsY5H36GPt4ajO/Nk1QEJBGaQ/3VcjnetWejTgyCuqIgCYumcS2S6paFZEdEURfxZkyi4epNmiPXJT1L9WZZLwtYzWiQinHsRHLWbTB1KdiZzgRd4wKVTsJSVm7J7uQaRYGeMBm+9Trd7dCloiT29OCjORQFzupUAnWA/DU/dz8gFCZsfZjvprccl4frFEoS4HBgsuYDtCBLXD/AmagraqS2pQTTgagknrWSONTihHR0dXC+SNKNb1/WmGhHuRF+19rUsZ1sPglBadpincJE0hJIbpgOpWEObzGnDxcB7H/0OWysYw9c86+2A6iShLvtPuwCWUa1/rNRyEEvlfbb8qG/CYh//QQSuIRmCK9DlZx7GfSMjPC0bLBiDIA66u2Ze9Th8CgTA7silaq8W1PXovzCBLrphcHKvgL+sVqVlnDs/loffx3iAUJe7TMnkBaz/Y/aqbuQ+AmIUlB0Y2UHRNly5pWuIE49iINAJ/u81+fXfQinhsNqC9ONz/9SK4Fn6REcmYlNdYcDewVUzTKV49ys9XFw3GNGZzzcGi4oY0k74dkXVTGyHH3J2JQ9Mmlh1Ud+J1TX+HRfil9evA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB8373.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(346002)(136003)(376002)(396003)(366004)(39860400002)(451199015)(1590799012)(85182001)(1580799009)(41300700001)(86362001)(82960400001)(7416002)(38070700005)(8936002)(5660300002)(4326008)(52536014)(2906002)(38100700002)(122000001)(83380400001)(33656002)(45080400002)(966005)(110136005)(478600001)(71200400001)(7696005)(66946007)(9686003)(53546011)(26005)(6506007)(186003)(8676002)(55016003)(316002)(76116006)(54906003)(66446008)(64756008)(66476007)(66556008);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?B?a1lIdVZqRTNUTGREMHBjQ3NJeXB1ZU15a2swUG1ZS0l4dEpuR1p0QzR2?= =?iso-2022-jp?B?Z09ueGZab21odlF2TExjY1ZZM1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ck9LTWJN?= =?iso-2022-jp?B?NTkxblRETjk2Snh3VTJDUFhsbGYydDQ3SVZvVlJXWDM2M2RHMVM1K1F2?= =?iso-2022-jp?B?QWljVGNSak43VnBFbDNmUUdaUzEwTHAwOXVpVkU2czlNeHBDNUJDcHNV?= =?iso-2022-jp?B?RXduV29XckZoM1drOTFKdXowMEVYMDM1NTd6bFJBMDhKTHQzU3kxeVN2?= =?iso-2022-jp?B?dm5ZQlVkRTdyVzUwQjRLcERNNGordDBCUVpmT2Y5RkVadkkrRkRpSnda?= =?iso-2022-jp?B?eHdHZ0laTDVBZWJwT0t3NWFndXkzR01Ma1lmNDB4RlJYekoydWM4bC9N?= =?iso-2022-jp?B?a21ySmZyamhOdXc1MERpWlRRWTdCOHo3dVNCMWZONTExeGg1K1RNa3dS?= =?iso-2022-jp?B?bmNyUHNxMmRhcWRxdDQ0OUdHY0ppTVlnV0g3M3A3YkdwaUhYNll6SGl3?= =?iso-2022-jp?B?RktWODNlOFh1ajVCVDVVWFl1MFlUcUttenc9PQ==?= Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: wd/LpZzqz2McLkxpwW6w5Y6TeYZjTF6jDiq7rTrjt6+zdZh/RWgon9ACgSVcKGkMsB7spL57BriBc2NNc4uZTmxD6TvtQB06Pna/IiYTwVJtEpQfQceNe3Bj3B1dWKAcVdGzjqqgbaqP005HJOKdLODYOIc46udLlMW3Gw6LNRPgRYizphcF02oTuiNMS9eK+x5wnMOgtblIXu2Hb6Q7pFhWPvMFZlyF7WdOifHiVIH34aMt+pojnTOC+o5KMF3cy2n4zkdsizP6Tm4Mo6lTyuoGOGrFZ5T3UP4P7wG14uiWoJKXDhP2BqIS78lc4a7w4FOmDgt9yCdfRRTWaan6MPZD5Y/1VO/l31Nl0f67HrurYmavP8mG73IZSYPHeE9IdECsfoNkf3N8lxHz+Xz1gk0/Q+YPdx9X+CZkTim2JP7NkOcvNq+ZhDbPTH1FJ72zLATbJsHklwtRV6rpF1qSi/a63Ef/tIEISeEYvHltLoMIih1STRHPiLQDLz9MS5kcdy+Ge31PfCSvwDES9UeQ8ClRWPhaYJbsLa8AclqNb1llqRTEKnUpohljDkIg3PQEnJ3BNlyB8syX2kfXG4ggNjTONR4KvosmCJRDb4EZTgGQfxHKgnngOe4pU0SOESaCYtrU3H8deZLIL0maQKtz8VvPgr3s3TNYBcRd1ySvcAWoGtKEc6tAe63XY4kzKW5h9l/we+nir0mfj0ROVsyCqJcNsW2dx0mvuzRchv4gSP+kyfnFWyO0EmIcfUh5NvJv84NQrvuQfljRY8u6acCeOC5xuiwosXtFHa3x8kQrrgsMijnaH6qjmVZKgCpEdB8IQhnvxq99eYFfvXjSEuiRT+wCR2B4AOd5Y5nqVYaWLgDis3HJ7ywWO7UzIG80SknQoMXPWU1DqBjnj4t6zNu82w== X-OriginatorOrg: fujitsu.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB8373.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c96567e-5c58-40ee-4fc3-08dafe1b4c44 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jan 2023 14:57:22.3308 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a19f121d-81e1-4858-a9d8-736e267fd4c7 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 8ukP0/yxdf0xTJvgVavYS2ZoCYCdmuCxPJQjE/lCD4bG881FLt0EJJ5RL0NF6L9zgU+BXN8ELlj651npCcq6IbPyb+fBnNpfav0tYoVwfEE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSYPR01MB5336 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tuesday, January 24, 2023 8:32 AM Euler Taveira wrot= e: > Good to know that you keep improving this patch. I have a few suggestions= that > were easier to provide a patch on top of your latest patch than to provid= e an > inline suggestions. Thanks for your review ! We basically adopted your suggestions. > There are a few documentation polishing. Let me comment some of them abov= e. >=20 > - The length of time (ms) to delay the application of changes. > + Total time spent delaying the application of changes, in millisec= onds >=20 > I don't remember if I suggested this description for catalog but IMO the > suggestion reads better for me. Adopted the above change. > - For time-delayed logical replication (i.e. when the subscription = is > - created with parameter min_apply_delay > 0), the apply worker sen= ds a > - Standby Status Update message to the publisher with a period of > - wal_receiver_status_interval. Make sure to set > - wal_receiver_status_interval less than the > - wal_sender_timeout on the publisher, otherwise= , the > - walsender will repeatedly terminate due to the timeout errors. If > - wal_receiver_status_interval is set to zero, t= he apply > - worker doesn't send any feedback messages during the subscriber's > - min_apply_delay period. See > - for details. > + For time-delayed logical replication, the apply worker sends a fe= edback > + message to the publisher every > + wal_receiver_status_interval milliseconds. Mak= e sure > + to set wal_receiver_status_interval less than = the > + wal_sender_timeout on the publisher, otherwise= , the > + walsender will repeatedly terminate due to tim= eout > + error. If wal_receiver_status_interval is set = to > + zero, the apply worker doesn't send any feedback messages during = the > + min_apply_delay interval. >=20 > I removed the parenthesis explanation about time-delayed logical replicat= ion. > If you are reading the documentation and does not know what it means you = should > (a) read the logical replication chapter or (b) check the glossary (maybe= a new > entry should be added). I also removed the Standby status Update message = but it > is a low level detail; let's refer to it as feedback message as the other > sentences do. I changed "literal" to "varname" that's the correct tag for > parameters. I replace "period" with "interval" that was the previous > terminology. IMO we should be uniform, use one or the other. Adopted. Also, I added the glossary for time-delayed replication (one for applicable to both physical replication and logical replication). Plus, I united the term "interval" to period, because it would clarify the = type for this feature. I think this is better. > - The subscriber replication can be instructed to lag behind the publis= her > - side changes by specifying the min_apply_delay > - subscription parameter. See for > - details. > + A logical replication subscription can delay the application of chang= es by > + specifying the min_apply_delay subscription parame= ter. > + See for details. >=20 > This feature refers to a specific subscription, hence, "logical replicati= on > subscription" instead of "subscriber replication". Adopted. > + if (IsSet(opts->specified_opts, SUBOPT_MIN_APPLY_DELAY)) > + errorConflictingDefElem(defel, pstate); > + >=20 > Peter S referred to this missing piece of code too. Added. > -int > +static int > defGetMinApplyDelay(DefElem *def) > { >=20 > It seems you forgot static keyword. Fixed. > - elog(DEBUG2, "time-delayed replication for txid %u, min_apply_del= ay =3D %lld ms, Remaining wait time: %ld ms", > - xid, (long long) MySubscription->minapplydelay, diffms); > + elog(DEBUG2, "time-delayed replication for txid %u, min_apply_del= ay =3D " INT64_FORMAT " ms, remaining wait time: %ld ms", > + xid, MySubscription->minapplydelay, diffms); > int64 should use format modifier INT64_FORMAT. Fixed. > - (long) wal_receiver_status_interval * 1000, > + wal_receiver_status_interval * 1000L, >=20 > Cast is not required. I added a suffix to the constant. Fixed. > - elog(DEBUG2, "sending feedback (force %d) to recv %X/%X, write %X/%X,= flush %X/%X in-delayed: %d", > + elog(DEBUG2, "sending feedback (force %d) to recv %X/%X, write %X/%X,= flush %X/%X, apply delay: %s", > force, > LSN_FORMAT_ARGS(recvpos), > LSN_FORMAT_ARGS(writepos), > LSN_FORMAT_ARGS(flushpos), > - in_delayed_apply); > + in_delayed_apply? "yes" : "no"); >=20 > It is better to use a string to represent the yes/no option. Fixed. > - gettext_noop("Min apply delay (ms)")); > + gettext_noop("Min apply delay")); >=20 > I don't know if it was discussed but we don't add units to headers. When = I > think about this parameter representation (internal and external), I deci= ded to > use the previous code because it provides a unit for external representat= ion. I > understand that using the same representation as recovery_min_apply_delay= is > good but the current code does not handle the external representation > accordingly. (recovery_min_apply_delay uses the GUC machinery to adds the= unit > but for min_apply_delay, it doesn't). Adopted. > # Setup for streaming case > -$node_publisher->append_conf('postgres.conf', > +$node_publisher->append_conf('postgresql.conf', > 'logical_decoding_mode =3D immediate'); > $node_publisher->reload; >=20 > Fix configuration file name. Fixed. > Maybe tests should do a better job. I think check_apply_delay_time is fra= gile > because it does not guarantee that time is not shifted. Time-delayed > replication is a subscriber feature and to check its correctness it shoul= d > check the logs. >=20 > # Note that we cannot call check_apply_delay_log() here because there is = a > # possibility that the delay is skipped. The event happens when the WAL > # replication between publisher and subscriber is delayed due to a mechan= ical > # problem. The log output will be checked later - substantial delay-time = case. >=20 > If you might not use the logs for it, it should adjust the min_apply_dela= y, no? Yes. Adjusted. > It does not exercise the min_apply_delay vs parallel streaming mode. >=20 > + /* > + * The combination of parallel streaming mode and > + * min_apply_delay is not allowed. > + */ > + if (opts.streaming =3D=3D LOGICALREP_STREAM_PARALLEL) > + if ((IsSet(opts.specified_opts, SUBOPT_MIN_APPLY_= DELAY) && opts.min_apply_delay > 0) || > + (!IsSet(opts.specified_opts, SUBOPT_MIN_APPLY= _DELAY) && sub->minapplydelay > 0)) > + ereport(ERROR, > + errcode(ERRCODE_OBJECT_NOT_IN_PREREQU= ISITE_STATE), > + errmsg("cannot enable %s mode for sub= scription with %s", > + "streaming =3D parallel", "min= _apply_delay")); > + >=20 > Is this code correct? I also didn't like this message. "cannot enable str= eaming > =3D parallel mode for subscription with min_apply_delay" is far from a go= od error > message. How about refer parallelism to "parallel streaming mode". Yes. opts is the input for alter command and sub object is the existing def= inition. We need to check those combinations like when streaming is set to parallel and min_apply_delay also gets set, then, min_apply_delay should not be bigg= er than 0, for example. Besides, adopted your suggestion to improve the comments. Attach the patch in [1]. Kindly have a look at it. [1] - https://www.postgresql.org/message-id/TYCPR01MB8373DC1881F382B4703F26= E0EDC99%40TYCPR01MB8373.jpnprd01.prod.outlook.com Best Regards, Takamichi Osumi