#49672 Ticket 49671 - Readonly replicas should not write internal ops to changelog
Closed by spichugi. Opened by mreynolds.
mreynolds/389-ds-base ticket49671  into  master

Download 49672.patch

Bug Description: When a hub receives an update that triggers the memberOf
plugin, but that interal operation has no csn and that
causes the update to the changelog to fail and break
replication.

Fix Description: Do not write internal updates with no csns to the changelog
on read-only replicas.

https://pagure.io/389-ds-base/issue/49671

Reviewed by: ?

The patch looks good to me. ACK

rebased onto 8a18d356cacaaaa0240489029a16646408a3de76

As per IRC discussion, I think these binds can be removed because they don't bring anything to the test and they just raise the confusion.

Beside this small thing, I am okay with the code. Ack from me.
Thank you! I really like how you wrote the test case. :)

P.S. it has fixed the original memberOf test.

But this is how we set the instance we want to search. Without it the "master1" instance would be searched and not the hub or consumer.

In the beginning, you've defined user1 as a user on master instance:

user1 = UserAccount(master, BIND_DN)

So, what happens now when you do this:

# You bind one time to the hub URI with DirSrv object created for master.
# It doedn't change the existing user1 but it creates a clone of master DirSrv
# which is returned (but it becomes a mess of master DirSrv object and
# URI set to hub instance, which doesn't work properly). But you have one time simple bind, yes. 
user1.bind(PASSWORD, uri=hub.get_ldap_uri())
# And you search on the master here. Becuase user1 is still bound to the same master DirSrv object with master URI. You can repeat the line a few times and you will see that the access log on hub doesn't have any additional searches
count = user1.get_attr_val_int('passwordRetryCount')

So I agree, I misinformed you a bit here, sorry... I mentioned it on IRC though: additionally you need to add one more line here. So the code will look like this:

# Finally check if passwordRetyCount was replicated to the hub and consumer
user1 = UserAccount(hub, BIND_DN)
count = user1.get_attr_val_int('passwordRetryCount')
if count is None:
    log.fatal('PasswordRetyCount was not replicated to hub')
    assert False
if int(count) != 1:
    log.fatal('PasswordRetyCount has unexpected value: {}'.format(count))
    assert False
user1 = UserAccount(consumer, BIND_DN)
count = user1.get_attr_val_int('passwordRetryCount')
if count is None:
    log.fatal('PasswordRetyCount was not replicated to consumer')
    assert False
if int(count) != 1:
    log.fatal('PasswordRetyCount has unexpected value: {}'.format(count))
    assert False

You create a DSLdapObject for the user entry on hub and you search there (you are bound as DM, because you use the same onstance of DirSrv object)

rebased onto 466fee601ee16b5eb9a10c8a8379d38f202d0b8a

Changes made...

LGTM! Thanks! Ack

rebased onto afb755bd95f1643665ea34c5a5fa2bb26bfa21b9

Pull-Request has been merged by mreynolds

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/2731

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

Metadata