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 1psGDL-0007fk-6N for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Apr 2023 05:00:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1psGDI-0004NL-LC for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Apr 2023 05:00:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1psGDI-0004NC-9M for pgsql-hackers@lists.postgresql.org; Fri, 28 Apr 2023 05:00:08 +0000 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1psGDF-005VrR-1j for pgsql-hackers@lists.postgresql.org; Fri, 28 Apr 2023 05:00:06 +0000 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2a8c30ac7e3so88235201fa.1 for ; Thu, 27 Apr 2023 22:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682658003; x=1685250003; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=fGbTJHu88JcSWuOLz9XIEo89Fcga3lq8e/cb2rZNTLE=; b=IomTzWss0wmtK5Zb+nhWNQT3QE1OdvGFs480HAtdWaKuz/hQiEBqFlHO9AzA3CuXB+ mv/vXMntncyd7dNAcKmrvo/b3XcCkjc49UoiGI49yHDYM40mfCDy9GY53QI0kh6ZHVHu zVqwwTW61VZVz7hSLeeOebBtXYtq9Vwqh0EtDv6AvfBnPcyMm2/ELngBHCVeouU3UcTL S7xjRjOebZHkL3LD73O0pIcirYsYAfoqlKz3fA7L5ljJ6iP0C661UMur7tjlqU7cqWNr ZBjT9fOZpQba4dFUJNOz9sDwxnF9BLMGGWXJ+FHayrT5c48jlTKm+hnOl55KuibdMO4n OuWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682658003; x=1685250003; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fGbTJHu88JcSWuOLz9XIEo89Fcga3lq8e/cb2rZNTLE=; b=L2wFTSzSimInLBHyaOGmyPPjhHuV4lBx6Q4pzpVYHWJTIfiaj9n0xMxl+UzpZRLZYV SnVbw4fZpIIicu6v3rrAReSs/9PH+knrHBzkj7xqri5kmvamJ44JWsm+tUWRqLrDVqeJ EO3cEAQ/yKwp62PtrQGGRmV2Na2FOHFIPEEFLqBSVsyZzdS82B0SYa/7QPlr5Yrnm6m5 wCh3D2qH/bXKBtAYStO5ETAfLd/x/+WvCqFi1xq7j5oOELftlEqk+c5bNQG2aQ96+MyR j3P3w1t1p8caeBMipa07xasESDMUwxdH2bNq/Q+jrCSAma2/NHrEGcnOerJBgnvXxoTQ v+qQ== X-Gm-Message-State: AC+VfDyjzLN0JUhRD1UAlMhu1xFSOaafPt4ERNZAV5TVrMdIx84bKl8m nLq0JJpp52vkPSXTDIlUFZY= X-Google-Smtp-Source: ACHHUZ5/xFeAGEC5S6pSalGIn/e2GlSL7RE2938/M+yNZnUoO67ZyTXoVbl5PcAhEZsPSB95wQCbiA== X-Received: by 2002:a2e:3804:0:b0:29a:8580:8140 with SMTP id f4-20020a2e3804000000b0029a85808140mr1057609lja.3.1682658003296; Thu, 27 Apr 2023 22:00:03 -0700 (PDT) Received: from [1.0.0.7] ([178.155.28.115]) by smtp.gmail.com with ESMTPSA id w22-20020a2ea3d6000000b002aa39dd9ad3sm2892897lje.125.2023.04.27.22.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Apr 2023 22:00:02 -0700 (PDT) Message-ID: <4bebe196-b40e-e4a5-b72d-6cec907d4cc3@gmail.com> Date: Fri, 28 Apr 2023 08:00:01 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: Perform streaming logical transactions by background workers and parallel apply Content-Language: en-US To: Amit Kapila , "Zhijie Hou (Fujitsu)" Cc: PostgreSQL Hackers , Masahiko Sawada References: <2185d65f-5aae-3efa-c48f-fb42b173ef5c@gmail.com> From: Alexander Lakhin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Amit and Zhijie, 28.04.2023 05:51, Amit Kapila wrote: > On Wed, Apr 26, 2023 at 4:11 PM Zhijie Hou (Fujitsu) > wrote: >> I think the problem is that it tried to release locks in >> logicalrep_worker_onexit() before the initialization of the process is complete >> 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 attached >> 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? Yes, the patch definitely fixes it. Maybe some other onexit actions can be skipped in the non-normal mode, but the assert-triggering LockReleaseAll() not called now. Thank you! Best regards, Alexander