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 1qUNNc-00CfkJ-9Z for pgsql-admin@arkaria.postgresql.org; Fri, 11 Aug 2023 08:20:21 +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 1qUNNY-005UD4-MO for pgsql-admin@arkaria.postgresql.org; Fri, 11 Aug 2023 08:20:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qUNNX-005UCv-91 for pgsql-admin@lists.postgresql.org; Fri, 11 Aug 2023 08:20:16 +0000 Received: from sonic308-17.consmr.mail.ir2.yahoo.com ([77.238.178.145]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qUNNU-001qMN-00 for pgsql-admin@lists.postgresql.org; Fri, 11 Aug 2023 08:20:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1691742009; bh=gKyQlxWLd+p57ubsRTSdwWugPPIBHCh4OcJtl8TmOPE=; h=Date:Subject:Cc:References:From:In-Reply-To:From:Subject:Reply-To; b=ClxthYkvwKGVbHTW2RL4x/EN8ZRIi66KY0idBx4JPD3nOimStDXf/EMKbwRUe5TuDxVAJ377cncbEG7ZGpfVffWFxOM5hH4udDTFJ39A+thVShc4L2UFBkE42qlkI8k7ANglW/mdPfHOElIGfumUQ1lsgpwyq8Sw8yplFqFp6ttIZxaNqg9v8kVctOktiBxFVkmHLBXjiKaMD9ZZ24Em+DVwjAkVBq0fQ8/I4Kc4dafqkkaEwj5Z9kp0FP8/3neSSy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Hk.UY7C3LNV42LvpS19PZ7k07aLRGfmUL5MEuDU9IumWvfXFhyp SaMtCt1XCShQ0NRfEVkX6NQexygD7nyCh6g6wGYe76VMkFn9Xc4ebqRiRNMRNGhRg7QnTydSoOVf m65PFlJpOIo5wPS6YIxDWsMeyjMQ6p1aHAArZ.RxZ2i1N36w_ZeKvybkL2VGnVhmorqd7SVdDBLB 01Slw88UUlE_UL1czsE9Je6vrrjG0bbLJ4NCBhUGfzfTv1wGMieFadAWNA4sL0dllkWJV5e2k0Nq FAzdPOHpVFvJ3N2wr0bpiX_jnLOxP178E1tvvxIiwFy12xKZ.rOuQy8H5eHVlnnG9JSHE.Y5Rv.r wb.nmnQ9O.VzK7ZwRaj_1QWaTLYQV00TQQ5xoascnLrcgPfCknHHtggtwvbbnmWoGrlaijCj2Eq7 BbxMJz3pP3wAcDKwLeDHze3PGOT0u3.92dRB02e4hZdfPSO6OBYIzcHrFHY_n1JVLf2Y_N6s.zoq jlw_tFRuHT.b571OzYZjHNrj544T_5IF2f33gMJEOb4CKImtXmjuchwdHzsxtsWI9mhM46nNT1Jb scG3JlnL7QFXOwDR6G46EiPiAT_SiYbDKnqFdou7AOhLU.RrNc13sMcW6WBpFzWuTLRFoqP17Fob VDb9Fzvosj7o05owAtCiic7LurN4kkX28170fvs7O8u7LvgA7NJQKFDkyirPMKOmromxwGjPbf.5 MMTJtBc3JqSvSWo6o1uquKH10x4a8j26M7zanwuSfa91XnASl8BpjQBWZqTdPN_Dpwijoj9j1l99 0XmNndV6bmZGsFFDOV1PLvnId.CDN7MA- X-Sonic-MF: X-Sonic-ID: c60a7dae-f3ae-4ec9-8362-b868124a3b62 Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.ir2.yahoo.com with HTTP; Fri, 11 Aug 2023 08:20:09 +0000 Received: by hermes--production-ir2-5cc57b9c45-9ltjd (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 11338847233ee28d81861da08a044e68; Fri, 11 Aug 2023 08:20:06 +0000 (UTC) Message-ID: Date: Fri, 11 Aug 2023 10:20:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: .history': No such file or directory - a symptom of ? Content-Language: en-US Cc: pgsql-admin@lists.postgresql.org References: <2dfed6d4-115e-389e-b265-49a0d8599ecb.ref@yahoo.co.uk> <2dfed6d4-115e-389e-b265-49a0d8599ecb@yahoo.co.uk> From: lejeczek In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailer: WebService/1.1.21695 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 4289 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/08/2023 17:41, Stephen Frost wrote: > Greetings, > > * lejeczek (peljasz@yahoo.co.uk) wrote: >> What is that - as per subject - a symptom of exactly? > Arguably, a poor restore command being used ... > > PostgreSQL will request .history files when doing recovery and will keep > requesting them, by default, until it finds that one isn't there- it > will then target the last timeline that it found to perform replay to > (target timeline = latest). We do also look for .history files when > going through the promotion process and similarily will keep checking > for timeline files until we don't find one and then that's the timeline > we will move to for the promotion and we'll then immediately push a new > .history file into the archive to 'claim' that timeline. > > Basically, it's not an error and it's entirely intentional that it works > that way and your restore command probably shouldn't be complaining > about it really (and that's where the actual 'No such file or directory' > bit is coming from- not from PG itself). > >> I get that there was an issue, but with more details explained. Perhaps >> there are docs which explain that? > Much more likely that there wasn't actually any issue... > >> When it happens I take slave down and do _pg_basebackup_ off the master - >> but is there a more "civilized" way to "push" the slave back in sync, maybe >> without taking slave off-line? > Not following this bit at all. There being a message about PG not > finding a .history file during restore or promotion isn't actually an > indication of anything having gone wrong or that the replica is out of > sync. In other words, I don't know that you needed to actually do > anything. Is there some reason you think you did need to do something > beside that message being in the log..? > > Thanks, > > Stephen Perhaps there is not an actual, real issue with synchronization, however the logs make me - I'd imagine anybody who is a novice like me - uncomfortable. These logs, the errors never quiet down - I've been waiting a few days. from master: .... 2023-08-11 10:12:18.908 CEST [776006] STATEMENT:  START_REPLICATION 0/4E000000 TIMELINE 1 2023-08-11 10:12:23.909 CEST [777443] ERROR:  requested WAL segment 00000001000000000000004E has already been removed 2023-08-11 10:12:23.909 CEST [777443] STATEMENT:  START_REPLICATION 0/4E000000 TIMELINE 1 2023-08-11 10:12:28.911 CEST [778491] ERROR:  requested WAL segment 00000001000000000000004E has already been removed 2023-08-11 10:12:28.911 CEST [778491] STATEMENT:  START_REPLICATION 0/4E000000 TIMELINE 1 ... from slave: ... cp: cannot stat '/var/lib/pgsql/pg_archive/00000002.history': No such file or directory 2023-08-11 10:12:38.919 CEST [773947] LOG:  waiting for WAL to become available at 0/4E002000 cp: cannot stat '/var/lib/pgsql/pg_archive/00000001000000000000004E': No such file or directory 2023-08-11 10:12:43.916 CEST [1050527] LOG:  started streaming WAL from primary at 0/4E000000 on timeline 1 2023-08-11 10:12:43.916 CEST [1050527] FATAL:  could not receive data from WAL stream: ERROR:  requested WAL segment 00000001000000000000004E has already been removed cp: cannot stat '/var/lib/pgsql/pg_archive/00000002.history': No such file or directory 2023-08-11 10:12:43.918 CEST [773947] LOG:  waiting for WAL to become available at 0/4E002000 cp: cannot stat '/var/lib/pgsql/pg_archive/00000001000000000000004E': No such file or directory 2023-08-11 10:12:48.920 CEST [1051003] LOG:  started streaming WAL from primary at 0/4E000000 on timeline 1 2023-08-11 10:12:48.920 CEST [1051003] FATAL:  could not receive data from WAL stream: ERROR:  requested WAL segment 00000001000000000000004E has already been removed cp: cannot stat '/var/lib/pgsql/pg_archive/00000002.history': No such file or directory 2023-08-11 10:12:48.923 CEST [773947] LOG:  waiting for WAL to become available at 0/4E002000 ... So, seeing logs flooded that way.... I don't like it (even if I could be sure everything is in sync) particularly for master shows: -> $ sudo -u postgres psql --port=5432 -x -c 'select client_addr,sync_state from pg_stat_replication;' could not change directory to "/root": Permission denied (0 rows) so I do 'pg_basebackup' then. many thanks, L.