r13059: stop playing ping-pong while replicating special group records,
authorStefan Metzmacher <metze@samba.org>
Sat, 21 Jan 2006 07:57:39 +0000 (07:57 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:51:20 +0000 (13:51 -0500)
if the addresses and their owners are idetical to the old record
and we're the owner of the old record then we should just gnore the replica

metze
(This used to be commit e4f823ef038eeb74a8a6de05207f2f9aae7262a1)

source4/wrepl_server/wrepl_apply_records.c

index 0eab6484c87c750142cb2ef865f3971e66144524..f41957a210b2c4aec6909c17551ff35f93b8077e 100644 (file)
@@ -415,8 +415,8 @@ static enum _R_ACTION replace_unique_owned_vs_X_replica(struct winsdb_record *r1
        }
 
        if (!R_IS_ACTIVE(r2)) {
-               /* NOT REPLACE */
-               return R_NOT_REPLACE;
+               /* NOT REPLACE, and PROPAGATE */
+               return R_DO_PROPAGATE;
        }
 
        if (R_IS_GROUP(r2) || R_IS_SGROUP(r2)) {
@@ -494,8 +494,8 @@ static enum _R_ACTION replace_group_owned_vs_X_replica(struct winsdb_record *r1,
                }
        }
 
-       /* NOT REPLACE */
-       return R_NOT_REPLACE;
+       /* NOT REPLACE, but PROPAGATE */
+       return R_DO_PROPAGATE;
 }
 
 /*
@@ -551,14 +551,17 @@ static enum _R_ACTION replace_sgroup_owned_vs_X_replica(struct winsdb_record *r1
        }
 
        if (!R_IS_SGROUP(r2) || !R_IS_ACTIVE(r2)) {
-               /* NOT REPLACE */
-               return R_NOT_REPLACE;
+               /* NOT REPLACE, but PROPAGATE */
+               return R_DO_PROPAGATE;
        }
 
-       /*
-        * TODO: should we have the same logic here like in 
-        *       replace_sgroup_replica_vs_X_replica() ?
-        */
+       if (r_1_is_same_as_2_address_list(r1, r2, True)) {
+               /*
+                * as we're the old owner and the addresses and their
+                * owners are identical
+                */
+               return R_NOT_REPLACE;
+       }
 
        /* not handled here: MERGE */
        return R_DO_SGROUP_MERGE;
@@ -624,8 +627,8 @@ static enum _R_ACTION replace_mhomed_owned_vs_X_replica(struct winsdb_record *r1
        }
 
        if (!R_IS_ACTIVE(r2)) {
-               /* NOT REPLACE */
-               return R_NOT_REPLACE;
+               /* NOT REPLACE, but PROPAGATE */
+               return R_DO_PROPAGATE;
        }
 
        if (R_IS_GROUP(r2) || R_IS_SGROUP(r2)) {
@@ -1341,15 +1344,6 @@ static NTSTATUS wreplsrv_apply_one_record(struct wreplsrv_partner *partner,
                        action = replace_mhomed_owned_vs_X_replica(rec, replica);
                        break;
                }
-
-               /*
-                * if we own the local record, and it should not be replaced
-                * then propagate the conflict result back to the other
-                * wins servers
-                */
-               if (action == R_NOT_REPLACE) {
-                       action = R_DO_PROPAGATE;
-               }
        }
 
        DEBUG(4,("apply record %s: %s\n",
@@ -1367,7 +1361,7 @@ static NTSTATUS wreplsrv_apply_one_record(struct wreplsrv_partner *partner,
                return r_do_challenge(partner, mem_ctx, rec, owner, replica);
        case R_DO_RELEASE_DEMAND:
                return r_do_release_demand(partner, mem_ctx, rec, owner, replica);
-       case R_DO_SGROUP_MERGE: 
+       case R_DO_SGROUP_MERGE:
                return r_do_sgroup_merge(partner, mem_ctx, rec, owner, replica);
        }