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 1u4kZs-006oEI-Gv for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Apr 2025 18:00:09 +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 1u4kZq-00EZjC-QB for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Apr 2025 18:00:07 +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 1u4kZq-00EZj3-Dw for pgsql-hackers@lists.postgresql.org; Tue, 15 Apr 2025 18:00:07 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u4kZn-000Fo3-2h for pgsql-hackers@postgresql.org; Tue, 15 Apr 2025 18:00:06 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4394a823036so58799725e9.0 for ; Tue, 15 Apr 2025 11:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744740004; x=1745344804; darn=postgresql.org; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=X7hOdXiWj1d+Wr0Yaj/LQP+LRaEidKaJwGxDJ1wLZ9E=; b=ZWTfQng0wC/ybtRhh+wDeWHJP+cPW0ayZ9vZL+1ZTFpuJs5kSRx6fkYLozgmQM9Zrk n/RzlAlM2IhhJe6OQDG9li4iw78uoZ8W0hYWy/urnDPFRiFfkyINByUeSUT+wAGPRsiX 6OQW3fN4S67HP7fcW0cyhLClFqEgmMYBZcMOa7UW6lzNI7OnvBvF8SWUsXHPTpaQW5JI F523mbb4nQ9woJCpQLo28MX0N41PcYKTmNd6npPpuJlLYz1nFtBvvpyWTAoYwgJACrTt r+VaGH68KM996lRwB6b1ibdbfumwfkDvFeUH/MzaEKgD9QvLjbLCI/U4DvYnIF0g3K6B 6Bvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744740004; x=1745344804; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=X7hOdXiWj1d+Wr0Yaj/LQP+LRaEidKaJwGxDJ1wLZ9E=; b=p4tfdQJAon0qq1W6+Cbr+ylhehYoLpCHoRNKwUxXLI1FboTL1xrQRgznrCjrhEGKY7 3OoFOBQ57aJfHcs0dhn2ArJSILh+hhwGT+WSqhhXhiRmQQ3eFXl1vtXDphLR3UHhtm5P 9yAZDLjOFSOwAG+4Wey0XDh8f1d+yAvARHE106GAZnvVRcAsFc++xpRivwrakYzoihT1 17yICV+9GsREvi2gWpRcWVbuM+Sw6NHKtDOoGULd+1x5aBJRx5vr5ZpslsiP5CKXMHf6 sU58G0JEPWbdoS5YaN9yCjADkjrMLIK7lR37sjyNWlL38w+DGRs1e0+J6uTSW3y3XvTe 9L5Q== X-Forwarded-Encrypted: i=1; AJvYcCXjyDMSLQdSXCkKw99fr5COjpPNAoT4R2KWZIOoh0SAgReghwaPEuAGr6LtsYv5GtYqzlaFSam6hluS+rdR@postgresql.org X-Gm-Message-State: AOJu0YzV7bhJJE1bMk0v0QZF5hLur9/BhXGPWQ1dpVu92zmdrNrYxTqV AyqK57SYLiU1/z52rL2wdd9EdsiXKOtt1MTtZoo23cwNUOWhet2C X-Gm-Gg: ASbGncs9MeDMUzcDMzQJj9agWVo0/xx79/dFPlumX+tX5cuD2v0AtuZso8j4OWzPd2C +u2wlM2n7hXZYLO+lFbMgWJsHeSDokbvHfNFz96SrWV3j5YQ1pG5td3bqZGohtLbSFP5WUydKiD vQqu5dZsX1YOm8v6RKzUzx9eEcL99Sx0Gvotoy5cVgDdg6VE84pRKJxjXacUq1Vzy7lSYETDC2W AQKMoKXL/aBGx2ptQxI5Ru6wauyUKXEUKQRvzcf0vkwimdyzNTgtx4LpBAEmZgP+aCKWzeID5Y2 y3EvWc30nyvLc03rrze8YbpepowHAcH7f/5k7bYQR0M= X-Google-Smtp-Source: AGHT+IG2X8aRL9KGqvWMJaGddrC+PHzsqDxrdcVhiMHtlXXFBbgGWgI8ElU1M4qlhgCRZzOqPyV1YQ== X-Received: by 2002:a05:600c:314c:b0:43e:b027:479a with SMTP id 5b1f17b1804b1-4405a0267a5mr830645e9.16.1744740003311; Tue, 15 Apr 2025 11:00:03 -0700 (PDT) Received: from [192.168.0.50] ([89.149.68.176]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43f23572bb2sm216651035e9.29.2025.04.15.11.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Apr 2025 11:00:02 -0700 (PDT) Content-Type: multipart/mixed; boundary="------------zUv965TAP1ScgB0a1xQ0eC64" Message-ID: <062daca9-dfad-4750-9da8-b13388301ad9@gmail.com> Date: Tue, 15 Apr 2025 21:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: AIO v2.5 To: Andres Freund Cc: Noah Misch , pgsql-hackers@postgresql.org, Thomas Munro , Heikki Linnakangas , Robert Haas , Jakub Wartak , Jelte Fennema-Nio , Antonin Houska References: <20250401151159.51.nmisch@google.com> <20250402001324.e4.nmisch@google.com> <3fhulsvzks4khqahl6tngcnuda7pyrrl7223tmjh2x2spralm3@iisldh6pcowy> <8160688e-db8e-4d7d-a7e7-ff366adf9717@gmail.com> <4nervqmqplfr23jrjvkp5tsumi6qgouhgjqlubf7ujrudw2epb@6mszddainl4u> <6a6756a0-bad5-4ee5-a591-c763af289940@gmail.com> <96abefe8-fa72-41f5-8840-0517125c24e3@gmail.com> <4qk3ehe6w7x7hfrldei2hefjcb7v7nfmj2owl2ir64craqcapz@kbrao22ljxeb> Content-Language: en-US From: Alexander Lakhin In-Reply-To: <4qk3ehe6w7x7hfrldei2hefjcb7v7nfmj2owl2ir64craqcapz@kbrao22ljxeb> 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. --------------zUv965TAP1ScgB0a1xQ0eC64 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hello Andres, 14.04.2025 19:06, Andres Freund wrote: > Unfortunately I'm several hundred iterations in, without reproducing the > issue. I'm bad at statistics, but I think that makes it rather unlikely that I > will, without changing some aspect. > > Was this an assert enabled build? What compiler and what optimization settings > did you use? Do you have huge pages configured (so that the default > huge_pages=try would end up with huge pages)? Yes, I used --enable-cassert; no explicit optimization setting and no huge pages configured. pg_config says: CONFIGURE =  '--enable-debug' '--enable-cassert' '--enable-tap-tests' '--with-liburing' CC = gcc CPPFLAGS = -D_GNU_SOURCE CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -O2 Please look at the complete script attached. I've just run it and got: iteration 56 (jobs: 44) Tue Apr 15 06:30:52 PM CEST 2025 dropdb: error: database removal failed: ERROR:  could not read blocks 0..0 in file "global/1213": Operation canceled 2025-04-15 18:31:00.650 CEST [1612266] LOG:  could not read blocks 0..0 in file "global/1213": Operation canceled 2025-04-15 18:31:00.650 CEST [1612266] CONTEXT:  completing I/O on behalf of process 1612271 2025-04-15 18:31:00.650 CEST [1612266] STATEMENT:  DROP DATABASE db3; I used gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0, but now I've also reproduced the issue with CC=clang (18.1.3 (1ubuntu1)). Please take a look also at the simple reproducer for the crash inside pg_get_aios() I mentioned upthread: for i in {1..100}; do   numjobs=12   echo "iteration $i"   date   for ((j=1;j<=numjobs;j++)); do     ( createdb db$j; for k in {1..300}; do         echo "CREATE TABLE t (a INT); CREATE INDEX ON t (a); VACUUM t;               SELECT COUNT(*) >= 0 AS ok FROM pg_aios; " \         | psql -d db$j >/dev/null 2>&1;       done; dropdb db$j; ) &   done   wait   psql -c 'SELECT 1' || break; done it fails for me as follows: iteration 20 Tue Apr 15 07:21:29 PM EEST 2025 dropdb: error: connection to server on socket "/tmp/.s.PGSQL.55432" failed: No such file or directory        Is the server running locally and accepting connections on that socket? ... 2025-04-15 19:21:30.675 EEST [3111699] LOG:  client backend (PID 3320979) was terminated by signal 11: Segmentation fault 2025-04-15 19:21:30.675 EEST [3111699] DETAIL:  Failed process was running: SELECT COUNT(*) >= 0 AS ok FROM pg_aios; 2025-04-15 19:21:30.675 EEST [3111699] LOG:  terminating any other active server processes >> I reproduced this error on three different machines (all are running >> Ubuntu 24.04, two with kernel version 6.8, one with 6.11), with PGDATA >> located on tmpfs. > That's another variable to try - so far I've been trying this on 6.15.0-rc1 > [1]. I guess I'll have to set up a ubuntu 24.04 VM and try with that. > > Greetings, > > Andres Freund > > > [1] I wanted to play with io_uring changes that were recently merged. Namely > support for readv/writev of "fixed" buffers. That avoids needing to pin/unpin > buffers while IO is ongoing, which turns out to be a noticeable bottleneck in > some workloads, particularly when using 1GB huge pages. Best regards, Alexander Lakhin Neon (https://neon.tech) --------------zUv965TAP1ScgB0a1xQ0eC64 Content-Type: application/gzip; name="repro.tar.gz" Content-Disposition: attachment; filename="repro.tar.gz" Content-Transfer-Encoding: base64 H4sIAO6K/mcAA+1VbW/bNhDuZ/6Km+fGNjJZkuM0WRwFcBsnDZDVgeIB6ydFFmlbtkQqfImb oT++pxfbShqsn4phQw6wSD53Rz48Pq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