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 1psED0-00020N-To for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Apr 2023 02:51:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1psECz-0003VJ-7s for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Apr 2023 02:51:41 +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 1psECy-0003Sx-UG for pgsql-hackers@lists.postgresql.org; Fri, 28 Apr 2023 02:51:40 +0000 Received: from mail-oo1-xc36.google.com ([2607:f8b0:4864:20::c36]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1psECt-002HPH-3p for pgsql-hackers@lists.postgresql.org; Fri, 28 Apr 2023 02:51:39 +0000 Received: by mail-oo1-xc36.google.com with SMTP id 006d021491bc7-549d9c2935fso2682931eaf.2 for ; Thu, 27 Apr 2023 19:51:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682650294; x=1685242294; 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=yQoqv1OrXdQ8i4e4HRXsplF1WcG0/RV6fZn65AEsiX0=; b=ca/Kl2l643phpb/lY3jIZGMBTrZtlsqu37JyG1cdW67l/5xFeFFrOvQhu0InPboEE8 qsXjRr52L99XHJvWLJHcAh/B5ZGF3AQfyX8Xu1W7ZWf3q+RVp39Jb1qF6epZXSj0Wd4J MRyMfrkX5TrGliYA7Ft+xAMfLywcpecGrOHHvz+mb7LqoaojdzouQ5uHshDggRgKW4Gj SsMRgwhLeymgiuZ1ZMx6SAG0l0WyFaFh80YUSfZVTAlJsArutVTB2itRQlBTWzARwHuv MIHcZrx/UIuofO8Zfk9BsLL9cYri35ukE4JENK9oKA9T3Iu8EzfQRwibzrqEYSiK4f4Z 0lJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682650294; x=1685242294; 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=yQoqv1OrXdQ8i4e4HRXsplF1WcG0/RV6fZn65AEsiX0=; b=fzOvoWkqDpoJ3dLx8Ko3chwb3Gt/xTBBU4pcisN1U8x/BDSIOfLi4E/0HacPfxa2s9 uZMMkRtu0fiqVM0UCNTw0YC3+FGQAlcTGnZaD7IzZ7AXMcRU9UIVKldEQIv+P6E5uzZd 6wyX+f0WKN++NewEBUnuCjjDI+j2nCk2OP+VxnKX/5Pnm7qef6y9/ZVGnH5YKq1F3gFd sLiErs710VCjnU2iRLZIOaPrs9zCUfo865RM4b5FZhy9RXUm9Os6C3VdWRH9rhGPVtrR cHNlnHVhMDg13vjSK86d4u9I8vW8YrdUP55h2T+PzG1kovOWPDbVnmwlcrUyUYstTZeE t0lA== X-Gm-Message-State: AC+VfDxBUJTldTMbPXqMgAc8/guEfhGj9U4Vwm6HtpVEssxAdlzqOkOW R6/kh3De6NHhtbnrAwRZcVfZSxctj2CvpJ0W3Vw= X-Google-Smtp-Source: ACHHUZ6djzSJtWQpRnUI1QxfkF/PePGj0v9WB72C36hBqRPx8jxdkU5X9No0QYVEqNP2bPKR9KAuaUEGgiVVLiw62hI= X-Received: by 2002:a4a:de99:0:b0:54a:65e7:9b51 with SMTP id v25-20020a4ade99000000b0054a65e79b51mr1890068oou.8.1682650294180; Thu, 27 Apr 2023 19:51:34 -0700 (PDT) MIME-Version: 1.0 References: <2185d65f-5aae-3efa-c48f-fb42b173ef5c@gmail.com> In-Reply-To: From: Amit Kapila Date: Fri, 28 Apr 2023 08:21:22 +0530 Message-ID: Subject: Re: Perform streaming logical transactions by background workers and parallel apply To: "Zhijie Hou (Fujitsu)" Cc: Alexander Lakhin , PostgreSQL Hackers , Masahiko Sawada 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 Wed, Apr 26, 2023 at 4:11=E2=80=AFPM Zhijie Hou (Fujitsu) wrote: > > On Wednesday, April 26, 2023 5:00 PM Alexander Lakhin wrote: > > > > IIUC, that assert will fail in case of any error raised between > > ApplyWorkerMain()->logicalrep_worker_attach()->before_shmem_exit() and > > ApplyWorkerMain()->InitializeApplyWorker()->BackgroundWorkerInitializeC > > onnectionByOid()->InitPostgres(). > > Thanks for reporting the issue. > > I think the problem is that it tried to release locks in > logicalrep_worker_onexit() before the initialization of the process is co= mplete > because this callback function was registered before the init phase. So I= think we > can add a conditional statement before releasing locks. Please find an at= tached > patch. > Alexander, does the proposed patch fix the problem you are facing? Sawada-San, and others, do you see any better way to fix it than what has been proposed? --=20 With Regards, Amit Kapila.