diff --git a/source/dsdb/repl/drepl_out_helpers.c b/source/dsdb/repl/drepl_out_helpers.c index 694d89dfe34..281e5691e26 100644 --- a/source/dsdb/repl/drepl_out_helpers.c +++ b/source/dsdb/repl/drepl_out_helpers.c @@ -365,6 +365,7 @@ static void dreplsrv_op_pull_source_apply_changes_send(struct dreplsrv_op_pull_s linked_attributes = NULL; rf1.highwatermark = ctr1->new_highwatermark; uptodateness_vector = NULL; /* TODO: map it */ + more_data = ctr1->more_data; break; case 6: mapping_ctr = &ctr6->mapping_ctr; @@ -374,6 +375,7 @@ static void dreplsrv_op_pull_source_apply_changes_send(struct dreplsrv_op_pull_s linked_attributes = ctr6->linked_attributes; rf1.highwatermark = ctr6->new_highwatermark; uptodateness_vector = ctr6->uptodateness_vector; + more_data = ctr6->more_data; break; default: composite_error(c, werror_to_ntstatus(WERR_BAD_NET_RESP)); @@ -404,14 +406,6 @@ static void dreplsrv_op_pull_source_apply_changes_send(struct dreplsrv_op_pull_s * TODO: update our uptodatevector! */ - /* - * if the tmp_highest_usn is higher than highest_usn - * there's more to pull from this source_dsa - */ - if (rf1.highwatermark.tmp_highest_usn > rf1.highwatermark.highest_usn) { - more_data = true; - } - if (more_data) { dreplsrv_op_pull_source_get_changes_send(st); return; diff --git a/source/libnet/libnet_become_dc.c b/source/libnet/libnet_become_dc.c index 1f7444062a9..3fece1a9bab 100644 --- a/source/libnet/libnet_become_dc.c +++ b/source/libnet/libnet_become_dc.c @@ -2434,6 +2434,7 @@ static WERROR becomeDC_drsuapi_pull_partition_recv(struct libnet_BecomeDC_state struct GUID *source_dsa_guid; struct GUID *source_dsa_invocation_id; struct drsuapi_DsReplicaHighWaterMark *new_highwatermark; + bool more_data = false; NTSTATUS nt_status; if (!W_ERROR_IS_OK(r->out.result)) { @@ -2474,17 +2475,20 @@ static WERROR becomeDC_drsuapi_pull_partition_recv(struct libnet_BecomeDC_state source_dsa_guid = &ctr1->source_dsa_guid; source_dsa_invocation_id = &ctr1->source_dsa_invocation_id; new_highwatermark = &ctr1->new_highwatermark; + more_data = ctr1->more_data; break; case 6: source_dsa_guid = &ctr6->source_dsa_guid; source_dsa_invocation_id = &ctr6->source_dsa_invocation_id; new_highwatermark = &ctr6->new_highwatermark; + more_data = ctr6->more_data; break; } partition->highwatermark = *new_highwatermark; partition->source_dsa_guid = *source_dsa_guid; partition->source_dsa_invocation_id = *source_dsa_invocation_id; + partition->more_data = more_data; if (!partition->store_chunk) return WERR_OK; @@ -2565,7 +2569,7 @@ static void becomeDC_drsuapi3_pull_schema_recv(struct rpc_request *req) talloc_free(r); - if (s->schema_part.highwatermark.tmp_highest_usn > s->schema_part.highwatermark.highest_usn) { + if (s->schema_part.more_data) { becomeDC_drsuapi_pull_partition_send(s, &s->drsuapi2, &s->drsuapi3, &s->schema_part, becomeDC_drsuapi3_pull_schema_recv); return; @@ -2627,7 +2631,7 @@ static void becomeDC_drsuapi3_pull_config_recv(struct rpc_request *req) talloc_free(r); - if (s->config_part.highwatermark.tmp_highest_usn > s->config_part.highwatermark.highest_usn) { + if (s->config_part.more_data) { becomeDC_drsuapi_pull_partition_send(s, &s->drsuapi2, &s->drsuapi3, &s->config_part, becomeDC_drsuapi3_pull_config_recv); return; @@ -2694,7 +2698,7 @@ static void becomeDC_drsuapi3_pull_domain_recv(struct rpc_request *req) talloc_free(r); - if (s->domain_part.highwatermark.tmp_highest_usn > s->domain_part.highwatermark.highest_usn) { + if (s->domain_part.more_data) { becomeDC_drsuapi_pull_partition_send(s, &s->drsuapi2, &s->drsuapi3, &s->domain_part, becomeDC_drsuapi3_pull_domain_recv); return; diff --git a/source/libnet/libnet_become_dc.h b/source/libnet/libnet_become_dc.h index 47b28967137..58fc4dc15d4 100644 --- a/source/libnet/libnet_become_dc.h +++ b/source/libnet/libnet_become_dc.h @@ -94,6 +94,7 @@ struct libnet_BecomeDC_Partition { struct GUID source_dsa_guid; struct GUID source_dsa_invocation_id; struct drsuapi_DsReplicaHighWaterMark highwatermark; + bool more_data; uint32_t replica_flags; NTSTATUS (*store_chunk)(void *private_data, diff --git a/source/libnet/libnet_vampire.c b/source/libnet/libnet_vampire.c index c9975c8a295..fed57dbdcf1 100644 --- a/source/libnet/libnet_vampire.c +++ b/source/libnet/libnet_vampire.c @@ -426,7 +426,7 @@ static NTSTATUS vampire_schema_chunk(void *private_data, for (cur = first_object; cur->next_object; cur = cur->next_object) {} s->schema_part.last_object = cur; - if (c->partition->highwatermark.tmp_highest_usn == c->partition->highwatermark.highest_usn) { + if (!c->partition->more_data) { return vampire_apply_schema(s, c); } diff --git a/source/torture/libnet/libnet_BecomeDC.c b/source/torture/libnet/libnet_BecomeDC.c index 2631746e951..2cea8e9a9b6 100644 --- a/source/torture/libnet/libnet_BecomeDC.c +++ b/source/torture/libnet/libnet_BecomeDC.c @@ -416,7 +416,7 @@ static NTSTATUS test_become_dc_schema_chunk(void *private_data, for (cur = first_object; cur->next_object; cur = cur->next_object) {} s->schema_part.last_object = cur; - if (c->partition->highwatermark.tmp_highest_usn == c->partition->highwatermark.highest_usn) { + if (!c->partition->more_data) { return test_apply_schema(s, c); } diff --git a/source/torture/rpc/dssync.c b/source/torture/rpc/dssync.c index 9c07e5f532e..053f78e99b9 100644 --- a/source/torture/rpc/dssync.c +++ b/source/torture/rpc/dssync.c @@ -711,7 +711,7 @@ static bool test_FetchData(struct torture_context *tctx, struct DsSyncTest *ctx) test_analyse_objects(tctx, ctx, &gensec_skey, ctr1->first_object); - if (ctr1->new_highwatermark.tmp_highest_usn > ctr1->new_highwatermark.highest_usn) { + if (ctr1->more_data) { r.in.req.req5.highwatermark = ctr1->new_highwatermark; continue; } @@ -739,7 +739,7 @@ static bool test_FetchData(struct torture_context *tctx, struct DsSyncTest *ctx) test_analyse_objects(tctx, ctx, &gensec_skey, ctr6->first_object); - if (ctr6->new_highwatermark.tmp_highest_usn > ctr6->new_highwatermark.highest_usn) { + if (ctr6->more_data) { r.in.req.req8.highwatermark = ctr6->new_highwatermark; continue; }