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 1tx6wS-0031c5-MA for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Mar 2025 16:15:52 +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 1tx6wQ-006Rde-Mk for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Mar 2025 16:15:50 +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 1tx6wQ-006RdW-Cy for pgsql-hackers@lists.postgresql.org; Tue, 25 Mar 2025 16:15:50 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tx6wO-0016oK-1A for pgsql-hackers@postgresql.org; Tue, 25 Mar 2025 16:15:50 +0000 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-227d6b530d8so44408925ad.3 for ; Tue, 25 Mar 2025 09:15:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1742919346; x=1743524146; darn=postgresql.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=N5Pw7p695VxIQYU5nyrzDQtUiI03gfx3bXlNnMrb08k=; b=A1MHctSkKrQ2WLZyaIkCfiUUn6AfBiq4U9uGtwOL3nBy3GOmSIRqONfR+Si+RWeupx xWHES/9XBFbQh1r377XfWdZdUZztCqO+A7LMGclnzUT0rM/U/4YGQPPqq7eXQJ43oUFw XzzP9b++SyljfBK2X9RYV08hC94E1f7+AkRKI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742919346; x=1743524146; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N5Pw7p695VxIQYU5nyrzDQtUiI03gfx3bXlNnMrb08k=; b=OIJW+vw4fRciSHQDI1i3WWD7v/cKiMYJWkflYvfgD4k/SzFWhvNKaEkxX3p3fdFTyR xR5iRyncNccu/MUl0Zx3bGrkYzBDpCRS32ZaeAG+U5yGoESF/+WsXMLkU9RRJempElZD jp8wg7bsyod5jxsTcH0u7DeGmg9Mc8ORQ610Q0W59vTZFaWs+2R/KUsoAFjZvXyo5qx9 xlj199D1RTzDPCZmELle/CiNc4QgeTtosj8HheyFy770RS4gkN8QgKBA0jE4UF8syQ81 2HYrPltVk5LOpaKP5KGp7SurSdTIXqPeHMY3Un9qhKC94OxVu7Opq8JRLzpRobZpB58B q15w== X-Forwarded-Encrypted: i=1; AJvYcCUmvb3CSikxugLY8nijDifV0It/CGsMN+vcKE19coaa3sdrwvH5lvNPjUkdLQx+B0PBVBtOW6tuWirctBym@postgresql.org X-Gm-Message-State: AOJu0YwgaePuYv1C0ezVUCZ8+Uf3EMpwSyQcTHIj3YDJauDcWFd5FueY Bix3bir4FpCSCyfT9whusjoaOiJ6g+qYAPs9MpMxors4RRmbo8j8gJuSNQNJbA== X-Gm-Gg: ASbGncs/BRYhGzwe5V8QOEeSAlzALmEyYE3CVnNMjLlGT38s43G+ecuhpyLkgpvplT2 szB/zC6grPBgJVAQw1cK3iB0HG1eeQn1m7jYRwYk0sd0rcgN33q3fWtjHT3FptMCxC3bSR+K1tZ 2Qp30gyNiEJCOFIrUa5GxeFqxN4fogphUCfzQ+rDPK51hyWx52DqBj4jQw5zEVnV0k6iJUZVVuf Jqus2VGWYaH93VQsR2Kvrdt4RbR2vHjBQU/tNhCDJfoC5+6xTqTFOmFj7QTt7Km4Vbpus3r09HV c8Gom/3rNdhj53tfQa6OM9eMV12AWluOJzj6o/01Jw== X-Google-Smtp-Source: AGHT+IEJQPUkuQXiExK3OF2w07oMYg0QarGLl7wIyACTj28dPsveh+fMiQCsu7oVgNubWIWzXZzOHw== X-Received: by 2002:a05:6a20:12d5:b0:1f5:8a03:ea22 with SMTP id adf61e73a8af0-1fe4300f710mr27627852637.33.1742919345977; Tue, 25 Mar 2025 09:15:45 -0700 (PDT) Received: from google.com ([2601:647:5600:80d0::31cd]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-739459ad0b4sm1649000b3a.167.2025.03.25.09.15.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Mar 2025 09:15:45 -0700 (PDT) Date: Tue, 25 Mar 2025 09:15:43 -0700 From: Noah Misch To: Andres Freund Cc: Antonin Houska , pgsql-hackers@postgresql.org, Thomas Munro , Heikki Linnakangas , Robert Haas , Jakub Wartak , Jelte Fennema-Nio Subject: Re: AIO v2.5 Message-ID: <20250325161543.e3.nmisch@google.com> References: <4b3f32ug3cayekysqlgspz2qjmeb7lca3gvazayglxr2m3d4dv@il33accgsji7> <17906.1741863183@localhost> <3yxd5r23zly5bytvgyktbxtxq2r3gbpi7xd4dugevh3h4w4q6c@lu6oatjjpltz> <6ak556uyqiptdwjaci4kbi5eykwkmzqgkbtkyaosjnopjhncrc@2v4ac2jwyz22> <20250325022037.91.nmisch@google.com> <20250325141120.8e.nmisch@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.12 (2023-09-09) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Mar 25, 2025 at 11:57:58AM -0400, Andres Freund wrote: > On 2025-03-25 07:11:20 -0700, Noah Misch wrote: > > On Mon, Mar 24, 2025 at 10:52:19PM -0400, Andres Freund wrote: > > > If we want to implement it, I think we could introduce PGAIO_RS_WARN, which > > > then could tell the stager to issue the WARNING. It would add a bit of > > > distributed cost, both to callbacks and users of AIO, but it might not be too > > > bad. > > FWIW, I prototyped this, it's not hard. > > But it can't replace the current WARNING with 100% fidelity: If we read 60 > blocks in a single smgrreadv, we today would would emit 60 WARNINGs. But we > can't encode that many block offset in single PgAioResult, there's not enough > space, and enlarging it far enough doesn't seem to make sense either. > > > What we *could* do is to emit one WARNING for each bufmgr.c smgrstartreadv(), > with that warning saying that there were N zeroed blocks in a read from block > N to block Y and a HINT saying that there are more details in the server log. Sounds fine. > > Another thought on complete_shared running on other backends: I wonder if we > > should push an ErrorContextCallback that adds "CONTEXT: completing I/O of > > other process" or similar, so people wonder less about how "SELECT FROM a" led > > to a log message about IO on table "b". > > I've been wondering about that as well, and yes, we probably should. > > I'd add the pid of the backend that started the IO to the message - although > need to check whether we're trying to keep PIDs of other processes from > unprivileged users. We don't. > I think we probably should add a similar, but not equivalent, context in io > workers. Maybe "I/O worker executing I/O on behalf of process %d". Sounds good.