oxidecomputer / oxidecomputer/omicron
zpool reports a different total size than zfs
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
Taking SN05 as an example:
EVT22200005 # zfs list -o name,used,avail oxp_3b70cd03-9bf6-4d78-867b-5e58b3a1f3ff
NAME USED AVAIL
oxp_3b70cd03-9bf6-4d78-867b-5e58b3a1f3ff 2.24T 587G
EVT22200005 # zpool list -o name,size oxp_3b70cd03-9bf6-4d78-867b-5e58b3a1f3ff
NAME SIZE
oxp_3b70cd03-9bf6-4d78-867b-5e58b3a1f3ff 2.91T
zfs list reports that the dataset's USED + AVAIL is about 2.81T, where zpool list reports 2.91T.
From zpool(1):
The space usage properties report actual physical space available to the
storage pool. The physical space can be different from the total amount
of space that any contained datasets can actually use. The amount of
space used in a raidz configuration depends on the characteristics of the
data being written. In addition, ZFS reserves some space for internal
accounting that the zfs(8) command takes into account, but the zpool
command does not. For non-full pools of a reasonable size, these effects
should be invisible. For small pools, or pools that are close to being
completely full, these discrepancies may become more noticeable.
The sled-agent uses the zpool list size as part of the zpool section of inventory, which written into the inv_zpool table, and eventually is consulted during region allocation (among other things).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the sled-agent code that collects zpool data and writes the inv_zpool table, then compare the zfs and zpool capacity values shown in the issue. Trace how inv_zpool is consulted during region allocation. Before changing anything, establish which capacity should be used and verify the chosen value through the inventory and allocation paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100