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 1tLBEW-00DDNx-QI for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Dec 2024 01:09:44 +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 1tLBET-00Af3D-NN for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Dec 2024 01:09:42 +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 1tLBET-00Af32-9p for pgsql-hackers@lists.postgresql.org; Wed, 11 Dec 2024 01:09:42 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tLBEN-002ATS-Kd for pgsql-hackers@postgresql.org; Wed, 11 Dec 2024 01:09:37 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-434e3953b65so27113245e9.1 for ; Tue, 10 Dec 2024 17:09:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733879374; x=1734484174; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/KY8arZG2EJAr8nN+QSyzWe0V42sicGJJkJzcgobWVI=; b=nP689zc70lZfNNFrT2GGgpbpRfZtpmeDkyc0KvdQ3uiDMQRaIw/F2oYIm3GosEsPPG eKfkI9RzMY7flouxXnYlV7wxV8fqJnKV7rxd8cpTqqfwD49PWinyfm5FvB1Wacb7LqeK mXu4V7v9R6SJwqEJjQGkd8UA5a7jvzwU2JkSb9UJKozYtiBZOwSOZyEjdEbMJwlfqg7w psLklMBPeOfC7Djo4gwaGAK3U2qRE3BDJc08XYPTH3Vsux37Bf7noidL++dYQQDFovh3 rkjxrf2BVZOMfb2iT291K0U+4ZR5K04gS9EMlcb+6AdbJKvKmmUh9KNDT5R9Ntoln9To hyAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733879374; x=1734484174; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/KY8arZG2EJAr8nN+QSyzWe0V42sicGJJkJzcgobWVI=; b=dSnPgPPM7dkTpnMrVyiWZAE+UmUiEvxXsKD7HyS90L65X3AmF9BbFPjNkcn3LQRqlv prnnW+Swi5uCHL6EuHwd4DJ0RUivf295rLZCz8sDBr/oL4tXxgVcD5ICMhRyOEeqUvwA SI8RVQ1F+jl/y8rw0hM+INc/f6rGRKvtBEq4dzmLR4Of3LcIU/SeehcJpTcOa68wdidZ 1dlOucOtGf7AVPhTd6wh4r9TeslyNF3+gadvt3L9Kc7XSz5gXY9HiczR+zEZ0ymkdf3F hJZSbNDB8BqtcXowIF83jzoPovpYGQuVlqI3jShiV23CSxvpOYR3I3K5BDwUOcKKpLPl f4pA== X-Forwarded-Encrypted: i=1; AJvYcCXgN+Jo9akUJXUdXOw440R3m0n7cPRuZCQP+USiOEgFgwTzGyMUwCX86BMuPApT3fsEhZ0zvESYiNnFrlDF@postgresql.org X-Gm-Message-State: AOJu0YxWSyQyAlJ7jwFJECPimMY0gJFaef5Uj3cDe1F+1Dj7KwlSj6px qBl7Zch/l7Fp009fiMYu3GeXy1fFajBDZ9jumu0LzYIMQOK0NeVfud9jC6v+hrsZeKeg4lR11+3 S7UQ7xK4Z9WSqIuh6UYuBL/424B8= X-Gm-Gg: ASbGncsdpEpX4N4NUQGPkNobf2ac8DZzU2MdqqCiOk6J6PHQbAZXiF9ktu44d34wcW8 MV/H49nyzyIR6zrgh+5DTrMfdwqI8tw2s2Q== X-Google-Smtp-Source: AGHT+IE+524Y8NlqcOjcqZ8PY8BzUsMEtsv29pGan6Fid9CJbWPCqsqOpCsQaqQ+r25G7ZkICpeTUIlTvTzseSLd9ug= X-Received: by 2002:a5d:5f49:0:b0:386:3357:2d9d with SMTP id ffacd0b85a97d-3864cec5740mr725052f8f.36.1733879373798; Tue, 10 Dec 2024 17:09:33 -0800 (PST) MIME-Version: 1.0 References: <8aa1d1d7-645f-404b-a8f8-7c49be9acd27@vondra.me> <6m3j6rsbngcma45ckox3msfgbn2jjspkqau5bma2pq4l5nolni@2umtkdghgavf> In-Reply-To: From: Michael Harris Date: Wed, 11 Dec 2024 12:09:22 +1100 Message-ID: Subject: Re: FileFallocate misbehaving on XFS To: Andres Freund Cc: Tomas Vondra , PostgreSQL-development Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Andres On Wed, 11 Dec 2024 at 03:09, Andres Freund wrote: > I think it's implied, but I just want to be sure: This was one of the affected > systems? Yes, correct. > Any chance to get df output? I'm mainly curious about the number of used > inodes. Sorry, I could swear I had included that already! Here it is: # df /var/opt Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/ippvg-ipplv 4197492228 3803866716 393625512 91% /var/opt # df -i /var/opt Filesystem Inodes IUsed IFree IUse% Mounted on /dev/mapper/ippvg-ipplv 419954240 1568137 418386103 1% /var/opt > Could you show the mount options that end up being used? > grep /var/opt /proc/mounts /dev/mapper/ippvg-ipplv /var/opt xfs rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota 0 0 These seem to be the defaults. > I assume you have never set XFS options for the PG directory or files within > it? Correct. > Could you show > xfs_io -r -c lsattr -c stat -c statfs /path/to/directory/with/enospc -p--------------X pg_tblspc/16402/PG_16_202307071/49163/1132925906.4 fd.path = "pg_tblspc/16402/PG_16_202307071/49163/1132925906.4" fd.flags = non-sync,non-direct,read-only stat.ino = 4320612794 stat.type = regular file stat.size = 201211904 stat.blocks = 393000 fsxattr.xflags = 0x80000002 [-p--------------X] fsxattr.projid = 0 fsxattr.extsize = 0 fsxattr.cowextsize = 0 fsxattr.nextents = 165 fsxattr.naextents = 0 dioattr.mem = 0x200 dioattr.miniosz = 512 dioattr.maxiosz = 2147483136 fd.path = "pg_tblspc/16402/PG_16_202307071/49163/1132925906.4" statfs.f_bsize = 4096 statfs.f_blocks = 1049373057 statfs.f_bavail = 98406378 statfs.f_files = 419954240 statfs.f_ffree = 418386103 statfs.f_flags = 0x1020 geom.bsize = 4096 geom.agcount = 4 geom.agblocks = 262471424 geom.datablocks = 1049885696 geom.rtblocks = 0 geom.rtextents = 0 geom.rtextsize = 1 geom.sunit = 0 geom.swidth = 0 counts.freedata = 98406378 counts.freertx = 0 counts.freeino = 864183 counts.allocino = 2432320 > I'd try monitoring the per-ag free space over time and see if the the ENOSPC > issue is correlated with one AG getting full. 'freesp' is probably too > expensive for that, but it looks like > xfs_db -r -c agresv /dev/nvme6n1 > should work? > > Actually that output might be interesting to see, even when you don't hit the > issue. I will see if I can set that up. > How many partitions are there for each of the tables? Mainly wondering because > of the number of inodes being used. It is configurable and varies from site to site. It could range from 7 up to maybe 60. > Are all of the active tables within one database? That could be relevant due > to per-directory behaviour of free space allocation. Each pg instance may have one or more application databases. Typically data is being written into all of them (although sometimes a database will be archived, with no new data going into it). You might be onto something though. The system I got the above prints from is only experiencing this issue in one directory - that might not mean very much though, it only has 2 databases and one of them looks like it is not receiving imports. But another system I can access has multiple databases with ongoing imports, yet all the errors bar one relate to one directory. I will collect some data from that system and post it shortly. Cheers Mike