zfs icon indicating copy to clipboard operation
zfs copied to clipboard

Fast Dedup: dnode: allow storage class to be overridden by object type

Open allanjude opened this issue 1 year ago • 3 comments

Motivation and Context

The upcoming “dedup log” feature requires a new type of object to store the log. We will want to use the dedup storage class, however as a new object type (“OTN”) it has no distinguishing features, so we can’t set the storage class for it.

Description

This allows a caller to set an alternate object type on a dnode hold to use when computing the storage class. Writes generated under that hold will be written with the storage class for the overridden type.

(It would be far better if this was stored with the dnode somewhere, but that would be a serious on-disk format change and is a massive undertaking in its own right).

How Has This Been Tested?

TBD.

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Performance enhancement (non-breaking change which improves efficiency)
  • [ ] Code cleanup (non-breaking change which makes code smaller or more readable)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • [x] Documentation (a change to man pages or other documentation)

Checklist:

  • [x] My code follows the OpenZFS code style requirements.
  • [x] I have updated the documentation accordingly.
  • [x] I have read the contributing document.
  • [ ] I have added tests to cover my changes.
  • [x] I have run the ZFS Test Suite with this change applied.
  • [x] All commit messages are properly formatted and contain Signed-off-by.

allanjude avatar Feb 14 '24 14:02 allanjude

[Fast dedup stack rebased to master 3c941d181]

robn avatar May 15 '24 03:05 robn

Looks fine to me. But I am thinking if storage specification could possibly be done at some different layer. We could specify, for example, that within ZAP the first block and hash blocks are more important than others.

Yeah, there's a lot I would like to do like that. In my head it's a kind of "reimagine dmu_write_policy()" superproject.

At least with this, there's no on-disk format change, so we can punt the actual design work down the road a bit.

robn avatar May 15 '24 03:05 robn

@behlendorf rebased to sit alone on top of master. If the tests pass, this should be safe to merge.

robn avatar May 15 '24 04:05 robn

Rebased (these changes are stand-alone and can be merged out of order with the rest of fast dedup)

allanjude avatar Jul 26 '24 18:07 allanjude