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 1kQtyB-0000ko-AH for pgsql-admin@arkaria.postgresql.org; Fri, 09 Oct 2020 15:06:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kQtyA-00082y-96 for pgsql-admin@arkaria.postgresql.org; Fri, 09 Oct 2020 15:06:06 +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 1kQtyA-00081h-2E for pgsql-admin@lists.postgresql.org; Fri, 09 Oct 2020 15:06:06 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kQty7-0000Hz-NE for pgsql-admin@lists.postgresql.org; Fri, 09 Oct 2020 15:06:05 +0000 Received: by mail-wm1-x342.google.com with SMTP id e23so3130977wme.2 for ; Fri, 09 Oct 2020 08:06:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=smDIY0pJcjO8gEx38pLTrqzjjJdEKiPZqOGj3p+VLgY=; b=OS/SkNqzu+bApqh/HzUWdzOIMPzS14nTj1lGR1VmzQmw5Ipfsz1s5q6iqI0u4Qf100 e6ELJ63qKcayLyhs4nNGBBtvzSLEQN9zoJjznUZx3T7RAF2EsqAyQ1XU1WW/AaC8N1Rc NmkMANyNRO1IpF+ONOp0SQ3vlAMB/pYwPlsJnsK+EFu6rSdeDFQdJlOhP1jxBCcT7+6t FI7FxbWM4V3R4hByWOnJURaD1DHry94o6VLAAtAFpvX6/bniNiU0wG9xBRdn32YmevRh BUY7kAIaSS4OgOjFlbvkgjAIqedxaTLPQZVJs3bcBVNoqs/YszQZrZL5yYk9kQyGTruB 5haQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=smDIY0pJcjO8gEx38pLTrqzjjJdEKiPZqOGj3p+VLgY=; b=rg5bG7BT2Y4+qX9+OBfhdCZ+9XQyDYs0TOjYbxEJ4EnWRYaNRwOSEc7PV0OLFgXKe6 dZ+OY8OI8x6jvqrms1UdvN2H9SNnytUX3nBqpkQ+uxbhXbQ+0zvmNhbP4amXJxlwlHZ4 uVOK1yUiMteP9XfnFGCy/nBkDmjVsJzKuVCsJmL1YnO2ZIGDx5kipJ69kCfr0ChtmTqB /uY0Hw8rQQekSUPeVTjcb4mDBM7kinyE3iQqWSxjjDEZM331BhLCyYJVJd9d38N1/pmV fNSo0Hv+UpneTXcOntruxnVLi1el1h8KftUk69xfv+cp9I7UTDWCDCFyUpTQvCxjXnZf Zhcg== X-Gm-Message-State: AOAM533ZrWCd/qi/aNy6GlvxkyU2OtXrQAFetB7Up79kHNtxPVQxUFra il2ZhgiqwE6ZMLltXPmkOxd9NhcdlFp4hQ== X-Google-Smtp-Source: ABdhPJw6G66fxbwU+BkByjFylNXeldegNyJqGJijo0FnkAzVTfZ7JdVZTbR4SETSRLKrxBJ/MUAB7g== X-Received: by 2002:a1c:3d7:: with SMTP id 206mr1505471wmd.155.1602255962284; Fri, 09 Oct 2020 08:06:02 -0700 (PDT) Received: from localhost.localdomain (212-186-246-158.static.upcbusiness.at. [212.186.246.158]) by smtp.gmail.com with ESMTPSA id l11sm13297764wrt.54.2020.10.09.08.06.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Oct 2020 08:06:01 -0700 (PDT) Message-ID: <82d9b8f97e58718be841129026fabfd85ddb7ba2.camel@cybertec.at> Subject: Re: terminating connection due to conflict with recovery From: Laurenz Albe To: Don Seiler , Pgsql-admin Date: Fri, 09 Oct 2020 17:06:00 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 2020-10-08 at 10:17 -0500, Don Seiler wrote: > I have a PG 12.4 read replica that we're using to offload short read-only queries from the primary. However this morning (and random other days/times, it seems), I see batches of these messages in > the replica PG log: > > FATAL: terminating connection due to conflict with recovery > > I have hot_standby_feedback enabled already, but looking further at this message, it isn't cancelling the transaction but rather terminating the connection entirely. This suggests perhaps that a > session is sitting "idle in transaction" for 30 seconds (our max_standby_streaming_delay is at the default 30s)? Or that a group of sessions are "idle in transaction" and overlapping enough that > recovery is blocked for 30 seconds? What do you find in "pg_stat_database_conflicts"? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com