Discussion:
When snapshot name has a specific # of chars, only a limited number of snapshots are listed even that they exist
(too old to reply)
Milan Knizek
2012-03-05 16:56:23 UTC
Permalink
I have just recently started testing zfs-fuse and also zfs on linux
and so far so good (for both implementations).

However, after installing zfs-auto-snapshot script I found that zfs-
fuse is not displaying all existing snapshots, despite the fact they
exist. I tried to reproduce in VM (x86_64, with file image inside of
virtualised file system instead of physical device), with the same
result.

The problems are on Intel Atom D510 file server, 2GB RAM. A limited
number of snapshots work reliably, just once there is more of them,
they do not get displayed.

The weird thing is that the bug occurs only when the snapshot name has
a given number of characters.

Here is a simple script to test. Whenever the length of the $SNAP_PREF
is changed, everything works fine. The text itself does not seem to be
important, just the length (+ the suffix)

At first create a pool called "pool" and then run the script below.
# zpool create pool /path/to/some/block/device

Once you destroy some of the snapshots, the snapshots previously
created but not shown by the list sub-command will appear again.

Obvious workaround for "zfs-auto-snapshot" is to set a different
prefix (-p sometext).

Regards,
Milan

===
The script:
#!/bin/bash
SNAP_PREF="pretty-long-name-for-a-snapshot-yeah"
echo The snap prefix is $( env echo $SNAP_PREF | wc -m ) chars long.
[[ $( env zfs list -o name -H | grep pool ) ]] || \
echo "A pool name pool should already exist before running the
script!" || \
exit 1

zfs destroy -r pool
declare i=0
while [[ "$i" -lt "5" ]]; do
zfs create pool/fs$i
i=$((i+1))
done
declare i=0
while true ; do
zfs snapshot -o com.sun:auto-snapshot-desc='' -r \
pool@${SNAP_PREF}-$i
LIST=$(env zfs list -o name -H -t snapshot )
COUNT=$(env echo $LIST | sed 's/ /\n/g' | \
grep "${SNAP_PREF}-$i" | wc -l )
echo Count = $COUNT Snapshot number = $i
[[ ! "$COUNT" -eq "6" || "$i" -gt "48" ]] && echo "Some snapshots
are hidden or max snapshot number reached!" && break
i=$((i+1))
done

===
And the output:
The snap prefix is 37 chars long.
Count = 6 Snapshot number = 0
Count = 6 Snapshot number = 1
Count = 6 Snapshot number = 2
Count = 6 Snapshot number = 3
Count = 6 Snapshot number = 4
Count = 6 Snapshot number = 5
Count = 6 Snapshot number = 6
Count = 6 Snapshot number = 7
Count = 6 Snapshot number = 8
Count = 6 Snapshot number = 9
Count = 2 Snapshot number = 10
Some snapshots are hidden or max snapshot number reached!
===
Here is the output of the "zfs list -t all" command:
NAME USED AVAIL REFER
MOUNTPOINT
pool 2,13M 161M
91K /pool
***@pretty-long-name-for-a-snapshot-yeah-0 0 - 91K
-
***@pretty-long-name-for-a-snapshot-yeah-1 0 - 91K
-
***@pretty-long-name-for-a-snapshot-yeah-2 0 - 91K
-
***@pretty-long-name-for-a-snapshot-yeah-3 0 - 91K
-
***@pretty-long-name-for-a-snapshot-yeah-4 0 - 91K
-
***@pretty-long-name-for-a-snapshot-yeah-5 0 - 91K
-
***@pretty-long-name-for-a-snapshot-yeah-6 0 - 91K
-
***@pretty-long-name-for-a-snapshot-yeah-7 0 - 91K
-
***@pretty-long-name-for-a-snapshot-yeah-8 0 - 91K
-
***@pretty-long-name-for-a-snapshot-yeah-9 0 - 91K
-
***@pretty-long-name-for-a-snapshot-yeah-10 0 - 91K
-
pool/fs0 21K 161M
21K /pool/fs0
pool/***@pretty-long-name-for-a-snapshot-yeah-1 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-2 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-3 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-4 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-5 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-6 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-8 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-9 0 - 21K
-
pool/fs1 21K 161M
21K /pool/fs1
pool/***@pretty-long-name-for-a-snapshot-yeah-0 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-1 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-2 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-3 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-4 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-5 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-6 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-7 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-8 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-9 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-10 0 - 21K
-
pool/fs2 21K 161M
21K /pool/fs2
pool/***@pretty-long-name-for-a-snapshot-yeah-0 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-1 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-2 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-4 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-5 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-6 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-7 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-8 0 - 21K
-
pool/fs3 21K 161M
21K /pool/fs3
pool/***@pretty-long-name-for-a-snapshot-yeah-1 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-6 0 - 21K
-
pool/fs4 21K 161M
21K /pool/fs4
pool/***@pretty-long-name-for-a-snapshot-yeah-3 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-4 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-7 0 - 21K
-
pool/***@pretty-long-name-for-a-snapshot-yeah-9 0 - 21K
-
--
To post to this group, send email to zfs-fuse-/***@public.gmane.org
To visit our Web site, click on http://zfs-fuse.net/
Milan Knizek
2012-03-05 19:52:02 UTC
Permalink
On 5 bře, 17:56, Milan Knizek <knizek.co...-***@public.gmane.org> wrote:
...
Post by Milan Knizek
while true ; do
  zfs snapshot -o com.sun:auto-snapshot-desc='' -r \
...
Removal of the user property com.sun:auto-snapshot-desc seems to
workaround the bug as well (shortening or lengthening the property
value or property does not have any effect, though).

Milan
--
To post to this group, send email to zfs-fuse-/***@public.gmane.org
To visit our Web site, click on http://zfs-fuse.net/
Loading...