Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hDr2G-0003BR-Vh for pgsql-general@arkaria.postgresql.org; Tue, 09 Apr 2019 13:43:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hDr1G-00069Y-0Q for pgsql-general@arkaria.postgresql.org; Tue, 09 Apr 2019 13:42:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hDr1E-000671-6v for pgsql-general@lists.postgresql.org; Tue, 09 Apr 2019 13:42:33 +0000 Received: from [66.111.4.26] (helo=out2-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hDr1A-00048h-RP for pgsql-general@postgresql.org; Tue, 09 Apr 2019 13:42:31 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id D135526918; Tue, 9 Apr 2019 09:42:07 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 09 Apr 2019 09:42:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=A HvKA8HwMx2DgX29hMz1LLVDWlsmduvjee+wF6W43ew=; b=Mz6q4NhRyJpMQ3MfA p8DqxnlQDbcDPmFDddLVJ7ih+HbQQ5NHUWiYuNWteaP+YcNm8Eem8GfHQXM8K0e5 Vs8sxHGyNnOUJ6eM2zttH+RO8CGzg3bQ3ZOYI09sLSOQ0hCr7WFT3tOyh7Rv2qAi 4fkRhZu/HmRNiiUOtHSm25uOtRnWRM0SEnDsJ3v39K/IDRDFuwfbQma1z6GUNrFc wh/mjtEyZS5z34CyWi2Drmb4bjRF5mGY/JTmIs8jJP4OWuB3RrVbwEvvK7ZSUVvS nHH/DNzekTYR+Z77eXhbp/J6tTM8uWDjkIxB9Wc+FQm/nmwKmSsu8HbbVcQMzx7a FshlA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=AHvKA8HwMx2DgX29hMz1LLVDWlsmduvjee+wF6W43 ew=; b=Dhzcej1LwHXV+pzWgAIJMtY0eTCno++B0siwXuTNMWJs4MzZg/ZZlBY+X TQT87nI7sLgqv/FfFw1mA5WsHQijQXiOONriORohReB30phXnplwQJQ5tfARkJP5 vFTznUQ33/fLYH6yNFthzWmEn1iLMB293ej3ieOD3G0jI7+OMRQcuNwUbA3VAnt0 M7SULsjv/r8eZLfXw9rqLTJWoGX0ax3EiVMOeHaVMLzjcQQj/zyTg/eAQveib3yz lTh6wfQxa455ryDj+hQ5n2mWAZTHga/5yRI+a7DubsUVvP8ZaQFp+BcpbXedpdzK eQDXzAyUb5I8QOoGKlQ+Imz65gFgg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrudehgdeikecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeehnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuffhomhgrihhnpegrughvrghntggvughprhhitghinhhgrdgtohhmpdhpohhsthhg rhgvshhqlhdrohhrghenucfkphepjedurddvuddvrdduhedtrddvtddvnecurfgrrhgrmh epmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm necuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [192.168.1.4] (unknown [71.212.150.202]) by mail.messagingengine.com (Postfix) with ESMTPA id BC1EA10396; Tue, 9 Apr 2019 09:42:06 -0400 (EDT) Subject: Re: Logical replication failed recovery To: Lou Tseng References: Cc: pgsql-general From: Adrian Klaver Message-ID: Date: Tue, 9 Apr 2019 06:42:05 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.26 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 4/9/19 6:08 AM, Lou Tseng wrote: Please reply to list also. Ccing list. > Hi adrian, > > You are right.  Increasing the wal_kept_segments didn't solve the > problem. However, I didn't find any scenario in the documentation > applied to my case. > Is there a way to get the databases resynced? It is still not clear to me how you got into this state. You might want to spend some time looking at the logs to see if you can figure that out, to prevent a recurrence. In the meantime I would say the way to get re-synced is to start over. In other words empty the table(s) on the subscriber side and start the subscriptions over again. > > Thanks! > > Lou Tseng > > ltseng@advancedpricing.com > > Advanced Medical Pricing Solutions > 35 Technology Parkway South, Suite. 100 > Peachtree Corners, GA 30092 > > > ------------------------------------------------------------------------ > *From:* Adrian Klaver > *Sent:* Sunday, April 7, 2019 10:05 AM > *To:* Lou Tseng; pgsql-general@lists.postgresql.org > *Subject:* Re: Logical replication failed recovery > On 4/7/19 6:22 AM, Lou Tseng wrote: >> Hi folks, >> >> Is there a good tutorial to recover from logical replication out of >> sync?  We ran into this error stating WAL has been removed and now >> replica is out of sync.  Also, is there a way to increase the number of >> WAL kept on the master? > > I have to believe there is more to the story. When a subscription is > enabled it sets up a replication > slot(www.postgresql.org/docs/11/warm-standby.html#STREAMING-REPLICATION-SLOTS > ) > > that should ensure that the WAL is not recycled until it is used. Did > you stop a Subscription then > restart it? Or one of the other scenarios shown here?: > > https://www.postgresql.org/docs/11/logical-replication-subscription.html#LOGICAL-REPLICATION-SUBSCRIPTION-SLOT > >> >> Thanks! >> >> 2019-04-07 12:28:37.180 UTC [22292] ERROR:could not receive data from >> WAL stream: ERROR:requested WAL segment 0000000100005208000000EB has >> already been removed >> >> 2019-04-07 12:28:37.182 UTC [114186] LOG:worker process: logical >> replication worker for subscription 8907992 (PID 22292) exited with exit >> code 1 >> >> >> >> Lou Tseng >> >> ltseng@advancedpricing.com >> >> Advanced Medical Pricing Solutions >> 35 Technology Parkway South, Suite. 100 >> Peachtree Corners, GA 30092 >> >> > > > -- > Adrian Klaver > adrian.klaver@aklaver.com -- Adrian Klaver adrian.klaver@aklaver.com