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 1tKa69-009WjL-A0 for pgsql-general@arkaria.postgresql.org; Mon, 09 Dec 2024 09:30: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 1tKa66-006JWR-Mw for pgsql-general@arkaria.postgresql.org; Mon, 09 Dec 2024 09:30:35 +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 1tKa66-006JWI-BQ for pgsql-general@lists.postgresql.org; Mon, 09 Dec 2024 09:30:35 +0000 Received: from mail-qv1-xf2d.google.com ([2607:f8b0:4864:20::f2d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tKa65-001q8z-2a for pgsql-general@lists.postgresql.org; Mon, 09 Dec 2024 09:30:34 +0000 Received: by mail-qv1-xf2d.google.com with SMTP id 6a1803df08f44-6d8ece4937fso20535636d6.2 for ; Mon, 09 Dec 2024 01:30:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733736632; x=1734341432; darn=lists.postgresql.org; h=content-disposition:mime-version:message-id:subject:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=UGH2OPNiJ97RlKHq7zOg+GTysh5PotUJiy83GsLDS1A=; b=J1p0WzdRU7NtdMVu0oE30Fc0y5FCEFNlDexgjl7CRk3OOHePqjSdsKMswEh8mSesOY QvMTGowcTlahKTWde17T40hORrpM9aTj5d7cQFSFn3A2lzjP1dzplJgKOnUDUmt14pzv SKDg5jTmLlLPQl882xlxsChjJjTfZ/3frQ0MhMBO07REikWERKEOJspOUQZfy+REe89a CIWThEJRP1ZgXHIQl5VLtmaQR7USLULq6SuDkdzKP59NUvRmKZVRIy+P6d68T3aRozZn nsHKfB+SdQRjV8kCxz2Tq9Du8k5LJIiVXPlRTpKkiJ4qwUecInEOFUTyXjUnrx3/qce6 VGHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733736632; x=1734341432; h=content-disposition:mime-version:message-id:subject:to:from:date :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UGH2OPNiJ97RlKHq7zOg+GTysh5PotUJiy83GsLDS1A=; b=owpB/ZypN0uSJqCLh7obnVTio5Y81dYby9bB9+PB/9u7ZJFuNlCzH6QE0DJkgKxC+a aR9DgQ7Rn9wlqw4yHWt5QKsguugcbpsWRNhENg2tK5L6wJ5nIrhgC0Iu3kkkVgfA71Nn AcRd+wi0Nk0q98BKtI1Ac05M4LLbbgdsvxOdchDN5vx9wDPuJXYsdwp9GsNVuam8Mobm pTu4xMpYXDCF4Qk0DQouAuYU02B0gCqzrq15SWh7Y6OiwsNM8t3KB7JYwnv6As7sRSSy R/cY3RJJlQQRdSaUfTVlQ5WHcieLoljbrD7jnIL4aIfSaA2KWslPls6Pn8334F24qDQA 3Xmw== X-Gm-Message-State: AOJu0YxsGGS6++v0xaybMpd3bxsRcqS3BTQXkQsUutelTQENhhACh/6Q kFJeiPy0gXLjwsmVldCvjvqZu0Fg9CChukYiYYIQ6QCvjyg4XJ1JuPC2neEm X-Gm-Gg: ASbGncuFb4s7F11/2O9nI5zAvcMtlDQcY7y2mkHksDotSI5Qyfaig9LKnLc3RNdG7rd zqSM/FQGiSAzpulHEd3zZgdczjT01HFmjq7rq8v/Yt2phxPTQY0nAaUHynEz72gMRdhb4TII5Kf AvjySreEuppUZh4BooIohgHQogb1dPIhtJeRHhH9kUGRdqqzpTpmxYgf2ZyH8wyhr+wv+U5U2zi PmoZ4bU536EF9/jCOOLSSdRYFopr7A/nrFdvHfc2S/Z22oXR/2Vq/WrfodKimshWAVXkfIS+lTm X-Google-Smtp-Source: AGHT+IFS6V1gbHdVE01nICC91+zUpy5MEjS2y8YjPhhlMcWs3ZX2jU6QsWenu2B+GzYQsY6xG2tfBQ== X-Received: by 2002:a17:90b:350f:b0:2ea:3f34:f190 with SMTP id 98e67ed59e1d1-2ef6ab103d3mr15791366a91.25.1733704960415; Sun, 08 Dec 2024 16:42:40 -0800 (PST) Received: from dev.null (d23-16-179-220.bchsia.telus.net. [23.16.179.220]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ef85961f22sm3577748a91.35.2024.12.08.16.42.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Dec 2024 16:42:40 -0800 (PST) Sender: Will Storey Date: Sun, 8 Dec 2024 16:42:38 -0800 From: Will Storey To: pgsql-general@lists.postgresql.org Subject: Cancelled query due to buffer deadlock with recovery Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello! I am running Postgres 16.6 on a primary and several standby servers. I recently observed 3 queries being cancelled with this error: ERROR: canceling statement due to conflict with recovery (SQLSTATE 40P01) There was this detail with the error: User transaction caused buffer deadlock with recovery The standbys have hot_standby_feedback=on and max_standby_streaming_delay=1min. As far as I can tell, there were no long running transactions at the time on either the primary or the standby in question. I did not see any replication delay according to monitoring. The queries that were cancelled were reading catalog tables - pg_inherits joined with pg_class. I typically expect them to complete quickly (they have a 100ms statement timeout). I understand that canceling due to conflicts should be expected when using hot standbys, but I'm struggling to understand why it happened in this case. What do you think? Thank you! Will