From nobody Wed Feb 12 16:41:17 2025 X-Original-To: freebsd-stable@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YtPGF0vSyz5n3rw for ; Wed, 12 Feb 2025 16:41:25 +0000 (UTC) (envelope-from eugene@zheganin.net) Received: from elf.hq.norma.perm.ru (mail.norman-retail.ru [128.127.146.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.norma.perm.ru", Issuer "R11" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YtPGD3Zc9z3JJh for ; Wed, 12 Feb 2025 16:41:24 +0000 (UTC) (envelope-from eugene@zheganin.net) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of eugene@zheganin.net designates 128.127.146.8 as permitted sender) smtp.mailfrom=eugene@zheganin.net; dmarc=none Received: from [192.168.243.2] ([192.168.243.2]) by elf.hq.norma.perm.ru (8.16.1/8.16.1) with ESMTP id 51CGfMQo044337 for ; Wed, 12 Feb 2025 21:41:22 +0500 (+05) (envelope-from eugene@zheganin.net) Message-ID: Date: Wed, 12 Feb 2025 21:41:17 +0500 List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-stable@freebsd.org Sender: owner-freebsd-stable@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: freebsd-stable@FreeBSD.org Content-Language: ru From: "Eugene M. Zheganin" Subject: zfs diff Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [1.84 / 15.00]; NEURAL_SPAM_LONG(1.00)[1.000]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; R_SPF_ALLOW(-0.20)[+a]; NEURAL_SPAM_SHORT(0.14)[0.143]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:212494, ipnet:128.127.146.0/24, country:RU]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_ONE(0.00)[1]; TO_DN_NONE(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-stable@FreeBSD.org]; PREVIOUSLY_DELIVERED(0.00)[freebsd-stable@freebsd.org]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; DMARC_NA(0.00)[zheganin.net]; FROM_HAS_DN(0.00)[] X-Spamd-Bar: + X-Rspamd-Queue-Id: 4YtPGD3Zc9z3JJh Hello, I have a 13.2-RELEASE-p3 system with a large storage attached: ===Cut=== NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP DEDUP    HEALTH  ALTROOT tank    135T   122T  12.8T        -         -    66%    90% 1.27x    ONLINE  - zroot  31.5G  27.8G  3.74G        -         -    70%    88% 1.00x    ONLINE  - ===Cut=== In order to process some newly incoming files I'd like to use the zfs diff functionality to get the list of the files created or modified. So I wrote a simple script (/root/periodic/zfsdiff) diffing two dataset snapshots between today and yesterday. Most of these launches do merely work. But not all of them. Some (like 15%) just are waiting for something infinitely, while seemingly doing nothing: ===Cut=== 39935  -  I      18101:52,29 zfs diff tank/data/tank2@2025-01-20 tank/data/tank2@2025-01-21 46118  -  Is         0:00,00 /bin/sh /root/periodic/zfsdiff 46126  -  I        354:34,75 zfs diff tank/data/tank0@2025-02-03 tank/data/tank0@2025-02-04 49620  -  I       2155:14,42 zfs diff tank/data/tank1@2025-02-10 tank/data/tank1@2025-02-11 53243  -  Is         0:00,00 /bin/sh /root/periodic/zfsdiff 53255  -  I       3607:34,83 zfs diff tank/data/tank0@2025-02-09 tank/data/tank0@2025-02-10 56849  -  Is         0:00,00 /bin/sh /root/periodic/zfsdiff 59725  -  I       3630:23,01 zfs diff tank/data/tank2@2025-01-27 tank/data/tank2@2025-01-28 65460  -  I       1425:25,55 zfs diff tank/data/tank1@2025-02-03 tank/data/tank1@2025-02-04 82371  -  I        111:25,63 zfs diff tank/data/tank3@2025-02-11 tank/data/tank3@2025-02-12 98172  -  Is         0:00,00 /bin/sh /root/periodic/zfsdiff 98223  -  I       4792:11,99 zfs diff tank/data/tank3@2025-02-04 tank/data/tank3@2025-02-05 40589  2  IN     18108:48,07 zfs diff tank/data/tank2@2025-01-20 tank/data/tank2@2025-01-21 28649  6  I+       471:24,81 zfs diff tank/data/tank1@2025-02-03 ===Cut=== Surprisingly, this has little to no correlation to the size of the snapshot, for instance I have the relatively small snapshot diff that fails to process (notice the idle process above): ===Cut=== tank/data/tank1@2025-02-03                       31.6M      - 16.0T  - tank/data/tank1@2025-02-04                       32.5M      - 16.0T  - ===Cut=== Also, some of these leave no output, without any traces of the script killed or crashed which is very suspicious as well. You could say that this probably means there were no changes, but the snapshot size thinks there were some. Is there any trick there ? Does this look like a race condition, do I have to run these sequentially, like one diff at a time ? Can those interfere with only their fellow diffs, or also with snapshot creation ? Thanks. Eugene.