-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add new L2ARC tests with Compressed ARC enabled/disabled #10692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ce4f5d2 to
1773a4d
Compare
Codecov Report
@@ Coverage Diff @@
## master #10692 +/- ##
==========================================
+ Coverage 79.77% 79.80% +0.02%
==========================================
Files 394 394
Lines 124647 124647
==========================================
+ Hits 99438 99474 +36
+ Misses 25209 25173 -36
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to add both of these new tests to the tests/runfiles/common.run file so they're run by default.
Blocks are handled differently depending on the state of the zfs_compressed_arc_enabled tunable. If a block is compressed on-disk, and compressed_arc is enabled: - the block is read from disk - It is NOT decompressed - It is added to the ARC in its compressed form - l2arc_write_buffers() may write it to the L2ARC (as is) - l2arc_read_done() compares the checksum to the BP (compressed) However, if compressed_arc is disabled: - the block is read from disk - It is decompressed - It is added to the ARC (uncompressed) - l2arc_write_buffers() will use l2arc_apply_transforms() to recompress the block, before writing it to the L2ARC - l2arc_read_done() compares the checksum to the BP (compressed) - l2arc_read_done() will use l2arc_untransform() to uncompress it This test writes out a test file to a pool consisting of one disk and one cache device, then randomly reads from it. Since the arc_max in the tests is low, this will feed the L2ARC, and result in reads from the L2ARC. We compare the value of the kstat l2_cksum_bad before and after to determine if any blocks failed to survive the trip through the L2ARC. Signed-off-by: Allan Jude <allanjude@freebsd.org> Sponsored-by: The FreeBSD Foundation
1773a4d to
42ecea1
Compare
Ahh, that explains a lot. Ok, that is done, lets see what CI things. It should fail the |
|
It looks like the test failed as expected. Can you add this change to the fix in #10693, then we can verify it passes and merge both the fix and test in a single commit. |
|
Pushed |
Signed-off-by: Allan Jude allanjude@freebsd.org
Sponsored-by: The FreeBSD Foundation
Motivation and Context
Blocks are handled differently depending on the state of the
zfs_compressed_arc_enabled tunable.
If a block is compressed on-disk, and compressed_arc is enabled:
However, if compressed_arc is disabled:
recompress the block, before writing it to the L2ARC
Description
This test writes out a test file to a pool consisting of one disk
and one cache device, then randomly reads from it. Since the arc_max
in the tests is low, this will feed the L2ARC, and result in reads
from the L2ARC.
We compare the value of the kstat l2_cksum_bad before and after
to determine if any blocks failed to survive the trip through the
L2ARC.
Note: It is expected for the second test, with compressed ARC disabled to fail. This test found a bug, I'll post the fix as a separate PR. I wanted to be able to show the test failing before, and passing after.
How Has This Been Tested?
The tests have been run on Linux (CentOS 7) and FreeBSD (12.1)
Types of changes
Checklist:
Signed-off-by.