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 1sPfje-005jZ3-Rg for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Jul 2024 10:00:10 +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 1sPfjc-008NQb-Tx for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Jul 2024 10:00:09 +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 1sPfjc-008NQT-G5 for pgsql-hackers@lists.postgresql.org; Fri, 05 Jul 2024 10:00:09 +0000 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sPfja-000VvY-4c for pgsql-hackers@postgresql.org; Fri, 05 Jul 2024 10:00:07 +0000 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-52e9b9fb3dcso1665496e87.1 for ; Fri, 05 Jul 2024 03:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720173604; x=1720778404; darn=postgresql.org; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=psiqWwlFFBAEpM8QiI6UGk5YhwRklLcKO+P8q6KzWEo=; b=SlO7/YhL+ojvAgDlbUSoDOzB2RnN/zv9LeKbmk7HsxGPmnAh62sgug6vcjn4vYNxDE xCafCnVPap4qOHMlVTl/yFl+pRfDs9zbTF7Oz1RWr2gpy9nWWVR3AvF2CZaFBjSwC3f0 gs/noR6TVi+6y+47MaC3/uBRrI7tmZ3eqBb0FUenfzBNFdImRHMdtieIcL5hLqjfkwnf t1TrnmBrpfoA0EbX8CDl0dD2Y2abJuX1J+ZbGdUwX9qPpihoscBHDy6I2nwh0pK2seAM JtU4SaL35s4qY7CaT0okRJ8ce4tZSn/Dam9ixP5lVXOA+cVQWpMErZk+lm4TA8q9pzC4 S5wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720173604; x=1720778404; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=psiqWwlFFBAEpM8QiI6UGk5YhwRklLcKO+P8q6KzWEo=; b=a/mVP249uDf5Jf36Eko2+WbHlEZcnfHSKq8L2ZGCKAIUsGDR1Pi+WbtHZvGpcua8tX H1P+iJFCDWIU6LreOPOcOhDSWlmUwRNjNvOXD2m43qJQEzkW19uXIjRcQ29aNgf+TrIO wWNfaap3YfciMh+lrn4JUix3I7vb7UzOkndA63g/6RQnvPPBdXNrEQF1dtQQ/nnsRFbD 1iopt/vy6ay+CAFabsPEt/vDXNmB2gRYGmSYEUMYRD+VLYYWVlWCFLunAw/r7zCjhga3 7RLWnKUVrk6q4tbURKt2cOp0WgyLvlIl7jqWryXR1orYeIIXO9rZJeKSP2/ZwSoUfJmi F8Ig== X-Forwarded-Encrypted: i=1; AJvYcCX6D//Qi9VBEQua27pLVja5UVCVgT+f8lUT5thOYNlQrKcJ69+5poOpBVj9KTIaqePS1VA0NbQqc8z2SzV4mzau+DiSQRcOr/XMIPrY X-Gm-Message-State: AOJu0Yyx9x9l7QZnfyv8V9lWHrKSRbYGNjIiMHdHUNwbTUIqNt7B2WtY RMcN4hJ4KpCdOIM1mouvythRZYHNjEFYIKSims3ivVG/BOCTq6dt X-Google-Smtp-Source: AGHT+IF8ZkH5xrwNIdeWbfrKVzArmYjk/TfnR6uFQ1w8KYZiafK69HEeEROZ5CMpCEcABuq7XLGYYQ== X-Received: by 2002:ac2:48b8:0:b0:52c:d904:d26e with SMTP id 2adb3069b0e04-52ea062e377mr2772193e87.21.1720173602945; Fri, 05 Jul 2024 03:00:02 -0700 (PDT) Received: from [1.0.0.7] ([178.155.22.46]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52e7ab0ba68sm2751619e87.30.2024.07.05.03.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Jul 2024 03:00:02 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------HZpJ48Q0Rkikdk25H0Jocer0" Message-ID: <2b319458-63f4-1396-f23e-b8353acfa2aa@gmail.com> Date: Fri, 5 Jul 2024 13:00:01 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: BUG: Postgres 14 + vacuum_defer_cleanup_age + FOR UPDATE + UPDATE Content-Language: en-US To: Andres Freund Cc: Heikki Linnakangas , Andrey Borodin , Michail Nikolaev , Thomas Munro , Matthias van de Meent , PostgreSQL Hackers , Jakub Wartak , Mark Dilger References: <20230108002923.cyoser3ttmt63bfn@awork3.anarazel.de> <20230108030956.5q6ptk3boeisibjq@awork3.anarazel.de> <20230204105703.gt2j47vdn3s2gylt@alap3.anarazel.de> <20230206210205.uaaoe2l26fv256hs@awork3.anarazel.de> <20230309001558.b7shzvio645ebdta@awork3.anarazel.de> <20230311232226.fm442j4odhixy75p@awork3.anarazel.de> <20230311234121.qnlxuzijeqdxmzu2@awork3.anarazel.de> From: Alexander Lakhin In-Reply-To: <20230311234121.qnlxuzijeqdxmzu2@awork3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------HZpJ48Q0Rkikdk25H0Jocer0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hello Andres, 12.03.2023 02:41, Andres Freund wrote: > CI now finished the tests as well: > https://cirrus-ci.com/build/6675457702100992 > > So I'll go ahead and push that. As I mentioned at [1], `meson test` fails on Windows x86 platform during the test pg_amcheck/004_verify_heapam (I'm using VS 2022 Version 17.9.7): meson setup build --wipe -Dcassert=true cd build & ninja & meson test ... postgresql:pg_amcheck / pg_amcheck/004_verify_heapam ERROR             6.95s   exit status 25 004_verify_heapam_test.log contains: TRAP: failed Assert("FullTransactionIdIsNormal(fxid)"), File: "../contrib/amcheck/verify_heapam.c", Line: 1915, PID: 2560 2024-07-04 20:56:54.592 PDT [9780] LOG:  server process (PID 2560) was terminated by exception 0xC0000409 2024-07-04 20:56:54.592 PDT [9780] DETAIL:  Failed process was running: SELECT v.blkno, v.offnum, v.attnum, v.msg FROM pg_catalog.pg_class c, "public".verify_heapam(     relation := c.oid, on_error_stop := false, check_toast := true, skip := 'none'     ) v WHERE c.oid = 16438 AND c.relpersistence != 't' `git bisect` for this anomaly pointed at 4f5d461e0. (I couldn't compile Postgres on that commit, but with `git show 53ea2b7ad | git apply` (see also [2]) it's possible.) The Assert in question is:     else         fxid = FullTransactionIdFromU64(nextfxid_i - diff);     Assert(FullTransactionIdIsNormal(fxid)); It was not clear to me how it comes out that fxid is not normal, until I looked at the disassembly:     else         fxid = FullTransactionIdFromU64(nextfxid_i - diff); 751812D2  sub         ebx,eax 751812D4  sbb         edi,edx     Assert(FullTransactionIdIsNormal(fxid)); 751812D6  jne         FullTransactionIdFromXidAndCtx+0E6h (751812F6h) 751812D8  jb          FullTransactionIdFromXidAndCtx+0CFh (751812DFh) 751812DA  cmp         ebx,3 751812DD  jae         FullTransactionIdFromXidAndCtx+0E6h (751812F6h) 751812DF  push        77Bh 751812E4  push        offset string "../contrib/amcheck/verify_heapa@"... (7518C4A4h) 751812E9  push        offset string "FullTransactionIdIsNormal(fxid)" (7518DB04h) 751812EE  call        _ExceptionalCondition (75189FFEh) The same code fragment for your convenience: https://ideone.com/8wiGRY Could you please look at this? [1] https://www.postgresql.org/message-id/72705e42-42d1-ac6e-e7d5-4baec8a0d2af%40gmail.com [2] https://postgr.es/m/17967-cd21e34a314141b2@postgresql.org Best regards, Alexander --------------HZpJ48Q0Rkikdk25H0Jocer0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Hello Andres,

