mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
s4-repl: cleanup the extended op calls in repl server
- use generic parameter names - trigger a run of pending ops on all extended ops - don't prevent parallel fsmo transfers - moved extended op code into drepl_extended
This commit is contained in:
parent
aabd89d8f7
commit
d5673b5501
@ -113,7 +113,7 @@ static WERROR drepl_create_extended_source_dsa(struct dreplsrv_service *service,
|
||||
}
|
||||
|
||||
struct extended_op_data {
|
||||
dreplsrv_fsmo_callback_t callback;
|
||||
dreplsrv_extended_callback_t callback;
|
||||
void *callback_data;
|
||||
struct dreplsrv_partition_source_dsa *sdsa;
|
||||
};
|
||||
@ -136,18 +136,18 @@ static void extended_op_callback(struct dreplsrv_service *service,
|
||||
schedule a getncchanges request to the role owner for an extended operation
|
||||
*/
|
||||
WERROR drepl_request_extended_op(struct dreplsrv_service *service,
|
||||
struct ldb_dn *role_owner_dn,
|
||||
struct ldb_dn *fsmo_role_dn,
|
||||
struct ldb_dn *nc_dn,
|
||||
struct ldb_dn *source_dsa_dn,
|
||||
enum drsuapi_DsExtendedOperation extended_op,
|
||||
uint64_t fsmo_info,
|
||||
dreplsrv_fsmo_callback_t callback,
|
||||
dreplsrv_extended_callback_t callback,
|
||||
void *callback_data)
|
||||
{
|
||||
WERROR werr;
|
||||
struct extended_op_data *data;
|
||||
struct dreplsrv_partition_source_dsa *sdsa;
|
||||
|
||||
werr = drepl_create_extended_source_dsa(service, role_owner_dn, fsmo_role_dn, &sdsa);
|
||||
werr = drepl_create_extended_source_dsa(service, nc_dn, source_dsa_dn, &sdsa);
|
||||
W_ERROR_NOT_OK_RETURN(werr);
|
||||
|
||||
data = talloc(service, struct extended_op_data);
|
||||
@ -164,5 +164,8 @@ WERROR drepl_request_extended_op(struct dreplsrv_service *service,
|
||||
talloc_free(sdsa);
|
||||
talloc_free(data);
|
||||
}
|
||||
|
||||
dreplsrv_run_pending_ops(service);
|
||||
|
||||
return werr;
|
||||
}
|
||||
|
@ -43,7 +43,6 @@ static void drepl_role_callback(struct dreplsrv_service *service,
|
||||
} else {
|
||||
DEBUG(0,(__location__ ": Successful role transfer\n"));
|
||||
}
|
||||
service->role_transfer_in_progress = false;
|
||||
}
|
||||
|
||||
static bool fsmo_master_cmp(struct ldb_dn *ntds_dn, struct ldb_dn *role_owner_dn)
|
||||
@ -69,12 +68,6 @@ WERROR dreplsrv_fsmo_role_check(struct dreplsrv_service *service,
|
||||
enum drsuapi_DsExtendedOperation extended_op = DRSUAPI_EXOP_NONE;
|
||||
WERROR werr;
|
||||
|
||||
if (service->role_transfer_in_progress) {
|
||||
talloc_free(tmp_ctx);
|
||||
/* should we allow these in parallel? */
|
||||
return WERR_DS_DRA_REPL_PENDING;
|
||||
}
|
||||
|
||||
ntds_dn = samdb_ntds_settings_dn(ldb);
|
||||
if (!ntds_dn) {
|
||||
return WERR_DS_DRA_INTERNAL_ERROR;
|
||||
|
@ -38,7 +38,7 @@ WERROR dreplsrv_schedule_partition_pull_source(struct dreplsrv_service *s,
|
||||
struct dreplsrv_partition_source_dsa *source,
|
||||
enum drsuapi_DsExtendedOperation extended_op,
|
||||
uint64_t fsmo_info,
|
||||
dreplsrv_fsmo_callback_t callback,
|
||||
dreplsrv_extended_callback_t callback,
|
||||
void *cb_data)
|
||||
{
|
||||
struct dreplsrv_out_operation *op;
|
||||
|
@ -170,7 +170,7 @@ static WERROR _drepl_schedule_replication(struct dreplsrv_service *service,
|
||||
TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
WERROR werr;
|
||||
dreplsrv_fsmo_callback_t fn_callback = NULL;
|
||||
dreplsrv_extended_callback_t fn_callback = NULL;
|
||||
|
||||
if (data) {
|
||||
fn_callback = _drepl_replica_sync_done_cb;
|
||||
@ -358,12 +358,19 @@ static NTSTATUS drepl_take_FSMO_role(struct irpc_message *msg,
|
||||
static NTSTATUS drepl_trigger_repl_secret(struct irpc_message *msg,
|
||||
struct drepl_trigger_repl_secret *r)
|
||||
{
|
||||
struct dreplsrv_service *service = talloc_get_type(msg->private_data,
|
||||
struct dreplsrv_service);
|
||||
|
||||
|
||||
drepl_repl_secret(service, r->in.user_dn);
|
||||
|
||||
/* we are not going to be sending a reply to this request */
|
||||
msg->no_reply = true;
|
||||
DEBUG(0,(__location__ ": got drepl_trigger_repl_secret with %s\n", r->in.user_dn));
|
||||
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
startup the dsdb replicator service task
|
||||
*/
|
||||
|
@ -103,10 +103,10 @@ struct dreplsrv_partition {
|
||||
bool incoming_only;
|
||||
};
|
||||
|
||||
typedef void (*dreplsrv_fsmo_callback_t)(struct dreplsrv_service *,
|
||||
WERROR,
|
||||
enum drsuapi_DsExtendedError,
|
||||
void *cb_data);
|
||||
typedef void (*dreplsrv_extended_callback_t)(struct dreplsrv_service *,
|
||||
WERROR,
|
||||
enum drsuapi_DsExtendedError,
|
||||
void *cb_data);
|
||||
|
||||
struct dreplsrv_out_operation {
|
||||
struct dreplsrv_out_operation *prev, *next;
|
||||
@ -118,7 +118,7 @@ struct dreplsrv_out_operation {
|
||||
enum drsuapi_DsExtendedOperation extended_op;
|
||||
uint64_t fsmo_info;
|
||||
enum drsuapi_DsExtendedError extended_ret;
|
||||
dreplsrv_fsmo_callback_t callback;
|
||||
dreplsrv_extended_callback_t callback;
|
||||
void *cb_data;
|
||||
};
|
||||
|
||||
@ -217,7 +217,6 @@ struct dreplsrv_service {
|
||||
} ops;
|
||||
|
||||
bool rid_alloc_in_progress;
|
||||
bool role_transfer_in_progress;
|
||||
|
||||
bool syncall_workaround;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user