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 1mxKlb-0001SK-3k for pgsql-general@arkaria.postgresql.org; Wed, 15 Dec 2021 03:15:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mxKlZ-0006wd-F0 for pgsql-general@arkaria.postgresql.org; Wed, 15 Dec 2021 03:15:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mxKlZ-0006wU-3H for pgsql-general@lists.postgresql.org; Wed, 15 Dec 2021 03:15:41 +0000 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mxKlR-0000m4-94 for pgsql-general@postgresql.org; Wed, 15 Dec 2021 03:15:39 +0000 Received: by mail-qk1-x731.google.com with SMTP id d21so11460184qkl.3 for ; Tue, 14 Dec 2021 19:15:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=EXVQxhJav6GVEhfDeTLNqf6ZtetpsiuNwHUOI/gL/6w=; b=Z7FIDF1vZSO3XLnPhOh3eQWZEr+AbDxwGzhJDAnNZ7geAQ1swebxA1UD1yn4FwrVQT 9J2cnr0IpdDRnDefw6SWCSilBc7SvcmYNfTYoZexZTNcDVgFcg2Yfj3Exv5nwK+c0CMX NPjaM7nNpNyM1h2G9B+kw7NJQKx2yOx/RtamAW64hXwSc4MGG+u6j8CbyuLojTjjHIkt 30Qv8tWij8122iVnG4g8gIbmctojfHSKo+ROOZEk8I7oxjUHGT+zuzx3Buvno7TzzF09 qX7qAyg38DGnoUVOFxqOQz8lcF5MjrKsz2ds3Z2Kpx8g5v3WXiTsBr5UFI8E7Ixulm3l hgKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=EXVQxhJav6GVEhfDeTLNqf6ZtetpsiuNwHUOI/gL/6w=; b=GAbSm0AvTaJ91OCZxc2e8SCYmhnHLnRiu4gVmdmkbvv10O4GOuamvrQjZA61juKCh2 l1RsQu269giJ9+1DUyF5dsgbFI8R/sHc/fYoWRMzQQZhVpvA2l3FaXePMMqX1Tp0FJt6 u7YRnyt5SFZ321ii+pv7vsdxcKMEi2gK9zpWdDZHu8wXZ4sndF5v+F90ZGhcoALLEGh0 FT9C7tmmWaBKocnnHWRKtVjaEwtqBa9xF5JZ0jE517aaVCn0i39/7ayY/ssCLHasMfrC H/ioRkh5CFCVzmi6rIA+kakS2I4kbHEG65FhrjAAzTt0o5eO6IFAkjz04d8po7x3a2kn t1BA== X-Gm-Message-State: AOAM531tq/SbQpnRkfT4xjY0vxkI8kEYtgdKVX7JVmvYXQuCiKgXNxfn tTxmafqMT7M7daS1ywG+KmDXeHQzs2s= X-Google-Smtp-Source: ABdhPJyBhqzZBczuGFhqyMKpxG0Tfi2O962vrxEgQkkRY6AcgjeCHb7r7taWM4ZXLVlMdyVIv5nQFA== X-Received: by 2002:a05:620a:2910:: with SMTP id m16mr7291696qkp.616.1639538130768; Tue, 14 Dec 2021 19:15:30 -0800 (PST) Received: from smtpclient.apple (r186-49-58-186.dialup.adsl.anteldata.net.uy. [186.49.58.186]) by smtp.gmail.com with ESMTPSA id x25sm395119qkf.91.2021.12.14.19.15.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Dec 2021 19:15:29 -0800 (PST) From: =?utf-8?B?TWFydMOtbiBGZXJuw6FuZGV6?= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.20.0.1.32\)) Subject: Reindex "locked" standby database Message-Id: <6C5D7205-487C-4AED-93AC-FBE042F51FC9@gmail.com> Date: Wed, 15 Dec 2021 00:15:27 -0300 To: pgsql-general@postgresql.org X-Mailer: Apple Mail (2.3693.20.0.1.32) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello pg hackers! Today we had to run a `REINDEX table CONCURRENTLY my_table;` in our = production database due to considerable index bloat. We used to deal = with this problem in the past by using pg_repack but we stopped using it = because our data replication tool doesn=E2=80=99t support =E2=80=9Cre = creating=E2=80=9D tables in the way that pg_repack does it (we are using = Fivetran). The reindex went fine in the primary database and in one of our standby. = The other standby that we also operate for some reason ended up in a = state where all transactions were locked by the WAL process and the WAL = process was not able to make any progress. In order to solve this issue = we had to move traffic from the =E2=80=9Cbad=E2=80=9D standby to the = healthy one and then kill all transactions that were running in the = =E2=80=9Cbad=E2=80=9D standby. After that, replication was able to = resume successfully.=20 I=E2=80=99m just trying to understand what could have caused this issue. = I was not able to identify any queries in the standby that would be = locking the WAL process. Any insight would be more than welcome! We are running pg12 in our cluster and standbys are replicating using = physical replication lots. Best, Mart=C3=ADn=