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 1tQ7OX-000DLG-FN for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Dec 2024 16:04:30 +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 1tQ7OW-006U2z-PJ for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Dec 2024 16:04:28 +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 1tQ7OW-006U2q-DO for pgsql-hackers@lists.postgresql.org; Tue, 24 Dec 2024 16:04:28 +0000 Received: from rusty.tulip.relay.mailchannels.net ([23.83.218.252]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tQ7OU-000Mfc-08 for pgsql-hackers@postgresql.org; Tue, 24 Dec 2024 16:04:27 +0000 X-Sender-Id: hostingeremail|x-authuser|david@pgbackrest.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 593272C5E0E; Tue, 24 Dec 2024 16:04:24 +0000 (UTC) Received: from fr-int-smtpout4.hostinger.io (trex-6.trex.outbound.svc.cluster.local [100.106.29.140]) (Authenticated sender: hostingeremail) by relay.mailchannels.net (Postfix) with ESMTPA id 887AA2C5CC9; Tue, 24 Dec 2024 16:04:23 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1735056264; a=rsa-sha256; cv=none; b=5Nf1xkf1tUDAHfv+vMF3AKIY1J/0obc+wStGmOeK/ee9c1Tz+aIJ6OJl+2JDXAdVuAiPAt Q6YPPcS2G1x0f2B3Xlie65HW0wzUpk3ZlnILT3rXR48EPinU6h2q7k/4ibXaXREKpNslzz JNpN13eibOj7LY//lgcdzgIBu8ZPEHg4RrdEccID1EX3SBqRqpN4aUmgJCO2rhUWyJZlZ9 gc04hxM5gEz3qmg6hv0bASvNFmBUtFuD4iJ2tMadppWpJQmgARY87/jeEuEA0xbYGhZkPo +H6jWUnX53/9TUwGa0FZ9XdbEU0ObLbp0Pj/a+UEAlnEC+ogxvNbX2JgRHoz3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1735056264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=bZBZP9jvKzzh2sWUmCxO5Tuo5+yTZqwRyoCNfnQF5Ag=; b=iFSMIatjnvJWpCpzxiMVAn/yV8GHSYcGXP9uUCE5hJHWiCfm3bHD0gJvNj8t6iApU2ixV7 NxVmKbwOdItiKOG32s5iKmlkD24VD+c9idnsjbyv5giDw2kFQxJQKvVAzx7isQSc78ZL2M LgYR618Pl4zn0rkY79w+hyYS/HE8t9y0so2CmeTbxGQBkCoxCw5rH6EQ6Cx6k6Fh6h895w 8ljN1ozP4UP2W//2pZhAaZXjeH1idRnFL/qPW005HBYKVRc6DrTG6o1oCtGIYhc9/6arbY Yl5Art3nmrD1lUEAwdU0KYXU1q7bU+Yd0QpwjUvNYw3rZaWsyaCJ0YW/H3x3DQ== ARC-Authentication-Results: i=1; rspamd-56bf78cbd4-tknvk; auth=pass smtp.auth=hostingeremail smtp.mailfrom=david@pgbackrest.org X-Sender-Id: hostingeremail|x-authuser|david@pgbackrest.org X-MC-Relay: Neutral X-MailChannels-SenderId: hostingeremail|x-authuser|david@pgbackrest.org X-MailChannels-Auth-Id: hostingeremail X-Power-Zesty: 70b9078d35c1ea4e_1735056264206_3530859829 X-MC-Loop-Signature: 1735056264206:3565387637 X-MC-Ingress-Time: 1735056264206 Received: from fr-int-smtpout4.hostinger.io (fr-int-smtpout4.hostinger.io [89.116.146.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.106.29.140 (trex/7.0.2); Tue, 24 Dec 2024 16:04:24 +0000 Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgbackrest.org; s=hostingermail1; t=1735056261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bZBZP9jvKzzh2sWUmCxO5Tuo5+yTZqwRyoCNfnQF5Ag=; b=IH82wLGoz0DXxoU0AM00O4qCtwlGzBMAoOAP7/Ro9U2u4jGLrwQK7EB/e3p+OaQ6lfKSO4 1CLHzgCQcyWMzHyW+rPHxloLGNIrAyVEqByoqTCh36Wi6u/LVwDB1dXhpdaBCzJiFfoJTF bRlbk43eAzi9L8WRV54Tsttup++w/pen/o0h1zTXDzYwFhnytbJ8Zu3wuOhhERwzxfH7iw w8zktYt8AzZhwePU/+vhrYojSo4bYf+lAGkDovCPXcVSupP+zkr50NlTav37/RcU1jog+2 IEheXJDCS+JF1BSfu+AhZ8qzVzbYrS01M8s1FhmWnOvnOEClbn63SjB03ANWgQ== MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Fix logging for invalid recovery timeline To: "Andrey M. Borodin" Cc: Pg Hackers References: Content-Language: en-US From: David Steele In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 24 Dec 2024 16:04:20 +0000 (UTC) X-CM-Analysis: v=2.4 cv=Z9S+H2RA c=1 sm=1 tr=0 ts=676adb85 a=qqyYLSDh4Dvv74dFaEHd7g==:117 a=qqyYLSDh4Dvv74dFaEHd7g==:17 a=IkcTkHD0fZMA:10 a=jixU_1hUAAAA:8 a=6mnCLjAhK8z3FFNVMo8A:9 a=QEXdDO2ut3YA:10 a=q5YM_uMBw6irhRasv8ad:22 X-CM-Envelope: MS4xfIzAhQXzhkp/PQV6VcLf1KeweD3aSdCNUI4KygW5KTX0ChwWsAkVOukYHUWLhEHS9JlLHVGr/lt6ZXmA/ZwzR/wbA/M3O4D2XPkFjU9skSBhZCTxuORx 3sLB+DnT7G5r8PrfLUo4ATicjtODH9mtK/dmoALlrm4EZdLZ7+SEyT36b623uinSEztVtunwRCdhEDdhFr7zb7odMovGnX6dETNedbyEd2GOZFLn6B/8xRAi X-AuthUser: david@pgbackrest.org List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/20/24 23:28, Andrey M. Borodin wrote: > >> On 20 Dec 2024, at 20:37, David Steele wrote: >> >> "Latest checkpoint is at %X/%X on timeline %u, but in the history of the requested timeline, the server forked off from that timeline at %X/%X." > > I think errdetai here is very hard to follow. I seem to understand what is going on after reading errmsg, but errdetai makes me uncertain. Yeah, this one confuses users a lot. We see it mostly when a user accidentally promotes a standby and that standby pushes a history file and maybe some WAL on a new timeline, e.g. 2. The original primary continues to make backups on the original timeline 1. At some point a restore is required and Postgres by default wants to recover to the most recent timeline, but timeline 2 forks from timeline 1 before the latest backup was started so it is not accessible. The solution is to set the target timeline to current but first the user needs this figure out what is going on an this error message just doesn't contain enough information to do that. I have some ideas on how to make it better but that would probably be for HEAD only. > If we call "tliSwitchPoint(CheckPointTLI, expectedTLEs, NULL);" > don't we risk to have again > ereport(ERROR, > (errmsg("requested timeline %u is not in this server's history", > tli))); > ? I'm not sure what you mean. For primary backups CheckPointTLI will always equal ControlFile->checkPointCopy.ThisTimeLineID so that shouldn't be a problem. For standby backups CheckPointTLI will be <= ControlFile->checkPointCopy.ThisTimeLineID since CheckPointTLI represents the timeline at the start of the backup. If a route from that timeline to the current timeline can't be found then I'd certainly expect an error. I'll add this patch to the January CF. Regards, -David