12.03.2023 02:41, Andres Freund wrote:
CI now finished the tests as well:
https://cirrus-ci.com/build/6675457702100992

So I'll go ahead and push that.

As I mentioned at [1], `meson test` fails on Windows x86 platform during
the test pg_amcheck/004_verify_heapam (I'm using VS 2022 Version 17.9.7):
meson setup build --wipe -Dcassert=true
cd build & ninja & meson test

... postgresql:pg_amcheck / pg_amcheck/004_verify_heapam        ERROR             6.95s   exit status 25

004_verify_heapam_test.log contains:
TRAP: failed Assert("FullTransactionIdIsNormal(fxid)"), File: "../contrib/amcheck/verify_heapam.c", Line: 1915, PID: 2560
2024-07-04 20:56:54.592 PDT [9780] LOG:  server process (PID 2560) was terminated by exception 0xC0000409
2024-07-04 20:56:54.592 PDT [9780] DETAIL:  Failed process was running: SELECT v.blkno, v.offnum, v.attnum, v.msg FROM pg_catalog.pg_class c, "public".verify_heapam(
    relation := c.oid, on_error_stop := false, check_toast := true, skip := 'none'
    ) v WHERE c.oid = 16438 AND c.relpersistence != 't'

`git bisect` for this anomaly pointed at 4f5d461e0.
(I couldn't compile Postgres on that commit, but with
`git show 53ea2b7ad | git apply` (see also [2]) it's possible.)

The Assert in question is:
    else
        fxid = FullTransactionIdFromU64(nextfxid_i - diff);

    Assert(FullTransactionIdIsNormal(fxid));

It was not clear to me how it comes out that fxid is not normal, until I
looked at the disassembly:
    else
        fxid = FullTransactionIdFromU64(nextfxid_i - diff);
751812D2  sub         ebx,eax  
751812D4  sbb         edi,edx  

    Assert(FullTransactionIdIsNormal(fxid));
751812D6  jne         FullTransactionIdFromXidAndCtx+0E6h (751812F6h)  
751812D8  jb          FullTransactionIdFromXidAndCtx+0CFh (751812DFh)  
751812DA  cmp         ebx,3  
751812DD  jae         FullTransactionIdFromXidAndCtx+0E6h (751812F6h)  
751812DF  push        77Bh  
751812E4  push        offset string "../contrib/amcheck/verify_heapa@"... (7518C4A4h)  
751812E9  push        offset string "FullTransactionIdIsNormal(fxid)" (7518DB04h)  
751812EE  call        _ExceptionalCondition (75189FFEh)

The same code fragment for your convenience:
https://ideone.com/8wiGRY

Could you please look at this?

[1] https://www.postgresql.org/message-id/72705e42-42d1-ac6e-e7d5-4baec8a0d2af%40gmail.com
[2] https://postgr.es/m/17967-cd21e34a314141b2@postgresql.org

Best regards,
Alexander
--------------HZpJ48Q0Rkikdk25H0Jocer0--