Matthew Ahrens
2006-05-01 21:43:00 UTC
Permalink
Raw Message
Why does making a snapshot cause the problem still on build 36?
Having a snapshot causes a problem because of the details of how weimplement file (and directory) deletion in ZFS. In particular, we might
have to put the file (or directory) onto an on-disk "delete queue" for
later processing (eg. if the file is currently open). The delete queue
data structure *is* part of the snapshot, so we will end up using more
net space, at least temporarily. Currently, we use the delete queue
even when it is not strictly necessary, like in 'rmdir' case that you
are testing, causing this unexpected behavior.
You should note that even with no snapshots, you will not be able to
rmdir a directory on a full filesystem if that filesystem is in a
multi-block[*] directory. In multi-block directories, it is nontrivial
to determine which blocks will need to be modified to record the removal
of a given directory entry, so we don't currently attempt that.
In general, once you are out of space (due to a quota or pool-wide space
exaustion), you can only remove files that are larger than some minimum
size. Smaller files and metadata operations will fail because we make
some overly-conservative estimates of the amount of space that will be
needed.
We're working on these problems. The excessive delete queue usage, and a
great number of these estimates will be tightened down as part of bug id
6362156, which is expected to be fixed in the next few months.
--matt
[*] Multi-block directories are implemented using the "fat ZAP" (as
opposed to the "micro ZAP" which uses only a single block). The fat zap
will be used if there are more than 2000 directory entries, or if any
entry name is longer than 49 bytes.