Bug Description: ds-replcheck unreliable, showing false positives, showing missing tombstone entries in the report.
Fix Description: Added a test case to check missing tombstone entries is not reported
https://pagure.io/389-ds-base/issue/49239
Review by: ???
rebased onto f9d03ea27fdad09839fbf04ec91e1d85fd2c6463
This test fails on master:
> assert "entries missing on replica" not in result E AssertionError: assert 'entries missing on replica' not in '============... replica\n\n' E 'entries missing on replica' is contained here: E ================================================================================ E replication synchronization report (tue jul 2 18:51:13 2019) E ================================================================================ E E E database ruv's E ===================================================== E E master ruv: E {replica 1 ldap://server-f30.example.com:39001} 5d1ba76a000100010000 5d1ba790000100010000 E {replica 2 ldap://server-f30.example.com:39002} 5d1ba771000100020000 5d1ba78f000000020000 E {replicageneration} 5d1ba76a000000010000 E E replica ruv: E {replica 1 ldap://server-f30.example.com:39001} 5d1ba76a000100010000 5d1ba78e000000010000 E {replica 2 ldap://server-f30.example.com:39002} 5d1ba771000100020000 5d1ba78f000000020000 E {replicageneration} 5d1ba76a000000010000 E E replication state: replica is behind master by: 2 seconds E E E entry counts E ===================================================== E E master: 15 E replica: 14 E E E tombstones E ===================================================== E E master: 1 E replica: 0 E E missing entries E ===================================================== E E entries missing on replica: E - nsuniqueid=4e3eb401-9cfa11e9-838df36e-d9df3ae9,uid=test_user_1000,ou=people,dc=example,dc=com (created on master at: tue jul 2 18:50:56 2019) E E result E ===================================================== E E there are replication differences between master and replica dirsrvtests/tests/suites/ds_tools/replcheck_test.py:432: AssertionError
@mreynolds, I thought it was fixed. Any idea why it fails?
What test condition is failing? There are only 409 lines in the test script, so I don't know where line 432 is coming from. Perhaps this test was run from a different/older branch?
It's from this PR: https://pagure.io/fork/aadhikari/389-ds-base/blob/0aa60f18169c08d2d2fe68816c3ba2c893232dc9/f/dirsrvtests/tests/suites/ds_tools/replcheck_test.py#_432
It appears the problem is related to python3 and how it allows for checking arrays.
This works correctly in python2:
if 'nstombstone' in entry.data['objectclass']:
But in python3 it must be:
if b'nstombstone' in entry.data['objectclass']: or if 'nstombstone' in map(bytes.decode, entry.data['objectclass']):
Working on fix, but this only impacts 389-ds-base-1.4.x (RHEL 8)
@aadhikari - if you want you can add this code to your PR to fix the problem. Or I can file a separate ticket...
diff --git a/ldap/admin/src/scripts/ds-replcheck b/ldap/admin/src/scripts/ds-replcheck index 4abb417af..30bcfd65d 100755 --- a/ldap/admin/src/scripts/ds-replcheck +++ b/ldap/admin/src/scripts/ds-replcheck @@ -142,7 +142,7 @@ def convert_entries(entries): continue # lowercase all the objectclass values (easier for tombstone checking) - oc_vals = new_entry.data['objectclass'] + oc_vals = ensure_list_str(new_entry.data['objectclass']) new_oc_vals = [] for val in oc_vals: new_oc_vals.append(val.lower())
@mreynolds No problem at all, I will put it with this PR, Thanks for the help!
rebased onto 2a17814275782944d091992b0e5b973d81b339f2
rebased onto c2650f02e2457e4e2d9ace1e9cf25ba6a6ac30e9
@mreynolds It's done, @vashirov, please review.
LGTM, thanks!
Pull-Request has been merged by vashirov
389-ds-base is moving from Pagure to Github. This means that new issues and pull requests will be accepted only in 389-ds-base's github repository.
This pull request has been cloned to Github as issue and is available here: - https://github.com/389ds/389-ds-base/issues/3530
If you want to continue to work on the PR, please navigate to the github issue, download the patch from the attachments and file a new pull request.
Thank you for understanding. We apologize for all inconvenience.
Pull-Request has been closed by spichugi
Bug Description: ds-replcheck unreliable, showing false positives, showing missing tombstone entries
in the report.
Fix Description: Added a test case to check missing tombstone entries is not reported
https://pagure.io/389-ds-base/issue/49239
Review by: ???