unit/zap: uint64 keys#18639
Conversation
Add coverage for binary uint64-array keys (ZAP_FLAG_UINT64_KEY), the key type used by the dedup table and block reference table. Covers the by-dnode operations on such a ZAP: add, lookup, length, lookup_length, update and remove. Signed-off-by: Christos Longros <chris.longros@gmail.com>
behlendorf
left a comment
There was a problem hiding this comment.
I'm all for the test coverage, let's just sync up with @robn on this one too.
|
Hey @chrislongros! Sorry for the delay getting back to you; we had a national holiday here on Monday and today I've been running errands. So I'm excited to see you diving right in, and also slightly cranky that you beat me to the punch on the really cool stuff ;) I jest, this is great, and I'm extremely pleased to see this PR, and the others! So I did already have a uint64 test in the pipeline, in a bigger bundle of FatZAP-specific tests. I hadn't felt great about it being there, since those are more aimed at internal stuff (eg leaf splits), so this is alright. Here's my version of the uint64 tests: robn@3bc2666 I think I'm covering a bit more, but I've been looking mostly at API coverage, not specific use cases like DDT/BRT, which may or may not be a good thing. The main thing this one was waiting for me to do was check coverage and make sure I hadn't missed any particularly interested paths, and decide on whether the output overwriting behaviour of Let me know what you'd like to do here. We can ship yours and add some more to it later, or you could incorporate mine, or ... something else. Honestly: I'm more interested in having a test co-conspirator at this point, so I'd be happy for you to pick the more funner thing at this moment! |
|
Thanks @robn. We could first push my own more basic version and then your more extensive version that covers most of the API. |
behlendorf
left a comment
There was a problem hiding this comment.
A trivial conflict to resolve after merging #18638 then this should be all set.
Motivation and Context
ZAP unit test that adds coverage for binary uint64-array keys (
ZAP_FLAG_UINT64_KEY), as used by the dedup table (DDT) and the block reference table (BRT).Description
Adds
test_zap_uint64_keys. It creates aZAP_FLAG_UINT64_KEYZAP (always a fatzap) and runs dnode operations:addthenlookup— add a value and then look it up based on the key.length— reports the value's size.lookup_length— returns the value and its count.update— replaces the value for an existing key.remove— after which the key is no longer found.How Has This Been Tested?
Built
tests/unit/test_zapand ran the suite:Types of changes
Checklist:
Signed-off-by.