Repository navigation
compressor: zstd error checking and more tests - #69733
Conversation
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
16 similar comments
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
Hello Ceph maintainers, could you have a look at this? |
cbc68d3 to
6d3ac77
Compare
7fd746d to
3bba173
Compare
|
@tchaikov could you have a look please? |
tchaikov
left a comment
There was a problem hiding this comment.
thanks for picking this up.
and please use imperative mood in the title. see https://github.com/ceph/ceph/blob/main/SubmittingPatches.rst#commit-title
could you add a "Signed-off-by" line at the end of your commit message? "git commit -s" will do the trick for you. see https://github.com/ceph/ceph/blob/master/SubmittingPatches.rst#sign-your-work
Signed-off-by: Patrick Chilton <[email protected]>
jacquesh
left a comment
There was a problem hiding this comment.
I'll take another/closer look on Monday (I've not looked over the tests yet) but the runtime logic itself seems at least correct to me now. Awesome!
| if (ZSTD_isError(r)) { | ||
| return -EINVAL; | ||
| } | ||
| if (inbuf.pos == inbuf.size && (zed != ZSTD_e_end || r == 0)) { |
There was a problem hiding this comment.
Minor suggestion: I believe this condition is correct but personally I find it opaque and difficult to think about. Not critical but for ease-of-understanding, I'd suggest either adding a comment describing the two cases, such as:
| if (inbuf.pos == inbuf.size && (zed != ZSTD_e_end || r == 0)) { | |
| // Done if we've consumed all input, are ending the frame and have received the | |
| // full compressed output frame, or if we've consumed all input and are still | |
| // pushing input data into the compressor. | |
| if (inbuf.pos == inbuf.size && (zed != ZSTD_e_end || r == 0)) { |
Or just splitting it into two conditions (which I'm pretty sure the optimiser would merge anyway), e.g:
| if (inbuf.pos == inbuf.size && (zed != ZSTD_e_end || r == 0)) { | |
| if (inbuf.pos == inbuf.size && zed == ZSTD_e_end && r == 0)) { | |
| break; // All data compressed and written to output | |
| } | |
| if (inbuf.pos == inbuf.size && zed == ZSTD_e_continue) { | |
| break; // All input data written to compressor state | |
| } |
Certainly not critical, but thought I'd throw out the suggestion since if it took me a while to convince myself that this was correct then others might too.
There was a problem hiding this comment.
@jacquesh hi Jacques, good idea. probably we can have a follow-up PR to improve the readability?
|
This PR has been added to wip-anrao4-testing-2026-11-02-0647-main. |
pr testing completed and approved by @ivancich more details on :https://tracker.ceph.com/issues/82521 |
|
jenkins test make check arm64 |
|
This is an automated message by src/script/redmine-upkeep.py. I have resolved the following tracker ticket due to the merge of this PR: No backports are pending for the ticket. If this is incorrect, please update the tracker |
This addresses some current issues in ZstdCompressor (https://tracker.ceph.com/issues/77334)
decompressStreamwas unchecked, which could silently return corrupt data.compressStream2anddecompressStreamare now called repeatedly until they say they're finished. According to the zstd manual this is not guaranteed by a single call.uint32compressed length field.Enhancements:
CCtx_reseton a freshCCtx.unique_ptrfor the contexts so we can't forget to free.ZstdCompressor.Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.