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 1m3g00-0008Nv-M6 for pgsql-general@arkaria.postgresql.org; Wed, 14 Jul 2021 14:36:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m3fzz-0003bE-JG for pgsql-general@arkaria.postgresql.org; Wed, 14 Jul 2021 14:36:31 +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 1m3fzy-0003b6-Js for pgsql-general@lists.postgresql.org; Wed, 14 Jul 2021 14:36:30 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1m3fzt-0005qQ-Th for pgsql-general@postgresql.org; Wed, 14 Jul 2021 14:36:29 +0000 Received: by mail-wr1-x429.google.com with SMTP id a13so3478631wrf.10 for ; Wed, 14 Jul 2021 07:36:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=J2SwsjI0foOBLr3FDAUyJ0CpuTVaIn6KAq71jUDQtYI=; b=uOTp83cuSwIptBnCA6OF3IHVfTNJqFsjw2SPnpvfpLa98ixFrSpZjjCiwNOu6k7sVr LIredAvalCYXWKj/yms3HSyY+J68gtL8MGP58KjnGQm+zElnMRGZoolAqmx2L/gtHzAu KGybeTPJdAGmHLUCWAjRzqrsMC62EsQJ8stkYgr2TP6V8RCePghDShyGhUuc3vIldL3/ V2NZGYEuKDgH9tHfSmpCLLDNHlN/hqqQ3NfgFmZgiTlairDn4jXgn1ukIrt84zto1/BE 5TmH7mqG3AczEY+DFn2DdcoT6mwB3zVZB138o2TZGFn3ul/KqFePw5VIOTJPuX/OTkDQ FVjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=J2SwsjI0foOBLr3FDAUyJ0CpuTVaIn6KAq71jUDQtYI=; b=HJuV+ACfWaQh3gRKEnGrFc5A7V8kcsWeNdRvFkTk8ZKJbYd4KE+DTK/GTGhxWOrkQS F/QWa+DQAUN6F49fxvShlZJ4H/3MCSEdbFQNH3ahEk9bw2mcPgN2bi6axy/jrPrTVK5u owTF0jKR8lrH4LwNc8Lb188xqDa6CiyWFzeKo1xn16HygJz8/lzmzLDoY7BIYtxhFr2E NgH2SSJ81KAFeZ2ATQ6qn6H3ze+4fFjggKRorjKgrpLKaTwwSHmlFg8zcIXZjFMHlRDA cdJk3/fWWf5fg6iTGeKpoxmBMt9JR3EcUQFZsGymxc342I0dmwJlt69PU0KiIbaHRKIi Ykcg== X-Gm-Message-State: AOAM533S/Y8/4mAZwxxjog3HWbo52Eb1a0n6Oci2aLvrbWTcZBKcb63v 3o2lh6MPgeYjkVLRJin/37eJ66KBzt0= X-Google-Smtp-Source: ABdhPJyTM5MeETTP1lgoVYmNJRp+MLPXc09blpMeXtbVUZ98cLMetyzKicMyUT2vKhZIRCAAwKrwgw== X-Received: by 2002:a5d:4bc4:: with SMTP id l4mr13284804wrt.67.1626273384079; Wed, 14 Jul 2021 07:36:24 -0700 (PDT) Received: from smtpclient.apple (ip-94-112-9-129.net.upcbroadband.cz. [94.112.9.129]) by smtp.gmail.com with ESMTPSA id k13sm3112150wrp.34.2021.07.14.07.36.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Jul 2021 07:36:23 -0700 (PDT) From: Sasha Aliashkevich Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.80.0.2.43\)) Subject: ERROR: cannot freeze committed xmax Message-Id: <8C414E45-6DD8-48E0-84B2-2D53545000D0@gmail.com> Date: Wed, 14 Jul 2021 16:36:22 +0200 To: pgsql-general@postgresql.org X-Mailer: Apple Mail (2.3654.80.0.2.43) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, Few weeks ago at one of the databases we started to observe the = following error in Postgresql logs: ERROR: cannot freeze committed xmax 572 For the note it's Postgresql 10.14 running on RHEL: version = =20 = --------------------------------------------------------------------------= -------------------------------- PostgreSQL 10.14 on x86_64-pc-linux-gnu, compiled by gcc (GCC) = 4.8.5 20150623 (Red Hat 4.8.5-39), 64-bit (1 row) Apparently it happens during the autovacuum and leads to the failing = autovacuum freeze progress. We have detected two dictionary tables where manual VACUUM FREEZE fails: = pg_proc and pg_depend. Below you can see the page_inspect results for the appropriate blocks as = well as the status of xid. Am I understand correctly that for some reason the transaction is marked = as commited while on the page level it's rolled back so the = inconsistency is detected? Could you advise how to fix it and make autovacuum work again? SELECT txid_status(572); txid_status=20 ------------- committed (1 row) SELECT ctid, xmin, xmax FROM pg_proc WHERE xmax=3D572; ctid | xmin | xmax=20 ---------+------+------ (75,19) | 571 | 572 (1 row) SELECT ctid, xmin, xmax FROM pg_depend WHERE xmax=3D572; ctid | xmin | xmax=20 ---------+------+------ (55,76) | 571 | 572 (55,77) | 571 | 572 (55,78) | 571 | 572 (55,79) | 571 | 572 (55,80) | 571 | 572 (5 rows) SELECT lp,=20 t_ctid AS ctid, t_xmin AS xmin, t_xmax AS xmax, (t_infomask & 128)::boolean AS xmax_is_lock, (t_infomask & 1024)::boolean AS xmax_committed, (t_infomask & 2048)::boolean AS xmax_rolled_back, (t_infomask & 4096)::boolean AS xmax_multixact FROM heap_page_item_attrs( get_raw_page('pg_proc', 75),=20 'pg_proc' ); lp | ctid | xmin | xmax | xmax_is_lock | xmax_committed | = xmax_rolled_back | xmax_multixact=20 = ----+---------+-----------+------+--------------+----------------+--------= ----------+---------------- 1 | (75,1) | 564 | 0 | f | f | t = | f =20 2 | (75,2) | 564 | 0 | f | f | t = | f =20 3 | (75,3) | 564 | 0 | f | f | t = | f =20 4 | (75,4) | 564 | 0 | f | f | t = | f =20 5 | (75,5) | 564 | 0 | f | f | t = | f =20 6 | (75,6) | 564 | 0 | f | f | t = | f =20 7 | (75,7) | 564 | 0 | f | f | t = | f =20 8 | (75,8) | 564 | 0 | f | f | t = | f =20 9 | (75,9) | 564 | 0 | f | f | t = | f =20 10 | (75,10) | 566 | 0 | f | f | t = | f =20 11 | (75,11) | 566 | 0 | f | f | t = | f =20 12 | | | | | | = | =20 13 | | | | | | = | =20 14 | (75,14) | 212156121 | 0 | f | f | t = | f =20 15 | (75,15) | 212156121 | 0 | f | f | t = | f =20 16 | (75,16) | 212156121 | 0 | f | f | t = | f =20 17 | (75,17) | 212156121 | 0 | f | f | t = | f =20 18 | (75,18) | 212156121 | 0 | f | f | t = | f =20 19 | (75,21) | 571 | 572 | f | f | t = | f =20 20 | (75,20) | 212156121 | 0 | f | f | t = | f =20 21 | (75,21) | 572 | 0 | f | f | t = | f =20 22 | (75,22) | 97113057 | 0 | f | f | t = | f =20 23 | (75,23) | 212156121 | 0 | f | f | t = | f =20 24 | (75,24) | 212156121 | 0 | f | f | t = | f =20 25 | (75,25) | 212156121 | 0 | f | f | t = | f =20 26 | (75,26) | 212156121 | 0 | f | f | t = | f =20 27 | (75,27) | 212156121 | 0 | f | f | t = | f =20 (27 rows) SELECT lp,=20 t_ctid AS ctid, t_xmin AS xmin, t_xmax AS xmax, (t_infomask & 128)::boolean AS xmax_is_lock, (t_infomask & 1024)::boolean AS xmax_committed, (t_infomask & 2048)::boolean AS xmax_rolled_back, (t_infomask & 4096)::boolean AS xmax_multixact FROM heap_page_item_attrs( get_raw_page('pg_depend', 55),=20 'pg_depend' ); lp | ctid | xmin | xmax | xmax_is_lock | xmax_committed | = xmax_rolled_back | xmax_multixact=20 = -----+----------+-----------+------+--------------+----------------+------= ------------+---------------- ... 75 | | | | | | = |=20 76 | (55,76) | 571 | 572 | f | f | t = | f 77 | (55,77) | 571 | 572 | f | f | t = | f 78 | (55,78) | 571 | 572 | f | f | t = | f 79 | (55,79) | 571 | 572 | f | f | t = | f 80 | (55,80) | 571 | 572 | f | f | t = | f 81 | | | | | | = |=20 ... 85 | | | | | | = |=20 86 | (55,86) | 572 | 0 | f | f | t = | f 87 | | | | | | = |=20 88 | (55,88) | 572 | 0 | f | f | t = | f 89 | | | | | | = |=20 90 | | | | | | = |=20 91 | (55,91) | 572 | 0 | f | f | t = | f 92 | (55,92) | 572 | 0 | f | f | t = | f 93 | (55,93) | 572 | 0 | f | f | t = | f 94 | (55,94) | 572 | 0 | f | f | t = | f ... (169 rows)