Repository navigation
Conversation
|
Thank you for your contribution. Since you are not yet a member of the Ceph organization with write permissions on ceph/ceph.git, our CI will not automatically run. Any member of the Ceph organization may label this PR |
needs to stay in this branch until ceph#71946 is merged upstream.
ec9b7a6 to
b4cb6da
Compare
055b1ca to
90dded2
Compare
needs to stay in this branch until ceph#71946 is merged upstream.
needs to stay in this branch until ceph#71946 is merged upstream.
needs to stay in this branch until ceph#71946 is merged upstream.
readable.sh compares the json dump of a nondeterministic object with the
dump of its re-encoded self, sorting both first so that element order does
not matter. The sort ran under the caller's locale. glibc collates
distinct punctuation-only lines as equal -- the bare "{", "},", "]" that
fill a json dump -- and GNU sort is stable, so tied lines keep their input
order. The nondeterministic ordering the sort was meant to erase survives
it and the two dumps compare unequal, so the test fails on any machine
whose locale is not C/POSIX:
$ printf ' {\n },\n' | LC_ALL=de_DE.UTF-8 sort # { then },
$ printf ' },\n {\n' | LC_ALL=de_DE.UTF-8 sort # }, then {
Byte order has no ties, so LC_ALL=C gives one canonical order. Of the 123
corpus objects that do dump in a different order after a re-encode, 107
falsely mismatch under de_DE.UTF-8 and none under C.
Fixes: https://tracker.ceph.com/issues/80700
Signed-off-by: Dominik Raddatz <[email protected]>
90dded2 to
0bf51a3
Compare
|
jenkins test make check arm64 |
|
jenkins test make check |
needs to stay in this branch until ceph#71946 is merged upstream.
needs to stay in this branch until ceph#71946 is merged upstream.
needs to stay in this branch until ceph#71946 is merged upstream.
|
@NitzanMordhai could you review this? A build without a release tag reports a git hash as its version, which sort -V sorts among the archive versions, so the incompat checks from 011b25d test objects they should skip. |
NitzanMordhai
left a comment
There was a problem hiding this comment.
i have just 2 comments added, other then that, LGTM
| # The incompat checks compare versions with `sort -V`, which orders a git | ||
| # hash (a build without a release tag) by its leading characters. Such a | ||
| # build is newer than every archive: compare it as "zzzzz", which sorts last. | ||
| if [[ "$myversion" =~ ^[0-9]+\.[0-9]+ ]]; then | ||
| cmpversion=$myversion | ||
| else | ||
| echo "ceph-dencoder version '$myversion' is not a release version;" \ | ||
| "treating the decoder as newer than every archive" | ||
| cmpversion=zzzzz | ||
| fi | ||
|
|
There was a problem hiding this comment.
FYI, the odd version here comes from src/CMakeLists.txt:49. It always strips the first character of git describe --always to drop the v, so an untagged build reports a truncated hash (4cb6da8e11 is missing its first character).
Not something to fix in this PR, but the CMake line should probably strip v only when it's there, maybe as a separate fix.
There was a problem hiding this comment.
Thanks for spotting it, fixed in #73757.
| if ! cmp $tmp1 $tmp2; then | ||
| echo "**** reencode of $vdir/objects/$type/$f resulted in a different dump ****" | ||
| diff $tmp1 $tmp2 | ||
| # diff always exits non-zero here; || true keeps set -e from | ||
| # killing this job before it records its result. | ||
| diff $tmp1 $tmp2 || true | ||
| failed=$(($failed + 1)) |
There was a problem hiding this comment.
nit: diff can do both jobs here, which also removes the need for || true and its comment:
if ! diff $tmp1 $tmp2; then
echo "**** reencode of $vdir/objects/$type/$f resulted in a different dump ****"
failed=$(($failed + 1))
fi
The diff output would now come before the "resulted in a different dump" line instead of after it. If you'd rather keep the original order, the current version is fine.
On a mismatch readable.sh prints the difference with diff, which exits non-zero by construction. The script runs under "set -e" and the body of an if is not a tested position, so the shell aborts. test_object runs as a background job that records its tally to a result file once it is done, so the abort discards that file and the type's remaining objects are never tested. The summing loop then reports **** result file for job N is missing; the job likely died before recording its result **** which hides the very diff it was meant to show and undercounts numtests. A genuine encode/decode regression therefore surfaces as a missing result file rather than as a readable difference. Test with diff itself instead of cmp: set -e ignores a failing if condition. The mismatch is still counted by the failed=$(($failed + 1)) in the if body. Fixes: https://tracker.ceph.com/issues/80700 Assisted-by: claude-opus-5-5 Signed-off-by: Dominik Raddatz <[email protected]>
readable.sh decides which corpus objects to skip by comparing the decoder's version with archive and marker versions under `sort -V`. Without a reachable release tag that version is an abbreviated git hash, which `sort -V` orders by its leading characters. A digit-prefixed hash lands among the archives: $ printf '%s\n' 0.94.2-207-g88e7ee7 4cb6da8e11 9.0.2-1116-g7811c77 | sort -V 0.94.2-207-g88e7ee7 4cb6da8e11 9.0.2-1116-g7811c77 so an 18.2.0 object of a type marked forward incompat at 19.2.0-404-g78ddc7f9027, for example, is tested instead of skipped, and fails. Such a build is newer than every archive, so compare it as "zzzzz", which sorts after any version. Messages still report the real version. Signed-off-by: Dominik Raddatz <[email protected]>
0bf51a3 to
58d723d
Compare
|
@NitzanMordhai thanks for the reviews! Could you add needs-qa here and on #73757? |
|
@NitzanMordhai this and #73757 have had needs-qa since 11-15 without being batched; RADOS batches seem to pick PRs by the |
No, it needs to run in teuthology as well. will ask to pick them @SrinivasaBharath can you please pick it? |
|
This PR has been added to wip-bharath3-testing-20261127.055027-main. |
src/test/encoding/readable.shreports false failures when the shell locale is not C/POSIX, and on builds that cannot see a release tag. Three independent problems, one commit each.1. The sort ran under the caller's locale.
For types
ceph-dencoderreports as non-deterministic, the script sorts the dumps of an object and its re-encoded self before comparing them. glibc collates distinct punctuation-only lines (the bare{,},,]of a json dump) as equal, and GNU sort is stable, so tied lines keep their input order and the dumps compare unequal:Of the 123 corpus objects whose dump order changes after a re-encode, 107 falsely mismatch under
de_DE.UTF-8, none underC. The fix covers only thissort; thesort -Vcalls compare versions, where collation cannot tie.2.
diffis fatal underset -e.On a mismatch the script shows the difference with
diff, which exits non-zero and, underset -e, kills the background job before it writes its result file. The summary then reportsresult file for job N is missinginstead of the diff, and the type's remaining objects go untested.3. A non-release decoder version is compared as if it were one.
Without a reachable release tag the decoder reports an abbreviated git hash, which
sort -Vorders by its leading characters. A digit-prefixed hash lands among the archives:so an 18.2.0 object marked forward incompat at 19.2.0-404-g78ddc7f9027 is tested instead of skipped, and fails. Such a build is newer than every archive, so it is now compared as
zzzzz.None of this is a regression: the
diffcall dates to 625a89d (2012), the result-file scheme to 8b6be11 (2016).Verified on x86-64 Linux with
LANG=de_DE.UTF-8, clang debug build reporting4cb6da8e11:ctest -R readable→passed 29286 tests.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.