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 1v5idT-00AnMh-Sy for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Oct 2025 10:40:07 +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 1v5idR-007FSQ-L2 for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Oct 2025 10:40:06 +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 1v5idR-007FSG-CZ for pgsql-bugs@lists.postgresql.org; Mon, 06 Oct 2025 10:40:06 +0000 Received: from ewsoutbound.kpnmail.nl ([195.121.94.167]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1v5idQ-000f4v-04 for pgsql-bugs@lists.postgresql.org; Mon, 06 Oct 2025 10:40:05 +0000 X-KPN-MessageId: ef33a8f4-a2a0-11f0-a27d-005056abbe64 Received: from smtp.kpnmail.nl (unknown [10.31.155.38]) by ewsoutbound.so.kpn.org (Halon) with ESMTPS id ef33a8f4-a2a0-11f0-a27d-005056abbe64; Mon, 06 Oct 2025 12:40:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=demon.nl; s=demon01; h=content-type:subject:from:to:mime-version:date:message-id; bh=DeKGjsIafaEfq4l9mWwEzBG3kEK2ti5oXIZl+WmuCpM=; b=qDfM0sKiIR6uUOf2b7zXjD6rcJ32F7nrkXvlOIl0BfQ8YpGM6ik6jbjHZ3VFubGobl82MhsKqASX7 Gr1TT8PySOK285Qt0ihGHzx7R/VprTCb32VU6VCT6A8t4BC4200Wg89hvmMw3uXIYrvbQFHKxtglxh Ohaq9y07W9vcofcySbrumukuu86kN8Vnws5gFwGcLq89bKBKMr6ZW+EikPwHBshhMHc4yPxHG3VV05 NrIi1rd+UhwKN+Gm8zg1IKoUNVIVPwAoXtNLq3QNlbt0X2aSF7KpFKaT8AOgoSc+sUkbGWUvphB0ql 9Hbn8Lw55FYcWnmjvRjJND9zZeB3HKA== X-KPN-MID: 33|lNmZmWg7xk6jFoc3/Q6HfTjVnOjOW/l1FZB8XqihUiRxlaGgtaI9ntAfp0io9EG 4xdeEkrmi5hPsK1UTy0GQ7A== X-KPN-VerifiedSender: Yes X-CMASSUN: 33|LUQ6J9t9Bes1EbvKPKUyYMU3ZCczIu5qIGg8r4D0uxjsaXdkZz4BxaARuBk/vLo CRhJCdXiqANFuNlIo9v70Lw== X-Originating-IP: 77.174.174.39 Received: from [192.168.1.35] (77-174-174-39.fixed.kpn.net [77.174.174.39]) by smtp.xs4all.nl (Halon) with ESMTPSA id d0496873-a2a0-11f0-a6c9-005056abf0db; Mon, 06 Oct 2025 12:40:02 +0200 (CEST) Message-ID: <934fc185-9583-4f03-902e-fa9f221fbea4@boeringa.demon.nl> Date: Mon, 6 Oct 2025 12:40:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-GB To: Markus KARG Cc: pgsql-bugs@lists.postgresql.org From: Marco Boeringa Subject: Re: Potential "AIO / io workers" inter-worker locking issue in PG18? Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: Norton (VPS 251005-4, 5-10-2025), Outbound message X-Antivirus-Status: Clean List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Markus, On my Ubuntu virtual machine, io_uring cannot be started. Setting "io_method = io_uring" and trying to restart the cluster, fails. It will not start, I have attempted this multiple times. Only 'sync' and 'worker' allow restarting after modifying the PostgreSQL configuration file. As I understood, the PostgreSQL binary needs to be compiled with the proper support, maybe my version on Ubuntu 24.04 that runs as a Windows Hyper-V virtual machine, doesn't have it. Although I did notice when installing PG18 from synaptic, that it installed an additional 'liburing' package or something named like that if I remember well... As to your question about Python and scheduling conflict: this is not the case. Python runs on the Windows host, not under Ubuntu inside the VM. I only have PostgreSQL installed on Ubuntu, as I use it with osm2pgsql there. I access the PostgreSQL instance via pyodbc or psycopg2 on the Windows host, so it is like a remote database server, just running on local hardware. Marco > I am not a PostgreSQL contributor and have no clue what the actual > technical details are in the new AIO code, but reading your report the > following questions came to my mind: > > * Does the failure also happen with io_mode=io_uring? If no, it is a proof that it is really bound to io_mode=worker, not to AIO in general. > * Does the failure also happen with io_mode=worker when your Python code > uses only 22 cores, and PostgreSQL uses only 22 workers (so Python and > PostgreSQL do not share CPU cores)? If no, it might indicate that the > problem could be solved by increasing the execution policy in favor of > PostgreSQL to give a hint to the scheduler that a CPU core should be > given to PostgreSQL FIRST as Python most likely is waiting on it to > continue, but PostgreSQL could not continue because the schedule gave > all the cores to Python... (classical deadlock; eventually resolves once > enough CPU cores are free to eventually finish the starving thread). > HTH > -Markus