c58629
From 469f8ba59eb369267a9d404291ce7794f996d9f4 Mon Sep 17 00:00:00 2001
c58629
From: Alexander Bokovoy <abokovoy@redhat.com>
c58629
Date: Mon, 16 Oct 2017 13:46:38 +0300
c58629
Subject: [PATCH] ipa-replica-manage: implicitly ignore initial time skew in
c58629
 force-sync
c58629
c58629
When performing force synchronization, implicitly ignore initial
c58629
time skew (if any) and restore it afterwards.
c58629
c58629
This also changes semantics of force-sync by waiting until the end of
c58629
the initial replication.
c58629
c58629
Fixes https://pagure.io/freeipa/issue/7211
c58629
c58629
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
c58629
---
c58629
 install/tools/ipa-replica-manage | 6 ++++++
c58629
 1 file changed, 6 insertions(+)
c58629
c58629
diff --git a/install/tools/ipa-replica-manage b/install/tools/ipa-replica-manage
c58629
index f802201b7f93facb1e78463aa02eab66a1ae23ea..c00d8ca3a0fa8228c5aa782a270991f14ee16974 100755
c58629
--- a/install/tools/ipa-replica-manage
c58629
+++ b/install/tools/ipa-replica-manage
c58629
@@ -1231,8 +1231,14 @@ def force_sync(realm, thishost, fromhost, dirman_passwd, nolookup=False):
c58629
         repl = replication.ReplicationManager(realm, thishost, dirman_passwd)
c58629
         repl.force_sync(repl.conn, fromhost)
c58629
     else:
c58629
+        ds = dsinstance.DsInstance(realm_name=realm)
c58629
+        ds.ldapi = os.getegid() == 0
c58629
+        ds.replica_manage_time_skew(prevent=False)
c58629
         repl = replication.ReplicationManager(realm, fromhost, dirman_passwd)
c58629
         repl.force_sync(repl.conn, thishost)
c58629
+        agreement = repl.get_replication_agreement(thishost)
c58629
+        repl.wait_for_repl_init(repl.conn, agreement.dn)
c58629
+        ds.replica_manage_time_skew(prevent=True)
c58629
 
c58629
 def show_DNA_ranges(hostname, master, realm, dirman_passwd, nextrange=False,
c58629
                     nolookup=False):
c58629
-- 
c58629
2.9.5
c58629