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.96) (envelope-from ) id 1x27Hy-005axp-0M for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Sep 2026 13:15:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x27Hw-000eWS-38 for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Sep 2026 13:15:32 +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.96) (envelope-from ) id 1x27Hw-000eWF-28 for pgsql-hackers@lists.postgresql.org; Thu, 03 Sep 2026 13:15:32 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1x27Hv-00000003oEc-0QaE for pgsql-hackers@lists.postgresql.org; Thu, 03 Sep 2026 13:15:31 +0000 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-39266382df6so2128561a91.3 for ; Thu, 03 Sep 2026 06:15:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788441330; x=1789046130; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:content-type:from:to:cc :subject:date:message-id:reply-to:content-type; bh=/AkINc8rh11IuhlE03w+gjcupyumM+pZVMQpnbSEzRE=; b=S2++PoQoHQ5LSFY6GHel2j/zL+ozNVRti2ff4DvtSmQ52XoJJnUwXuLv5Sk2y2jxKL frf+lvkN/upeu7Agz7tjvrYnEmkCj1zjHMQOTyRJw6faxUMyc7sWsoiLy/B/4qT5FJPJ Yl+oFuSRJFxjPxW5kgFQ4Y3Q2mFv3UObugNl130MuxW45oq/HhXO63em7P2yUdiMbu7T S7EeHPKPvMs6+jzUPuKmIWM3GCoyhBCuAYQ4yVdIPke9K6D7Leb0GDm/NN++3jQrORwt NpZ2py9pdSlVIcxVq9L5QQ3WIfot+Lz/XbFw7G8B2pqeO6qlJBoUeN3YLOkH/XM58x6D 6tKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788441330; x=1789046130; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=/AkINc8rh11IuhlE03w+gjcupyumM+pZVMQpnbSEzRE=; b=j3EymWThAz0t0/9PMFEFYBmmnDs49QMXuQbKiwMx3+rkdyjQUITafcC1llcqCgvw3G iwAyERqk84StBDIaguXbBJl52fJkcqoXPHvcxZucPnxFzdenbe8DJ8ag9ARlIwXnx0PR juMeAh8T8/mSrUsv627lYRkWN+64WXxR+8wAj3BYIvQ/xruyzJcw5bWBWqKL1WG/g2qG hoHEUZmVNgg+HIz6INjEBlORjUx1aCV+9qxgpRq66fy0y09lmt4xbGcDLuOaDib1Sz5F 3XqPl19JZzvopzjzy6U/BlA+wCFCdRXtQ/JzaGXuLT469ddt+v1S2OEno8wDkqw2nLkP Tyfg== X-Forwarded-Encrypted: i=1; AKwUvBy0ScQ28c/LlG5B3AUALI/6t0y9YlqjJF5g5l70DyLedqD1jp2EqIx0qqPlmvGM5X0Oft4LlcmosNs9l0lj@lists.postgresql.org X-Gm-Message-State: AFuF++kjy7a9BMtfNi9BUQv+a4UUngqYU9lLvKdnq1rcU6nHQmv6KgsM BgT6E4pPkNH+V6vqX/Zeor0KOLLjTKzBu8Tr1Wuk61c8w4/wkumQ4mi2 X-Gm-Gg: AYBFou3RhEZGh4V2jd0rL1owdDqO4whRL03yfDolHJUur/M5Tw7Hl6BLFfgOgfYU58E cP4GUkRFRws63Hjtc7wqaZxc8f2C6anxERrprLi7no+OnTrCfjAqwqi8085tEm8BF3MbyoLekYJ msMESsEV9Lz+V6dmSzcY7yuTatpB21tAA6fYXqNEsFjGmar5i6xB+QlD0gNihTE6VgyAF0nH0QI my8kLh5ZBu930CWlASXcq37MhzFIB5hJKMWwhKaOUbDvt9M/tnuKcvAmmAzEpyCnYI2BkkOwKPv TyGApMNoOTGK6QBuXfbgbWGkhKczMSvTw4p/KlAY5mwSFciHbAVNQ3pcOh1CnGUGgbsOMkCEbqZ cMUTmJ0wYqpzLAwe+JWuK0UMOLMfzNvt0tXv+kn9XtyyR3ZxNQJKiy+Q6i1TJOLxVbtFcNCQwgV t4g33MuLmRgJ6RgfxSuvtIzjlPd1MmY1cTGkdzg83ZYQy247lNMxViMzI9zM94etWoTnKZq5s0d Q8EOQ== X-Received: by 2002:a17:90b:2785:b0:396:5cdc:4bea with SMTP id 98e67ed59e1d1-39aedeb83e0mr19901520a91.5.1788441329974; Thu, 03 Sep 2026 06:15:29 -0700 (PDT) Received: from smtpclient.apple ([128.14.188.158]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3325671421bsm6182631eec.27.2026.09.03.06.15.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Sep 2026 06:15:29 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.700.51.1.1\)) Subject: Re: aio: Async fsyncs for crash recovery and checkpointer From: Yuhang Qiu In-Reply-To: Date: Thu, 3 Sep 2026 21:15:15 +0800 Cc: Nitin Jadhav , PostgreSQL Hackers , Andres Freund Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Nazir Bilal Yavuz X-Mailer: Apple Mail (2.3864.700.51.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Nazir, The overall direction looks good to me. A few points: > This patch implements async fsyncs for crash recovery and checkpoints = by > using the AIO system. For crash recovery, Linux already has `recovery_init_sync_method=3Dsyncfs`= as an alternative to per-file fsyncs. I think it would be useful to include = that in the `SyncDataDirectory()` benchmark. > I will change the reopen interface so that ordinary failures return > `-errno`. Agreed. I think all AIO target reopen callbacks should follow this = convention. Relation fsyncs can hit the same problem through `smgr_aio_reopen()`, = not only SLRUs. > It uses both io_max_concurrency and the file descriptor budget to = determine > max number of available in-flight fsync I/Os. I wonder whether submitting a batch of concurrent fsyncs could cause an = I/O storm and hurt foreground I/O latency. The `max_safe_fds / 6` cap protects the `AllocateDesc` budget used by `OpenTransientFile()`, while relation fsyncs use VFDs. Should the = descriptor cap apply only to handlers that use `OpenTransientFile()`? Best regards, Yuhang Qiu