#216 Disable replication agreements
Closed: Fixed None Opened 7 years ago by rmeggins.


batch move to milestone 1.3

Added a new attribute to the replication agreement: nsds5ReplicaEnabled (on|off)

Testing is looking good so far, will send out for review soon.

1 minor request...
diff --git a/ldap/servers/plugins/replication/repl5_agmt.c b/ldap/servers/plugins/replication/repl5_agmt.c
index 8714021..bfde962 100644
120 PRBool is_enabled; <== not used?

And a question...
Can an agreement be disabled while the replication is in progress?
Not sure this code is used to stop an agreement, but it looks to me that if an agreement is disabled (agmt_is_enabled returns 0), then the stop call agmt_stop won't be called...
diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c
index c2e69f8..6434dbd 100644
a b start_agreements_for_replica (Replica r, PRBool start)
3448 if(agmt_is_enabled(agmt)){
3449 if (start)
3450 agmt_start (agmt);
3451 else /
stop */
3452 agmt_stop (agmt);
3453 }

Oops, my mistake. Sorry! I mistakenly saw is_enabled was declared in agmt_new_from_entry. :p

Mark Reynolds wrote:

I tested under load, and everything works fine. As soon as you re-enable it, replication resumes. It works surprising well. As for the above code, there is nothing to stop/start if the agreement is already disabled.

Cool! It'd be nice if you could add the test scripts/steps and the error log to this ticket. It'll help us to understand the new feature. Thanks!

So I had the server under load and ran this ldapmodify:

dn: cn=to m3,cn=replica,cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config
changetype: modify
replace: nsds5ReplicaEnabled
nsds5ReplicaEnabled: off

after some time I re-enabled it:

dn: cn=to m3,cn=replica,cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config
changetype: modify
replace: nsds5ReplicaEnabled
nsds5ReplicaEnabled: on

Once it's enabled, and the agmt is started, replication automatically resumes. I did not have to intervene(e.g. send updates now). I attached some error log output(replication logging), to show what the server does.

I'll wait to commit until you have reviewed this info.

Thanks.

Replication logging showing the disabling & enabling of a replica agmt
disable-replica-logging

Great! Thanks for the test case and the error log. Everything looks good.

Could you do me one favour (only if this is not done yet...)?
Search all on the master and replica with attribute list dn, sort the 2 outputs and compare them? I just want to make sure all the operations are successfully replicated...

Actually that's already been tested. I ran about 1000 updates while the agreement was disabled, and they were all replayed once it was re-enabled. Actually, I disabled the agreement, under load, around update 200. When I enabled the agmt I saw all 1000 updates on the consumer after a few seconds.

The log output I attached was just for one update to keep the output concise. It was more of a proof of concept. The output from the long run was just way too much to be easily read.

I'm going to go ahead with the commit.

Thanks,
Mark

git merge ticket216
Updating 0f50544..7876d18
Fast-forward
ldap/schema/01core389.ldif | 3 +-
ldap/servers/plugins/replication/cl5_api.c | 5 ++
ldap/servers/plugins/replication/repl5.h | 3 +
ldap/servers/plugins/replication/repl5_agmt.c | 69 ++++++++++++++++++++
ldap/servers/plugins/replication/repl5_agmtlist.c | 13 ++++-
ldap/servers/plugins/replication/repl5_replica.c | 14 ++--
.../plugins/replication/repl5_replica_config.c | 8 ++
ldap/servers/plugins/replication/repl_extop.c | 8 ++
ldap/servers/plugins/replication/repl_globals.c | 1 +
9 files changed, 115 insertions(+), 9 deletions(-)

[mareynol@localhost replication]$ git push origin master
Counting objects: 31, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (16/16), done.
Writing objects: 100% (16/16), 2.44 KiB, done.
Total 16 (delta 14), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
0f50544..7876d18 master -> master

Once again, thanks so much!!

Added initial screened field value.

Pushed schema update:

[mareynol@localhost ds]$ git merge ticket207
Updating b3ca9ee..b3a2f40
Fast-forward
ldap/schema/02common.ldif | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

[mareynol@localhost ds]$ git push origin master
Counting objects: 9, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 656 bytes, done.
Total 5 (delta 4), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
b3ca9ee..b3a2f40 master -> master

[mareynol@localhost ds]$ git checkout 389-ds-base-1.2.11
Switched to branch '389-ds-base-1.2.11'

[mareynol@localhost ds]$ git cherry-pick -x master
Finished one cherry-pick.
[389-ds-base-1.2.11 77f126b] Ticket 216 - disable replication agreements
1 files changed, 1 insertions(+), 1 deletions(-)

[mareynol@localhost ds]$ git push origin 389-ds-base-1.2.11
Counting objects: 9, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 699 bytes, done.
Total 5 (delta 4), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
bf2bfaa..77f126b 389-ds-base-1.2.11 -> 389-ds-base-1.2.11

Metadata Update from @rmeggins:
- Issue assigned to mreynolds
- Issue set to the milestone: 1.2.11

2 years ago

Login to comment on this ticket.

Metadata