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 1uIOzO-003s8L-0m for pgsql-admin@arkaria.postgresql.org; Fri, 23 May 2025 09:46:54 +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 1uIOzM-000ccq-M9 for pgsql-admin@arkaria.postgresql.org; Fri, 23 May 2025 09:46:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uIOzM-000cca-AB for pgsql-admin@lists.postgresql.org; Fri, 23 May 2025 09:46:52 +0000 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uIOzJ-000Vh7-2T for pgsql-admin@lists.postgresql.org; Fri, 23 May 2025 09:46:51 +0000 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5fff52493e0so10677861a12.3 for ; Fri, 23 May 2025 02:46:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1747993609; x=1748598409; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=0GZn7SrW6Wm94xlsNg9EZ8lYICWRH9cNoEfUhWcu7t8=; b=sGLyyGyPQkzN/WuM9jXtvnAzXo5dGmk1+D2+5gW64vPoIAPHy75naKG/oOh51c2wJa 7FEu9plb1tUu8IthZAwzySk4d5m82iGeU8jR+rCYxlA3e/meFrsiplmxGO15umsmmkkw P43tkdYnBiXX90UZKXI3k/qAaeeVvDsacqVtQuGhQvKBKDcFi1T3VhZr5ysQMXj77ezt wfttvAVZs8c03ELm6W6dojTmStNdOnaZdh0V11Il7lS8p3GUdOdI8vMkj3CciSl6Yo5G OhKtl3v6Z8zyX+09glG3i25qFtiPzGNgN/aVMB6wjV6K5amntzkCQpm5vTNs83rurRdE qy/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747993609; x=1748598409; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=0GZn7SrW6Wm94xlsNg9EZ8lYICWRH9cNoEfUhWcu7t8=; b=ROgMs9ruexaAex+xdJW9ttBPYfHweGPdVJP0f3ZMj+L6EfIUu6T2KLWulMFpY/LUOU qYXmNUTfR5A6NOpp3eVjLa8ZvStzDm8udnczsQokAvKmmuB8JgZobRqDVjLNM3a1WsM8 OIMtmGNCNF0YQhHfMWA3Wnxr9YjGG6BsB9vRSLUJ9WsF8IreLdbtxc5YvDpeH5krzevJ gXz5VW/HhcEkeyRcG/gl0tZ7HW/Kbog9Yj2lxD28mmD4HPDAZ2BNm7UynSpQo2ZrQtYv 9llmePSzsHLlsViGtwSdJimXJ5rU/AGvApaLAuL2lZ9TRUTEooY/ak4Oe2Z/POKeBY24 M5Bg== X-Forwarded-Encrypted: i=1; AJvYcCWOxaLRvG2Q4VNiFjqkR3astXXbEk9XWNIvdVR5QFNlUuMqabfBmxrrFxzUC2UkqP3+QDU2sKm0pmTWHA==@lists.postgresql.org X-Gm-Message-State: AOJu0YwGuxQlNrWg0tolyI4KCaI7L3txanzpKbWbLwIjVUoiy3WEpv2i l3ybLsXI0TbeX8wcIGC1kuJV0aEJ/J3dXP9uYURKmhr8VLFCHi/RK38U8rxV1AraSt7LExB7amW aApcp X-Gm-Gg: ASbGnctlQoUguL2+L4gLzBEwLFz11L9ti3+IfLV3mRjNV6aIuWdhaHciUhXUQcTIkKB VEI1Je+FY2xpgUD7xjU85sP5Ca4ZUUOI3zHvFXy8LtJtbfQkmjVjQyFvxxnuq/aGnQrq8ubeybf Dow6Y3iptkU+VA15Xn/E03TyrTe2xX14oO+nmU5iuKF7tu2FZm5cmTS8iinr8LY3bF3Zx07eE4a dZPTub5SVxzfpFjKSaPjmx7skGPpZ5CyrqUDBXCc65Emj07ch44Pcb2TahdD7lE+4ZzU7CHCPCp XA/lQ7cXct84jnecf62KhHTsUzZL5DNHdhuXBLwU29cncHjjbYY/hnmN5na/prvMVCULCip8bJW gqIBS X-Google-Smtp-Source: AGHT+IFvw9Ehpyg1liBvXbLHAVpwShoo0j5IWNMp8xaozTjL+vcvivolZkahD9PjoRb/seIsVIxt2Q== X-Received: by 2002:a50:d00a:0:b0:601:7a58:4b0f with SMTP id 4fb4d7f45d1cf-6017a584ef5mr17724886a12.18.1747993609060; Fri, 23 May 2025 02:46:49 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:5e:6c9b:73f5:6897:6da1:73ea]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6005a6e745fsm11942529a12.48.2025.05.23.02.46.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 May 2025 02:46:48 -0700 (PDT) Message-ID: <0903948da238870688d6a52bab616319947231c4.camel@cybertec.at> Subject: Re: Replication lag From: Laurenz Albe To: Wasim Devale , pgsql-admin , Pgsql-admin Date: Fri, 23 May 2025 11:46:48 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.1 (3.56.1-1.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2025-05-23 at 12:43 +0530, Wasim Devale wrote: > Reply wal and query execution on replica can coexists? Yes, you can have both. But there is the possibility of replication conflicts, which can either delay replay of the WAL or lead to cacneled queries on the standby. To see why this is unavoidable in some cases, consider the following scenario: - on the standby, there is a long-running query on table A - on the primary, somebody executes "DROP TABLE A" The change gets replicated to the standby, but it clearly cannot be replayed while the query is still running. Yours, Laurenz Albe