Conversation
idryomov
left a comment
There was a problem hiding this comment.
This is exactly the kind of thing I had in mind when suggesting to add a test in #65901 (comment).
If we are going to implicitly assume msgr2 here, that should at least be mentioned in librbd.h file where the public API is defined.
aad0da7 to
6d60365
Compare
The bufferlist code should be able to take a CRC for one initial value and transform it into a CRC for another initial value without repeating the full calculation (i.e. efficiently, without even looking at the data buffer). This means that as long as the precomputed CRC a) isn't manipulated with beforehand and b) gets stored with the correct initial value, the fact that there is a difference between msgr1 and msgr2 should be transparent to the user (except for the computational overhead of possibly needing to adjust the precomputed CRC).
So after taking a deeper look, I don't think msgr2 or anything about its internals is worth mentioning there. We just need to clearly state what initial value is expected (or consider accepting it as a separate argument to be as flexible as possible). |
6d60365 to
4c422a7
Compare
Fix runtime error, using test command: sudo dd if=/dev/zero bs=32k of=/dev/nvme0n1 count=1 The error log: 2025-11-23T11:24:10.512+0000 7f30f4ec0640 1 --2- [v2:192.168.13.2:6802/3444906816,v1:192.168.13.2:6803/3444906816] >> 192.168.13.3:0/3916714748 conn(0x527d400 0x728f700 crc :-1 s=THROTTLE_DONE pgs=2038703 gs=2038723 cs=0 l=1 c_cookie=0 s_cookie=0 reconnecting=0 rev1=1 crypto rx=0 tx=0 comp rx=0 tx=0)._handle_read_frame_epilogue_main bad segment crc calculated=1136411986 expected=4294967295 Ceph msgr2 validation (ceph/src/msg/async/frames_v2.cc:47): uint32_t crc = segment_bl.crc32c(-1); // Uses initial value -1 Co-authored-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Alexander Indenbaum <aindenba@redhat.com>
4c422a7 to
36d99e3
Compare
|
jenkins test make check |
1 similar comment
|
jenkins test make check |
librbd: rbd_aio_write_with_crc32c store CRC32C with initial value -1 to match msgr2 validation
Fix runtime error, using test command:
The error log:
msg2 validation (src/msg/async/frames_v2.cc:47):
Calls bufferlist::crc32c(-1) with initial value -1
uint32_t crc = segment_bl.crc32c(-1); // Uses initial value -1 (0xFFFFFFFF)The cached CRC is stored with initial value 0, but msg2 calculates with initial value -1 (0xFFFFFFFF).
see #65901
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.