svn commit: samba r13035 - in branches/SAMBA_4_0/source:
torture/nbt wrepl_server
metze at samba.org
metze at samba.org
Thu Jan 19 13:01:13 GMT 2006
Author: metze
Date: 2006-01-19 13:01:12 +0000 (Thu, 19 Jan 2006)
New Revision: 13035
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13035
Log:
active,special group replicas are overwritten by tombstone,special group replicas
metze
Modified:
branches/SAMBA_4_0/source/torture/nbt/winsreplication.c
branches/SAMBA_4_0/source/wrepl_server/wrepl_apply_records.c
Changeset:
Modified: branches/SAMBA_4_0/source/torture/nbt/winsreplication.c
===================================================================
--- branches/SAMBA_4_0/source/torture/nbt/winsreplication.c 2006-01-19 10:28:11 UTC (rev 13034)
+++ branches/SAMBA_4_0/source/torture/nbt/winsreplication.c 2006-01-19 13:01:12 UTC (rev 13035)
@@ -4623,7 +4623,129 @@
.apply_expected = True,
}
},
+
/*
+ * sgroup,active vs. sgroup,tombstone different no addresses, special
+ * => should be replaced
+ */
+ {
+ .line = __location__,
+ .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
+ .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:NULL",
+ .extra = True,
+ .r1 = {
+ .owner = &ctx->a,
+ .type = WREPL_TYPE_SGROUP,
+ .state = WREPL_STATE_ACTIVE,
+ .node = WREPL_NODE_B,
+ .is_static = False,
+ .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
+ .ips = addresses_B_3_4_X_3_4,
+ .apply_expected = True,
+ },
+ .r2 = {
+ .owner = &ctx->b,
+ .type = WREPL_TYPE_SGROUP,
+ .state = WREPL_STATE_TOMBSTONE,
+ .node = WREPL_NODE_B,
+ .is_static = False,
+ .num_ips = 0,
+ .ips = NULL,
+ .apply_expected = True,
+ }
+ },
+ /*
+ * sgroup,active vs. sgroup,tombstone different addresses
+ * => should be replaced
+ */
+ {
+ .line = __location__,
+ .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
+ .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4",
+ .extra = True,
+ .r1 = {
+ .owner = &ctx->a,
+ .type = WREPL_TYPE_SGROUP,
+ .state = WREPL_STATE_ACTIVE,
+ .node = WREPL_NODE_B,
+ .is_static = False,
+ .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
+ .ips = addresses_B_3_4_X_3_4,
+ .apply_expected = True,
+ },
+ .r2 = {
+ .owner = &ctx->b,
+ .type = WREPL_TYPE_SGROUP,
+ .state = WREPL_STATE_TOMBSTONE,
+ .node = WREPL_NODE_B,
+ .is_static = False,
+ .num_ips = ARRAY_SIZE(addresses_A_3_4),
+ .ips = addresses_A_3_4,
+ .apply_expected = True,
+ }
+ },
+ /*
+ * sgroup,active vs. sgroup,tombstone subset addresses
+ * => should be replaced
+ */
+ {
+ .line = __location__,
+ .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
+ .comment= "A:B_3_4_X_3_4 vs. B:B_3_4 => B:B_3_4",
+ .extra = True,
+ .r1 = {
+ .owner = &ctx->a,
+ .type = WREPL_TYPE_SGROUP,
+ .state = WREPL_STATE_ACTIVE,
+ .node = WREPL_NODE_B,
+ .is_static = False,
+ .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
+ .ips = addresses_B_3_4_X_3_4,
+ .apply_expected = True,
+ },
+ .r2 = {
+ .owner = &ctx->b,
+ .type = WREPL_TYPE_SGROUP,
+ .state = WREPL_STATE_TOMBSTONE,
+ .node = WREPL_NODE_B,
+ .is_static = False,
+ .num_ips = ARRAY_SIZE(addresses_B_3_4),
+ .ips = addresses_B_3_4,
+ .apply_expected = True,
+ }
+ },
+ /*
+ * sgroup,active vs. sgroup,active same addresses
+ * => should be replaced
+ */
+ {
+ .line = __location__,
+ .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
+ .comment= "A:B_3_4_X_3_4 vs. B:B_3_4_X_3_4 => B:B_3_4_X_3_4",
+ .extra = True,
+ .r1 = {
+ .owner = &ctx->a,
+ .type = WREPL_TYPE_SGROUP,
+ .state = WREPL_STATE_ACTIVE,
+ .node = WREPL_NODE_B,
+ .is_static = False,
+ .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
+ .ips = addresses_B_3_4_X_3_4,
+ .apply_expected = True,
+ },
+ .r2 = {
+ .owner = &ctx->b,
+ .type = WREPL_TYPE_SGROUP,
+ .state = WREPL_STATE_TOMBSTONE,
+ .node = WREPL_NODE_B,
+ .is_static = False,
+ .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
+ .ips = addresses_B_3_4_X_3_4,
+ .apply_expected = True,
+ }
+ },
+
+ /*
* This should be the last record in this array,
* we need to make sure the we leave a tombstoned unique entry
* owned by OWNER_A
Modified: branches/SAMBA_4_0/source/wrepl_server/wrepl_apply_records.c
===================================================================
--- branches/SAMBA_4_0/source/wrepl_server/wrepl_apply_records.c 2006-01-19 10:28:11 UTC (rev 13034)
+++ branches/SAMBA_4_0/source/wrepl_server/wrepl_apply_records.c 2006-01-19 13:01:12 UTC (rev 13035)
@@ -265,6 +265,14 @@
SGROUP,ACTIVE vs. SGROUP,ACTIVE A:A_3_4_X_3_4 vs. B:A_3_4_OWNER_B => B:A_3_4_OWNER_B_X_3_4 => SGROUP_MERGE
SGROUP,ACTIVE vs. SGROUP,ACTIVE A:B_3_4_X_3_4 vs. B:B_3_4_X_1_2 => C:B_3_4_X_1_2_3_4 => SGROUP_MERGE
SGROUP,ACTIVE vs. SGROUP,ACTIVE A:B_3_4_X_3_4 vs. B:NULL => B:X_3_4 => SGROUP_MERGE
+
+
+this is a bit strange, incoming tombstone replicas always replace old replicas:
+
+SGROUP,ACTIVE vs. SGROUP,TOMBSTONE A:B_3_4_X_3_4 vs. B:NULL => B:NULL => REPLACE
+SGROUP,ACTIVE vs. SGROUP,TOMBSTONE A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4 => REPLACE
+SGROUP,ACTIVE vs. SGROUP,TOMBSTONE A:B_3_4_X_3_4 vs. B:B_3_4 => B:B_3_4 => REPLACE
+SGROUP,ACTIVE vs. SGROUP,TOMBSTONE A:B_3_4_X_3_4 vs. B:B_3_4_X_3_4 => B:B_3_4_X_3_4 => REPLACE
*/
static enum _R_ACTION replace_sgroup_replica_vs_X_replica(struct winsdb_record *r1, struct wrepl_name *r2)
{
@@ -273,11 +281,21 @@
return R_DO_REPLACE;
}
- if (!R_IS_SGROUP(r2) || !R_IS_ACTIVE(r2)) {
+ if (!R_IS_SGROUP(r2)) {
/* NOT REPLACE */
return R_NOT_REPLACE;
}
+ /*
+ * this is strange, but correct
+ * the incoming tombstone replace the current active
+ * record
+ */
+ if (!R_IS_ACTIVE(r2)) {
+ /* REPLACE */
+ return R_DO_REPLACE;
+ }
+
if (r2->num_addresses == 0) {
if (r_contains_addrs_from_owner(r1, r2->owner)) {
/* not handled here: MERGE */
More information about the samba-cvs
mailing list