Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 839638

Summary: ipa-replica-manage allows disconnect of last connection for a single replica
Product: Red Hat Enterprise Linux 6 Reporter: Scott Poore <spoore>
Component: ipaAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: Namita Soman <nsoman>
Severity: unspecified Docs Contact:
Priority: high    
Version: 6.3CC: jgalipea, mkosek
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-3.0.0-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 09:16:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Scott Poore 2012-07-12 13:26:43 UTC
Description of problem:

ipa-replica-manage is allowing me to disconnect (not delete) the last connection to a replica. 

topo:  R1--M--R2

Since there is not a connection from R1 to R2, I should have to delete the connection between R1 (or R2) and M?

ipa-replica-manage is allowing me to disconnect though:

install vm1 as M
install vm2 as R1 connected to M
install vm3 as R2 connected to M

Then:

[root@vm1 shared]# ipa-replica-manage -p $ADMINPW disconnect vm1.testrelm.com vm2.testrelm.com
Deleted replication agreement from 'vm1.testrelm.com' to 'vm2.testrelm.com'

[root@vm1 shared]# ipa-replica-manage -p $ADMINPW connect vm1.testrelm.com vm2.testrelm.com
You cannot connect to a previously deleted master

[root@vm1 shared]# ipa-replica-manage -p $ADMINPW disconnect vm1.testrelm.com vm3.testrelm.com
Cannot remove the last replication link of 'vm1.testrelm.com'
Please use the 'del' command to remove it from the domain

I should have seen the error on the vm2 disconnect that I saw on vm3?

Version-Release number of selected component (if applicable):
ipa-server-2.2.0-16.el6.x86_64


How reproducible:
always

Steps to Reproduce:
1. install ipa Master
2. install 2 replicas each connected to Master
3. install vm3 as R2 connected to M
4. ipa-replica-manage disconnect $MASTER $REPLICA1
  
Actual results:
disconnect succeeds when it should fail:

[root@vm1 shared]# ipa-replica-manage -p $ADMINPW disconnect vm1.testrelm.com vm2.testrelm.com
Deleted replication agreement from 'vm1.testrelm.com' to 'vm2.testrelm.com'


Expected results:
should have seen something more like this?

[root@vm1 shared]# ipa-replica-manage -p $ADMINPW disconnect vm1.testrelm.com vm3.testrelm.com
Cannot remove the last replication link of 'vm1.testrelm.com'
Please use the 'del' command to remove it from the domain

Additional info:

Comment 2 Scott Poore 2012-07-12 14:09:54 UTC
Also, I'm not sure if this requires a new bug or just related to this but, I cannot seem to reconnect to a disconnected server even if there are still connections.

Example:

install vm4 connected to R3
install vm5 connected to R3
connect vm4 to vm5
disconnect vm4 from vm3
connect vm4 to vm3 fails

[root@vm4 shared]# ipa-replica-manage -p $ADMINPW connect vm4.testrelm.com vm5.testrelm.com
Connected 'vm4.testrelm.com' to 'vm5.testrelm.com'

[root@vm4 shared]# ipa-replica-manage -p $ADMINPW list vm4.testrelm.com
vm3.testrelm.com: replica
vm5.testrelm.com: replica

[root@vm4 shared]# ipa-replica-manage -p $ADMINPW list vm5.testrelm.com
vm3.testrelm.com: replica
vm4.testrelm.com: replica

[root@vm4 shared]# ipa-replica-manage -p $ADMINPW disconnect vm3.testrelm.com vm4.testrelm.com
Deleted replication agreement from 'vm3.testrelm.com' to 'vm4.testrelm.com'

[root@vm4 shared]# ipa-replica-manage -p $ADMINPW list vm4.testrelm.com
vm5.testrelm.com: replica

[root@vm4 shared]# ipa-replica-manage -p $ADMINPW connect vm3.testrelm.com vm4.testrelm.com
You cannot connect to a previously deleted master

Comment 3 Rob Crittenden 2012-07-12 18:28:33 UTC
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/2925

Comment 4 Rob Crittenden 2012-07-18 18:22:46 UTC
Fixed upstream

This fixes two problems.

1. When deleting a link it wasn't checking both sides to see if it was the last link. This would orphan one of them.
2. When reconnecting do a better job of determining if one of the masters had previously been deleted. 

master:
32c1aa45b3d41e15adb2ca8f8713e774046bc340
87040c0af1e76b5477cd53d515ed8071d941ce24

Comment 6 Scott Poore 2012-10-03 14:37:48 UTC
Verified. 

Version ::

ipa-server-3.0.0-2.el6.x86_64

Manual Test Results ::

[root@vm4 ipa]# ipa-replica-manage -p $ADMINPW disconnect vm5.testrelm.com vm6.testrelm.com
ipa: INFO: Setting agreement cn=meTovm5.testrelm.com,cn=replica,cn=dc\=testrelm\,dc\=com,cn=mapping tree,cn=config schedule to 2358-2359 0 to force synch
ipa: INFO: Deleting schedule 2358-2359 0 from agreement cn=meTovm5.testrelm.com,cn=replica,cn=dc\=testrelm\,dc\=com,cn=mapping tree,cn=config
ipa: INFO: Replication Update in progress: FALSE: status: 0 Replica acquired successfully: Incremental update succeeded: start: 0: end: 0
Deleted replication agreement from 'vm5.testrelm.com' to 'vm6.testrelm.com'

[root@vm4 ipa]# ipa-replica-manage -p $ADMINPW list vm4.testrelm.com
vm5.testrelm.com: replica
vm6.testrelm.com: replica

[root@vm4 ipa]# ipa-replica-manage -p $ADMINPW list vm5.testrelm.com
vm4.testrelm.com: replica

[root@vm4 ipa]# ipa-replica-manage -p $ADMINPW list vm6.testrelm.com
vm4.testrelm.com: replica

[root@vm4 ipa]# ipa-replica-manage -p $ADMINPW disconnect vm4.testrelm.com vm5.testrelm.com
Cannot remove the last replication link of 'vm5.testrelm.com'
Please use the 'del' command to remove it from the domain

[root@vm4 ipa]#

Comment 9 errata-xmlrpc 2013-02-21 09:16:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0528.html