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.94.2) (envelope-from ) id 1qiqFt-0081wK-ET for pgsql-bugs@arkaria.postgresql.org; Wed, 20 Sep 2023 06:00:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qiqFr-00Egg0-RE for pgsql-bugs@arkaria.postgresql.org; Wed, 20 Sep 2023 06:00:07 +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.94.2) (envelope-from ) id 1qiqFr-00Egfo-GM for pgsql-bugs@lists.postgresql.org; Wed, 20 Sep 2023 06:00:07 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qiqFo-005ZYL-Li for pgsql-bugs@lists.postgresql.org; Wed, 20 Sep 2023 06:00:06 +0000 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-502b1bbe5c3so10763805e87.1 for ; Tue, 19 Sep 2023 23:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695189603; x=1695794403; darn=lists.postgresql.org; 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=Fg9pK+e7zQiS0PoXCXfLBeX03jX+g+pHGY5qJANGOzI=; b=fZUaJP/ki5bfP97b/JcXwKftxsy8aFAjyy5hjLikh3jc1SssHskX/AcROaRHjj8XIo FgXxuAM+Eg9Ir8SbAI6oh7Xrn96IgTNg7sKyMJhmIzcPcM96X8gWewD+lE7KL0lk4Fi/ VrmTXwRPad6xNWI38QfA69xeJpfq4FTZfOZsEqXbJYkUWRw3wTu7Acy6E7CmWN51EGHF 2d4nU2tBasdJZlgPUv/dt1KybMm8HyKiSygTkTj3PI1b2qQPSHpcc2PBN8qSZYDY/WzJ gIcnu/wMBgF7b3NyFDMMkmZH3pT1+h859NnD9Fvof2yCBSTFsiDSz4m6dudOB1+jdHQi kAbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695189603; x=1695794403; 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=Fg9pK+e7zQiS0PoXCXfLBeX03jX+g+pHGY5qJANGOzI=; b=VgGvwXCcCfKG/O1wnGh9KZr827Ae78suaaS4veJAOXsjthi0r3le8/s/MdMDJnv83B oLxc01JU0oJz2YpOpmT7u2cEQoLz4TBuBt+Q+6Ka9/+gqeoyElNsfb9HCvV+Q2yZHk8S jgKlPy3PjlglcEOrEffu4V/j5+yi97MV55YjvV0hwFmtizUh37jxGBfYV6Tg1Ro5n5gX vCCKVmOow3yDqGzGeo/R3lOeI1uO680VYEAAwcVC6Ay10MOjGjJwGxQtQZSGOMUHFexO l6MtW1E2mEWj90zwcTOs0r3gCG/SnY48osM3UXXmd9wJntChTRd9BEH28YHIllxNV+Uq yNWg== X-Gm-Message-State: AOJu0YyRycfUwc2j+oLeMONb+vXcHk2SSFHbJ0mCUkve+Z6V0c/5E6YW oaDnTaIU89BFh891lHJE8kg= X-Google-Smtp-Source: AGHT+IHxZGGB4/8TbvDgf66Wr3nG6WAABEAQwCnNSA6G6S+SftR31/HJ4PNHxvG8GIsvdadR6LbiZg== X-Received: by 2002:a05:6512:3591:b0:500:a66b:b189 with SMTP id m17-20020a056512359100b00500a66bb189mr1202361lfr.51.1695189602707; Tue, 19 Sep 2023 23:00:02 -0700 (PDT) Received: from [1.0.0.7] ([81.23.167.222]) by smtp.gmail.com with ESMTPSA id n3-20020a056512388300b004fe4e89dc41sm2525455lft.214.2023.09.19.23.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Sep 2023 23:00:01 -0700 (PDT) Message-ID: Date: Wed, 20 Sep 2023 09:00:00 +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: BUG #17928: Standby fails to decode WAL on termination of primary Content-Language: en-US To: Thomas Munro Cc: Michael Paquier , Sergei Kornilov , Noah Misch , Tom Lane , Kyotaro Horiguchi , pgsql-bugs@lists.postgresql.org, Fujii Masao References: From: Alexander Lakhin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 20.09.2023 01:51, Thomas Munro wrote: > The solution in this version is to call get_insert_len() instead of > using the result of emit_message() for the values returned by the > advance_XXX() functions. The result of emit_message() is actually the > LSN of the following COMMIT record so can't be used directly for > building xl_prev chains. > >> And may be "xlp_prev" is a typo? > Fixed. I've retested this version (patches for all branches, plus wal_log_hints, plus Valgrind, and also retested code changes with my 099_restart_with_stanby.pl) and found no issues. IMHO, this patch is ready to float off. Thank you! Best regards, Alexander