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 1nKY9E-00025e-70 for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Feb 2022 04:12:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nKY8h-0003Gb-Lo for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Feb 2022 04:11:31 +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 1nKY8h-0003GS-1i for pgsql-hackers@lists.postgresql.org; Thu, 17 Feb 2022 04:11:31 +0000 Received: from esa7.fujitsucc.c3s2.iphmx.com ([68.232.159.87]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nKY8Z-0005ix-GO for pgsql-hackers@lists.postgresql.org; Thu, 17 Feb 2022 04:11:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fujitsu.com; i=@fujitsu.com; q=dns/txt; s=fj1; t=1645071083; x=1676607083; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Plu0PVDXJLYK+gWPZKuY+40RjFA73TY8w0oiqmqJwuw=; b=xAI6o30UdtjXNfRHxi7VrYNBrHCJdpiARoHZptMmK+ayarZ9geRSw8eA 6qoGC6suuY8/BlwhcsnA1CbeGEc1FDsuIbEBdZe6KvYQEKHmD9cH4JG/8 3096bhZFPXpz+xJ+e1ZWaezKpKVio4CE+HSGWejINjb/2WcJv2Q/EDkvy YewfI8Db3kGw/lIiIUqNSEhYlb+Lrap2OODi8GoTyrykKDPz+uwnjodFn gxXYJwR+BB4T4GI3gbeWVejYJ1RmsV4iSTGnP9AKLpJ7eNd0W33FPLSco tFxl/pv9mb14lgzNLZnZomOvC5kn/LMUvpPO0G/7qYKB6h8rgyWwQe5PJ g==; X-IronPort-AV: E=McAfee;i="6200,9189,10260"; a="49916377" X-IronPort-AV: E=Sophos;i="5.88,374,1635174000"; d="scan'208";a="49916377" Received: from mail-os0jpn01lp2111.outbound.protection.outlook.com (HELO JPN01-OS0-obe.outbound.protection.outlook.com) ([104.47.23.111]) by ob1.fujitsucc.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 13:11:12 +0900 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BYuwtBcE21iUvCsrOyMEy8LLzv3JvErLv6g8Ebe9qGsuo2xp29n69vxQv9MzYo0zXY7jVyUvsYLXmqLllSTy48Ott47Z+kcyi2hlqgTUQFxNzNzxvLMZuiJKGWwG0gGBnVIP0vMkK3fqtahEHQiBo8dwSw4bsDwNTqWuzeb/ii0nVQ0AfBiCji4ZlFAYECVtLZUBnBFY/LXsZpDEH5EZmepZEe8RGCaZgbgHfver4kkoltmfxzCIk99torX0RC/vfl/T3ozG+wvze+0AjWJunV5v1eNdCUW278dfv5bSBz0kVyqNeF+cu0S0BBO1VMN5K+3mv+i85OPVeDrKI+VDww== 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=wzwiPFt+mSG6kCENSiPXQsivV7HDeqyv/cN3FgHwKkQ=; b=Cvp3qYB8lP2q1zhklpsXp4Rigcs58jAETBz23NkrUeDTmLgzzjvyCLQGjDNe1AUFT4/JjuylwNfFH++dKkJvLUXCv/nPZRvcHaQ5WUDNfZ+2HT7znNMuz0vUy8ZDZ8cUMPdJDaArJC5TIQbbFdbkDeSV1KsOXgUuDD/L//Vo200vyBecZo39xZefhIU/yRUVGSU1HbpvFthTzl3jP7jsjpaSYxUhbNh7R6f3xkF3cb9AdeUxrpEhKhCWwgXcUCeF+4b+G6ieG60sMLdf9b4VE6M/AIW/mjrRvu2Ld4I8PHUYBmn8/cOzahp8/uyoFibRT25Wyeb2a1um+QgjNIKi2Q== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fujitsu.onmicrosoft.com; s=selector2-fujitsu-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wzwiPFt+mSG6kCENSiPXQsivV7HDeqyv/cN3FgHwKkQ=; b=oKtsHx3o0oqPZoSEWqHEhXaxCT/isYzEKKN7UlfQfI0zeWGTEmqupjAGxGrGoD5NxcaNAt/7Vm8DTgHcWLY+XInb5GMSDrU/gwCgA89wst+RmDjJPiQueznP9u7gGaxM/uQLuF/8F3efrYtvvmP6CDO19sgLXz7B8+8ZcNnkgcQ= Received: from TYAPR01MB5866.jpnprd01.prod.outlook.com (2603:1096:404:8056::13) by OS3PR01MB5591.jpnprd01.prod.outlook.com (2603:1096:604:b5::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.16; Thu, 17 Feb 2022 04:11:09 +0000 Received: from TYAPR01MB5866.jpnprd01.prod.outlook.com ([fe80::4c8d:d829:e2ac:10fe]) by TYAPR01MB5866.jpnprd01.prod.outlook.com ([fe80::4c8d:d829:e2ac:10fe%4]) with mapi id 15.20.4975.017; Thu, 17 Feb 2022 04:11:09 +0000 From: "kuroda.hayato@fujitsu.com" To: 'Kyotaro Horiguchi' CC: "pgsql-hackers@lists.postgresql.org" , "Shinya11.Kato@oss.nttdata.com" , "zyu@yugabyte.com" , "masao.fujii@oss.nttdata.com" Subject: RE: [Proposal] Add foreign-server health checks infrastructure Thread-Topic: [Proposal] Add foreign-server health checks infrastructure Thread-Index: AdfNNjec7xk22WznTt+52qg+YpAmvANdE8aAAG+tXeAALaEGgADyvFSgAOXdLoAAHbFoIAAJMQQAAVzrX4ABVSpkgAcm+qGAAFKrs2AALpHaMABlDPQAAZXPwNAAQjmEAALZMWcAADGlIkA= Date: Thu, 17 Feb 2022 04:11:09 +0000 Message-ID: References: <0e9ea094-67df-487c-96f5-f9eabb5357c7@oss.nttdata.com> <20220216.115058.1615761004338301624.horikyota.ntt@gmail.com> In-Reply-To: <20220216.115058.1615761004338301624.horikyota.ntt@gmail.com> 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=2022-02-17T02:33:07Z; 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=95b0c8aa-0156-4220-bc05-d0bb355804ce; 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-office365-filtering-correlation-id: 36f89089-52d7-4638-2023-08d9f1cb86e2 x-ms-traffictypediagnostic: OS3PR01MB5591:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: BXiq4UK9zu/upm5TzL6oiJGp96rUwRnpzK+eZXsWpg6BiVzh+Zqpp7uvo3Kc2YRl/dNdrH2lfBJM+M6ZDF0NVBzQHtly9Lj8peYF3hCQTh5aZfXlsH3MCcawOI6AAIPzMTwOkMBXDAoV2wprOETsQXosUPqqyHtuqN33+sSVhsN4nv2DUuuA84wrErZ0mZDjbBWFkJyjiX1oWHFTEkVCuTbiN9VFeDAuWeE2K6wgwHfNE4G+imGcKnkL5OCt4oEf1KeMst7zQ7+hLOjDvXnKE6G6CarzE7v/8CdIK8zlQkMNixrZR/N5gP4IyTDfo2cAliXtCbEjpnhWRcqI074iz/zJZWBDdnLNuwqI5282/UzPCnTbAbUi7o9PVqFdroRQapLBUMdwp4gcqjBbp5jgBhayVwu+7efNGdxqp1iNlNbN7Fq23w4RIgYn9POCRhaLodsN3kEJVIC/muvEsJcbH7KuYAA14yYBzM3ZVm8EbV8pkpBy2ENa1zkGCwwM16KipmnZl+jTHtRu6dYHcNiuWz8jJc5vdPQZ2WWlcQrZDDKGjtqSmA8pnHhZKlkExk+6oFk/4xCMdz3XZVlHzbP60k4HFQ7q2dNvPM5YrTqq1pMf5DMEWITVuPQfgl1bsw3x2oFc2/cC1IVcjO3RUy9cFweAyREtXNP29HnkS7Y00EbrY0gviN3PGlq/RqQ6KFnJa624cFfNb9musWYcOOYsKA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYAPR01MB5866.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(26005)(7696005)(9686003)(508600001)(186003)(6506007)(64756008)(2906002)(66556008)(66946007)(66476007)(122000001)(76116006)(66446008)(86362001)(8676002)(4326008)(85182001)(38100700002)(54906003)(316002)(6916009)(33656002)(82960400001)(8936002)(52536014)(5660300002)(83380400001)(71200400001)(38070700005)(55016003);DIR:OUT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zWXlOSXEzZmVyc0lRMlBZUDN3eWtWRVVKYVJLUVlHeEU3?= =?iso-2022-jp?B?WkFxdnRad2V5R2dCZEM4MHhXWXhqVXJEZHJ1d3FoQVpYNlM3ckR5c096?= =?iso-2022-jp?B?UFIzbGhWMVZjaTV4VXJkRzk1eEk1TU1GSitVMVF3WnZkVjFhK1VTdTBM?= =?iso-2022-jp?B?S1FhVmVmQTIyUGJWRk0zL2FnZ2VRU2pmSStpOHNtQ1pEWlRaUGlBK0V3?= =?iso-2022-jp?B?R3I2TjZ4bzZqOUpnQW4zcEtZdW1uOHJVYUsrVUp5WFplRFdEL0c0bEVt?= =?iso-2022-jp?B?VW1UQm9WUXVkQk5tM20yWWU1ZGlGRjBsZTQ3ZFVWT0tzUzlQdFNKYjFU?= =?iso-2022-jp?B?NkorMGMzQ2tzcFFXMG9UZ0NraWlvbWNTOXBUVW5rREdoQm51S1lGMnJG?= =?iso-2022-jp?B?RjBCWEJpZy9wZlVid2hRK1AvazRLSFk3cVdnQit2ZHU0MndrejdHSExj?= =?iso-2022-jp?B?TWxJTkhYU0djNzVzcWlUK0o0TSs3bEZqaVVkK2x3RHNDcEJLdVJ0VEww?= =?iso-2022-jp?B?cXpXczRDNjRGTE1ObmxmdVNpOERFNXluOGVGcTg1T0hrbEdjTlpTNHNs?= =?iso-2022-jp?B?MXlyUFN6THVRWk5NUnZCcGc0WHcrVkNWczNzTC9tcEtXNG9XSzFMMTY2?= =?iso-2022-jp?B?akZSbldGL3hIeFJRdGIrK0x0bHR2UitTZnJLOWUyeC9za1hMdTNKRFBV?= =?iso-2022-jp?B?cWpGOWx3PT0=?= Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: fujitsu.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYAPR01MB5866.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 36f89089-52d7-4638-2023-08d9f1cb86e2 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Feb 2022 04:11:09.2319 (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: cO5OCjUQUx62GIoypLPsViZQ1JvUx24UAFFl569pr1HGlcnJYfh7514nvs1l6noRRjAT6G9IfHrNObm7UfpVRm1w44mCXOXroNXjdq1EQ2c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB5591 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dear Horiguchi-san, Thank you for giving your suggestions. I want to confirm your saying. > FWIW, I'm not sure this feature necessarily requires core support > dedicated to FDWs. The core have USER_TIMEOUT feature already and > FDWs are not necessarily connection based. It seems better if FDWs > can implement health check feature without core support and it seems > possible. Or at least the core feature should be more generic and > simpler. Why don't we just expose InTransactionHealthCheckCallbacks or > something and operating functions on it? I understood that core is too complicated and FDW side is too stupid, right= ? > Mmm. AFAICS the running command will stop with "canceling statement > due to user request", which is a hoax. We need a more decent message > there. +1 about better messages. > I understand that the motive of this patch is "to avoid wasted long > local work when fdw-connection dies". Yeah your understanding is right. > In regard to the workload in > your first mail, it is easily avoided by ending the transaction as soon > as remote access ends. This feature doesn't work for the case "begin; > ; ". But the same measure also works in > that case. So the only case where this feature is useful is "begin; > ; ; ; end;". But in the first > place how frequently do you expecting remote-connection close happens? > If that happens so frequently, you might need to recheck the system > health before implementing this feature. Since it is correctly > detected when something really went wrong, I feel that it is a bit too > complex for the usefulness especially for the core part. Thanks for analyzing motivation. Indeed, some cases may be resolved by separating tx and this event rarely h= appens. > In conclusion, as my humble opinion I would like to propose to reduce > this feature to: >=20 > - Just periodically check health (in any aspect) of all live > connections regardless of the session state. I understood here as removing following mechanism from core: * disable timeout at end of tx. * skip if held off or read commands > - If an existing connection is found to be dead, just try canceling > the query (or sending query cancel). > One issue with it is how to show the decent message for the query > cancel, but maybe we can have a global variable that suggests the > reason for the cancel. Currently I have no good idea for that but I'll try. Best Regards, Hayato Kuroda FUJITSU LIMITED