cls/rbd: use default values for non-decoded fields in test instances#63933
cls/rbd: use default values for non-decoded fields in test instances#63933
Conversation
|
jenkins test make check |
|
see also ceph/ceph-object-corpus#24, which marks |
Previously, test instances for cls_rbd_snap used non-default values for the "parent" field, which is ignored during decoding. The check-generated.sh test passed because they reused the same instance for re-encoding, preserving undecoded fields. An upcoming change will allocate new instances for each encode/decode verification instead of reusing instances. This will expose discrepancies between original test instances and re-encoded values when fields contain non-default values but aren't decoded. This change sets ignored fields to their default values in test instances, ensuring consistency between encoding and decoding operations regardless of the verification approach used. Since the incompatibility of cls_rbd_snap's on-disk format was introduced in 32b14ed, which was introduced Ceph v14, we will mark this version the first incompatible version in ceph-object-corpus in the sense that the re-encoded cls_rbd_snap with v8 struct version is different from the original copy if its parent field is set with < v8 struct version. Signed-off-by: Kefu Chai <tchaikov@gmail.com>
a60e4e9 to
a329b00
Compare
|
changelog:
|
Is there any indication of this being done on purpose, perhaps to allow Asking just of of curiosity -- I actually prefer the "allocate new instances for each encode/decode verification instead of reusing instances" approach. |
hmm, if it was done on purpose. i'd argue that it's a wrong decision which defeats the whole purpose of the
|
|
jenkins test make check |
Previously, test instances for cls_rbd_snap used non-default values for the "parent" field, which is ignored during decoding. The check-generated.sh test passed because they reused the same instance for re-encoding, preserving undecoded fields.
An upcoming change will allocate new instances for each encode/decode verification instead of reusing instances. This will expose discrepancies between original test instances and re-encoded values when fields contain non-default values but aren't decoded.
This change sets ignored fields to their default values in test instances, ensuring consistency between encoding and decoding operations regardless of the verification approach used.
Since the incompatibility of cls_rbd_snap's on-disk format was introduced in 32b14ed, which was introduced Ceph v14, we will mark this version the first incompatible version in ceph-object-corpus in the sense that the re-encoded cls_rbd_snap with v8 struct version is different from the original copy if its parent field is set with < v8 struct version.
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 Definition