Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFYp3-0000ZO-Dq for pgsql-bugs@arkaria.postgresql.org; Thu, 03 Feb 2022 09:54:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nFYp2-0003Vg-6t for pgsql-bugs@arkaria.postgresql.org; Thu, 03 Feb 2022 09:54:36 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFYp1-0003VW-SB for pgsql-bugs@lists.postgresql.org; Thu, 03 Feb 2022 09:54:35 +0000 Received: from smtp.rtlabs.ru ([185.195.169.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1nFYoy-00047Y-SV for pgsql-bugs@lists.postgresql.org; Thu, 03 Feb 2022 09:54:34 +0000 Content-Language: ru-RU Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; d=rtlabs.ru; s=mail; c=simple/simple; t=1643882060; h=from:subject:to:date:message-id; bh=K2mgs+qmyPcgtbbNEtOWdEU88xNYYNDWKq3DPrXIpQE=; b=am8PTvi4jRGq6Zd6gskv6wjBgal0VkWFxZryVfAFyU97vtXuQdyYUnoZCQuECnkY3Shf1IOC8M4 D2nG6tzA1ShPeWHn5+WZ3OqjqKhavXsepjW7izkKlfmiIYn3Efs7YDS+Uq22IXzCT/Dl+/NEcBihH IIZODQwOepbUbWWLqavjfGXYgDpAtWWdq6Ub67UX/kM8Yr/UnZ1Lavpg4GPtFW1QlY+pVs2MLrb7+ x0ORrARgL4A/Nx4cyAho0dg+v4BhrQGJePTfbHITkSzMo6cu5rwXM/ktBGuK8c615q4igsS14/nvH 0bdMvov0NlCeJBaO7ogFEGw4F4cOQaH8xaTQ== Received: from EXCH-MAIL02.rtlabs.ru (10.66.17.71) by EXCH-MAIL02.rtlabs.ru (10.66.17.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.986.15; Thu, 3 Feb 2022 12:54:19 +0300 Received: from EXCH-MAIL02.rtlabs.ru ([fe80::15b3:954d:bd13:8399]) by EXCH-MAIL02.rtlabs.ru ([fe80::15b3:954d:bd13:8399%6]) with mapi id 15.02.0986.015; Thu, 3 Feb 2022 12:54:19 +0300 From: =?koi8-r?B?9czBxdcg4czFy9PBzsTSIPPF0sfFxdfJ3g==?= To: Sergei Kornilov , PG Bug reporting form CC: "pgsql-bugs@lists.postgresql.org" Subject: RE: Re:BUG #17392: archiver process exited with exit code 2 was unexpectedly cause for immediate shutdown request Thread-Topic: Re:BUG #17392: archiver process exited with exit code 2 was unexpectedly cause for immediate shutdown request Thread-Index: AQHYGJqfkx/xgV+GkkKotwEX2bSY56yBUx8AgAA6ZaA= Date: Thu, 3 Feb 2022 09:54:19 +0000 Message-ID: <779598bff1e7430f9e032d1b62b8006b@rtlabs.ru> References: <17392-ae1e272049dfec87@postgresql.org> <22132351643878322@sas1-941a8864505d.qloud-c.yandex.net> In-Reply-To: <22132351643878322@sas1-941a8864505d.qloud-c.yandex.net> Accept-Language: ru-RU, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.66.17.114] MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, thanks for your cooperation 2022-02-01 16:11:34,964 INFO: no action. I am (db02.local) the leader with = the lock 2022-02-01 16:11:44,950 INFO: no action. I am (db02.local) the leader with = the lock 2022-02-01 16:11:54,677 INFO: Lock owner: db02.local; I am db02.local 2022-02-01 16:11:56,145 ERROR: Request to server http://IP_ETCD1:2379 faile= d: MaxRetryError('HTTPConnectionPool(host=3D\'IP_ETCD1\', port=3D2379): Max= retries exceeded with url: /v2/keys/postgresql/db/leader (Caused by Read TimeoutError("HTTPConnectionPool(host=3D\'IP_ETCD1\', port=3D2379): Read ti= med out. (read timeout=3D1.4283105651182788)",))',) 2022-02-01 16:11:56,146 INFO: Reconnection allowed, looking for another ser= ver. 2022-02-01 16:11:56,146 INFO: Retrying on http://IP_ETCD2:2379 2022-02-01 16:11:56,262 INFO: Selected new etcd server http://IP_ETCD2:2379 2022-02-01 16:11:56,475 INFO: no action. I am (db02.local) the leader with = the lock 2022-02-01 16:12:04,950 INFO: no action. I am (db02.local) the leader with = the lock 2022-02-01 16:12:14,960 INFO: no action. I am (db02.local) the leader with = the lock 2022-02-01 16:12:24,669 INFO: Lock owner: db02.local; I am db02.local 2022-02-01 16:12:24,738 ERROR: Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/patroni/dcs/etcd.py", line 562, in= wrapper retval =3D func(self, *args, **kwargs) is not None File "/usr/lib/python3.6/site-packages/patroni/dcs/etcd.py", line 692, in= _update_leader return self.retry(self._client.write, self.leader_path, self._name, pre= vValue=3Dself._name, ttl=3Dself._ttl) File "/usr/lib/python3.6/site-packages/patroni/dcs/etcd.py", line 443, in= retry return retry(*args, **kwargs) File "/usr/lib/python3.6/site-packages/patroni/utils.py", line 334, in __= call__ return func(*args, **kwargs) File "/usr/lib/python3.6/site-packages/etcd/client.py", line 500, in writ= e response =3D self.api_execute(path, method, params=3Dparams) File "/usr/lib/python3.6/site-packages/patroni/dcs/etcd.py", line 256, in= api_execute return self._handle_server_response(response) File "/usr/lib/python3.6/site-packages/etcd/client.py", line 987, in _han= dle_server_response etcd.EtcdError.handle(r) File "/usr/lib/python3.6/site-packages/etcd/__init__.py", line 306, in ha= ndle raise exc(msg, payload) etcd.EtcdKeyNotFound: Key not found : /postgresql/db/leader 2022-02-01 16:12:24,928 ERROR: failed to update leader lock 2022-02-01 16:12:27,063 INFO: demoted self because failed to update leader = lock in DCS 2022-02-01 16:12:27,079 INFO: closed patroni connection to the postgresql c= luster 2022-02-01 16:12:28,685 INFO: postmaster pid=3D153397 2022-02-01 16:12:34,670 INFO: Lock owner: None; I am db02.local 2022-02-01 16:12:34,671 INFO: not healthy enough for leader race 2022-02-01 16:12:34,738 INFO: starting after demotion in progress 2022-02-01 16:12:44,672 INFO: Lock owner: None; I am db02.local 2022-02-01 16:12:44,672 INFO: not healthy enough for leader race 2022-02-01 16:12:44,741 INFO: starting after demotion in progress 2022-02-01 16:12:54,672 INFO: Lock owner: None; I am db02.local 2022-02-01 16:12:54,672 INFO: not healthy enough for leader race 2022-02-01 16:12:54,739 INFO: starting after demotion in progress 2022-02-01 16:13:04,672 INFO: Lock owner: None; I am db02.local 2022-02-01 16:13:04,672 INFO: not healthy enough for leader race 2022-02-01 16:13:04,746 INFO: starting after demotion in progress 2022-02-01 16:13:14,673 INFO: Lock owner: None; I am db02.local 2022-02-01 16:13:14,674 INFO: not healthy enough for leader race 2022-02-01 16:13:14,743 INFO: starting after demotion in progress 2022-02-01 16:13:18,748 INFO: establishing a new patroni connection to the = postgres cluster 2022-02-01 16:13:19,961 INFO: Got response from db01.local http://IP_DB01:8= 008/patroni: {"state": "starting", "role": "replica", "database_system_iden= tifier": "9879384539485923423", "patroni": {"version": "2.1.0", "scope": "d= b"}} 2022-02-01 16:13:19,961 WARNING: Request failed to db01.local: GET http://I= P_DB01:8008/patroni ('xlog') 2022-02-01 16:13:20,365 INFO: promoted self to leader by acquiring session = lock 2022-02-01 16:13:20,380 INFO: cleared rewind state after becoming the leade= r 2022-02-01 16:13:21,816 INFO: no action. I am (db02.local) the leader with = the lock 2022-02-01 16:13:24,830 INFO: no action. I am (db02.local) the leader with = the lock 2022-02-01 16:13:34,826 INFO: no action. I am (db02.local) the leader with = the lock Best regards, Ulaev Alexander -----Original Message----- From: Sergei Kornilov [mailto:sk@zsrv.org]=20 Sent: Thursday, February 3, 2022 11:52 AM To: PG Bug reporting form Cc: =F5=CC=C1=C5=D7 =E1=CC=C5=CB=D3=C1=CE=C4=D2 =F3=C5=D2=C7=C5=C5=D7=C9=DE= ; pgsql-bugs@lists.postgresql.org Subject: Re:BUG #17392: archiver process exited with exit code 2 was unexpe= ctedly cause for immediate shutdown request Hello > 2022-02-01 16:12:24 MSK [16959] LOG: received immediate shutdown request Please prove by patroni logs, that not patroni commanded immediate shutdown= . As far as I remember, there should be a mark about the request for stoppi= ng the database immediatly. Seems unrelated to archiver. Patroni is able to command immediate shutdown,= immediate shutdown is a kind of "terminated abnormally". The sequence of l= ogs looks completely correct. regards, Sergei