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 1tbk2K-00D1WT-Kv for pgsql-general@arkaria.postgresql.org; Sat, 25 Jan 2025 17:33:37 +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 1tbk1K-003qZm-Cy for pgsql-general@arkaria.postgresql.org; Sat, 25 Jan 2025 17:32:34 +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 1tbk1J-003qZU-9d for pgsql-general@lists.postgresql.org; Sat, 25 Jan 2025 17:32:34 +0000 Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tbk1G-001TNG-1B for pgsql-general@postgresql.org; Sat, 25 Jan 2025 17:32:32 +0000 Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id 4E2C725400D5; Sat, 25 Jan 2025 12:32:29 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Sat, 25 Jan 2025 12:32:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1737826349; x=1737912749; bh=fWyfessuuCpDdKj5+vl3i8/XlJunZ8gqOXiBC+60NPI=; b= RQCXcsNRmluBdOtZNapvdPo8ZzVPoT7kh+MIdm+cfINtF0WeiFxzzmKMs3f3vubx j4wNQ0mvldY5PUmGrlWLuYgWI4WcQYK5erX4mRbXmn9p+s3e7MPxN+NEReOMQRCZ /cYctaXtEZTejTDOD/Vlw1zi41jtP8W+VavKZwvsn3d5hJJLwvg/TEWTGIwyr7Kg cK+4pevKOJx+OgMUEwIupgWvDXmAqzPfZcKghcP8byAbU8dpcGXIh1HCDLrwnIoF b8/tjD4hiAooeu2jQQ/GunX2fDuD0IOJpBJQtPD+zDyLXWFJAaOOBGpeJChokXQG zNiHXFF/bFUVb7+a5c0q9w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1737826349; x= 1737912749; bh=fWyfessuuCpDdKj5+vl3i8/XlJunZ8gqOXiBC+60NPI=; b=v HedfB+FlMLwzvm2h/NucdJOLRKs15CTumo1mkAlqO/IqOwQlmY9S8cILnbL65FdV 2hAxBAOWkRjE30VmvmOeazqsFQzamrR2O2Try1CXZA6CWmqs2ePJ2cme5fm0YM2v /vv/KxudWbikdCYVW9aSsps/2gM1Qgcru6m7UvMZhyIViETTZjTaiP+T04CETeLv nfoP9mh+7VAvWQ7GEB+kh1V787MORxD4+IecXyiiWs8sFJ2SU5K856ZadwVOril3 KAy4YVIhd437CHztD+Us2V9ZMH+wZQbs3wDIDHOTpotJdN6ZfmNk24dOSN9GSnWb 7sWDsaiUSBOkCUK8cXt/g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejgedgkedttdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgg gfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeetughrihgrnhcumfhlrghv vghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrf grthhtvghrnhepfeegfeeiuedtgffgteeggfehkeejheetieeliefgteeikeejvdeiveei gfehvedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhdpnhgspghrtghpthht ohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepughsohhlihhksehmrghilh drrhhupdhrtghpthhtohepphhgshhqlhdqghgvnhgvrhgrlhesphhoshhtghhrvghsqhhl rdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 25 Jan 2025 12:32:27 -0500 (EST) Message-ID: <108b4789-190e-4b1d-a49b-d15215074351@aklaver.com> Date: Sat, 25 Jan 2025 09:32:27 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: FATAL: could not send data to WAL stream: lost synchronization with server: got message type "0", length 892351284 To: =?UTF-8?B?0JTQvNC40YLRgNC40Lk=?= Cc: pgsql-general References: <1737817110.817816585@f378.i.mail.ru> <523cb2c9-b38d-498e-b6a2-155eaaef0a1e@aklaver.com> <1737824596.412916010@f733.i.mail.ru> Content-Language: en-US From: Adrian Klaver In-Reply-To: <1737824596.412916010@f733.i.mail.ru> 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 On 1/25/25 09:03, Дмитрий wrote: > 1) What sort of replication? > - Streaming replication > > 2) Where are the two servers located relative to each other? > - The servers are located in different data centers. > > 3) Has there been any software upgrades/network changes recently? > - I don't know any information about the  software upgrades/network It would be a good thing to ask of those folks that do know. From the log attached to your initial post: 2025-01-25 17:28:01.930 MSK [1196013] LOG: starting PostgreSQL 15.10 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-2), 64-bit 2025-01-25 17:28:01.930 MSK [1196013] LOG: listening on IPv4 address "0.0.0.0", port 5432 2025-01-25 17:28:01.931 MSK [1196013] LOG: listening on Unix socket "/run/postgresql/.s.PGSQL.5432" 2025-01-25 17:28:01.932 MSK [1196013] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432" 2025-01-25 17:28:01.962 MSK [1196017] LOG: database system was shut down in recovery at 2025-01-25 17:28:01 MSK 2025-01-25 17:28:01.962 MSK [1196017] LOG: entering standby mode How was it shut down, on purpose or a hardware/software issue? Also do you have corresponding logs from primary? 2025-01-25 17:28:12.192 MSK [1196017] LOG: consistent recovery state reached at 1063C/D002DC68 2025-01-25 17:28:12.192 MSK [1196017] LOG: incorrect resource manager data checksum in record at 1063C/D002DC68 2025-01-25 17:28:12.192 MSK [1196013] LOG: database system is ready to accept read-only connections 2025-01-25 17:28:12.205 MSK [1196019] LOG: started streaming WAL from primary at 1063C/D0000000 on timeline 61 The recovery ended and the streaming started. Not sure if 'incorrect resource manager data checksum' is significant or not. 2025-01-25 17:29:08.452 MSK [1196015] LOG: recovery restart point at 1063C/DBC7E1D8 2025-01-25 17:29:08.452 MSK [1196015] DETAIL: Last completed transaction was at log time 2025-01-25 16:23:08.828548+03. 2025-01-25 17:29:24.553 MSK [1196015] LOG: restartpoint starting: wal 2025-01-25 17:29:24.553 MSK [1196015] DEBUG: performing replication slot checkpoint 2025-01-25 17:29:27.651 MSK [1196019] FATAL: could not send data to WAL stream: lost synchronization with server: got message type "0", length 892351284 2025-01-25 17:29:27.653 MSK [1196017] LOG: invalid magic number 3600 in log segment 0000003D0001063D000000F4, offset 212992 2025-01-25 17:29:27.653 MSK [1196017] LOG: invalid magic number 3600 in log segment 0000003D0001063D000000F4, offset 212992 2025-01-25 17:29:27.653 MSK [1196017] LOG: invalid magic number 3600 in log segment 0000003D0001063D000000F4, offset 212992 This is where things fall apart. What confuses me is: "could not send data to WAL stream: lost synchronization with server: got message type "0", length 892351284" If this is from the standby why is it sending data to the stream? Unless, is there cascading replication going on? 2025-01-25 17:30:01.887 MSK [1196013] LOG: received fast shutdown request 2025-01-25 17:30:01.888 MSK [1196013] LOG: aborting any active transactions Was that a manual intervention? 2025-01-25 17:30:02.157 MSK [1196015] LOG: shutting down 2025-01-25 17:30:02.181 MSK [1196013] LOG: database system is shut down 2025-01-25 17:30:02.182 MSK [1196014] DEBUG: logger shutting down So the server went from start up to shut down in ~2 minutes. From your original post: 'Restarting PostgreSQL helps.' Is that what is shown above or have you restarted since the above and the server is running? -- Adrian Klaver adrian.klaver@aklaver.com