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 1pHipL-0007In-4H for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Jan 2023 10:04:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pHipJ-000878-97 for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Jan 2023 10:04:21 +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 1pHipI-00085b-Sg for pgsql-hackers@lists.postgresql.org; Tue, 17 Jan 2023 10:04:20 +0000 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pHipC-0001bY-Ac for pgsql-hackers@lists.postgresql.org; Tue, 17 Jan 2023 10:04:19 +0000 Received: by mail-ot1-x330.google.com with SMTP id d6-20020a056830138600b0068585c52f86so2931363otq.4 for ; Tue, 17 Jan 2023 02:04:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=VRQ8UIKD8+Hjntw8bI/NirBkgx1C6WiHweXtJhQ8IXc=; b=B1QjzEAPxjUpPiI4cX9VRcFlsTyfIJbc1vDW26x+7OuDk/Oyrw+VV50+fSGA93qF99 +CpsjMU5rOFazhV620yoihGN4rr+OcPlWckPZFFAq1uV4vAtXqz5fsv/I4p3aTrcHBL1 65/Jtfds4aoRxtQoDnmDkB2OmrCRla/MwvUq+j9SRFfsulLAn3h3lOpA522W9eOeLJos seI1dsi3l/lvGQShJdAVpThsuQCGKVuber5QipANt3MxjDngyIG8iu5CC+e5L1+/ku4S 5v/Xuw1ciZ7/3wdt0jJLv7Asvk4/TnPZE4TpSlpdCM4JD3w9viboeuKMyht/1HHvwI30 ksrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=VRQ8UIKD8+Hjntw8bI/NirBkgx1C6WiHweXtJhQ8IXc=; b=QhtBqgWtiGeP1HWqGU3t95mAv1WNX3Dy+NVmzBcm3o1SJZUb75CNtaIlLp2LhAAk3u 26KJDxHXP9UOU+8SASVpKzuRTwi8GkO7gd6JOtfPl6kmIf+4Pjf17I0aVGk+E21Zwovu buesQu6exmJDBEHvhhcblPHaeVN+0UZwiEHSlc/wn900WCDsjNI4/oNLH5fTt1Z5bdRn OR7EE+wjFNOXoE9QD+zvYgApRGojYvAR7yhRYFEw6PmDL/qv5Sq/v94oJBmgeRdWS4jG eBgu06LtmBYOW/BBaSFpzI3ydVptaQE3TCIozJv/xDQZUd2pLb0ykLDTE5P6LmTPfNAb Zfhw== X-Gm-Message-State: AFqh2ko7tNydwHxsTh0gQ27JXdP9f79VHP12qhGPsxfLvew9eRoN7MB2 6McXUtvNazR54tAvDBtmjWbv7DkHh+VJtzGmEUc= X-Google-Smtp-Source: AMrXdXs9t2XgdWJuiofhbBzOHnqM5/Uz85fh+KECPMw+0ZeUOMBuNV6OYlNEswCpZ7Ke8c4muz+JCesqwv6jcTXf1Fs= X-Received: by 2002:a9d:19ab:0:b0:66c:4ed7:fea9 with SMTP id k40-20020a9d19ab000000b0066c4ed7fea9mr120893otk.57.1673949853566; Tue, 17 Jan 2023 02:04:13 -0800 (PST) MIME-Version: 1.0 References: <0271e197-2cfe-4627-9c11-47535cc7fdf3@www.fastmail.com> <8cc4f31f-240a-4590-94a8-a50bdf4f4d1c@www.fastmail.com> In-Reply-To: From: Amit Kapila Date: Tue, 17 Jan 2023 15:34:02 +0530 Message-ID: Subject: Re: Logical replication timeout problem To: Ashutosh Bapat Cc: "wangw.fnst@fujitsu.com" , Fabrice Chapuis , Euler Taveira , Masahiko Sawada , "Hayato Kuroda (Fujitsu)" , Peter Smith , Simon Riggs , Petr Jelinek , "tanghy.fnst@fujitsu.com" , PostgreSQL Hackers , Ajin Cherian Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jan 16, 2023 at 10:06 PM Ashutosh Bapat wrote: > > On Wed, Jan 11, 2023 at 4:11 PM wangw.fnst@fujitsu.com > wrote: > > > > On Mon, Jan 9, 2023 at 13:04 PM Amit Kapila wrote: > > > > > > > Thanks for your comments. > > > > > One more thing, I think it would be better to expose a new callback > > > API via reorder buffer as suggested previously [2] similar to other > > > reorder buffer APIs instead of directly using reorderbuffer API to > > > invoke plugin API. > > > > Yes, I agree. I think it would be better to add a new callback API on the HEAD. > > So, I improved the fix approach: > > Introduce a new optional callback to update the process. This callback function > > is invoked at the end inside the main loop of the function > > ReorderBufferProcessTXN() for each change. In this way, I think it seems that > > similar timeout problems could be avoided. > > I am a bit worried about the indirections that the wrappers and hooks > create. Output plugins call OutputPluginUpdateProgress() in callbacks > but I don't see why ReorderBufferProcessTXN() needs a callback to > call OutputPluginUpdateProgress. > Yeah, I think we can do it as we are doing the previous approach but we need an additional wrapper (update_progress_cb_wrapper()) as the current patch has so that we can add error context information. This is similar to why we have a wrapper for all other callbacks like change_cb_wrapper. -- With Regards, Amit Kapila.