Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wz42V-003n0Q-1k for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Aug 2026 03:11:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wz42U-00ArNk-1k for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Aug 2026 03:10:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wz42T-00ArNc-2X for pgsql-hackers@lists.postgresql.org; Wed, 26 Aug 2026 03:10:58 +0000 Received: from mail-m16.yeah.net ([220.197.32.19]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wz42G-00000002RRA-1FLA for pgsql-hackers@lists.postgresql.org; Wed, 26 Aug 2026 03:10:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yeah.net; s=s110527; h=Message-ID:Date:MIME-Version:Subject:To:From: Content-Type; bh=EDxMk25J4FDowA8Cc08cdvOQAX3fkSgEHuFJErgyFIc=; b=CJ+5tf+ePnPZstiJAXg6x2e1bUYwWdpbR3n6WW3UJm8TiHnU4Nvu+Oa6V0zFCb CiineAJZYwdFtek04QO4Pf3JOGumkVkbagr1GSwa5DUPwj1+prVCWQ5RxKD7YNlK ZHfohpYpbJ9jFhSXa7bwTsO/1a9ewl0oJy4WooppHPAmo= Received: from [192.168.18.9] (unknown []) by gzsmtp3 (Coremail) with UTF8SMTPA id M88vCgDnK_wKWY5qdfQ5Bw--.44781S2; Wed, 26 Aug 2026 11:10:02 +0800 (CST) Message-ID: <38dbe816-9bdd-4199-bb6e-d189a7155dc6@yeah.net> Date: Wed, 26 Aug 2026 11:10:02 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Walreceiver create temp slot more than once when timeline switch To: cca5507 , Fujii Masao Cc: pgsql-hackers References: Content-Language: en-US From: Quan Zongliang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID: M88vCgDnK_wKWY5qdfQ5Bw--.44781S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrZrW5ZF1UZFyxZw45Ww45KFg_yoWDWwc_uF 4xK34kZ347CF42yw4rCw1fXr98JF4DGr4Fg34UZFyrGr45XrW3Z3yvgw4FkFWfWrnxt3Z8 Ca4agr1xKw1fCjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xR_UUUUUUUUU== X-Originating-IP: [117.12.239.179] X-CM-SenderInfo: htxd06xrqjzxxdqjq5hhdkh0dhw/1tbiNQqWumqOWQro0gAA3e List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 8/25/26 9:43 PM, cca5507 wrote: >> I also confirmed that the patch fixes the reported issue. But, >> during that test, I found that pg_stat_wal_receiver.slot_name became >> NULL after a timeline switch. >> >> I think this can happen because RequestXLogStreaming() clears >> walrcv->slotname when primary_slot_name is not configured. >> The walreceiver then does not write the existing temporary slot name >> back to shared memory because create_temp_slot is already false. >> Then, streaming continues to use the temporary slot, but >> pg_stat_wal_receiver.slot_name can show NULL. > > Good catch, fixed. > v2 can show the correct slot_name. Perform TAP tests using the original and v1 versions of walreceiver.c along with 004_timeline_switch.pl. Both issues (creation error and NULL slot_name) were reported correctly. -- Quan Zongliang