summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-08-11 10:56:58 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-08-11 12:53:42 +1000
commit2d21a9bf5eeb88d738e998ee8f1720487b55e12e (patch)
tree8d947bc23c14340949b64a34b0bb3e1e0857e2b2 /source4/dsdb/samdb
parentf36e28d1316bc0bd210933bbdb77241376fe3500 (diff)
downloadsamba-2d21a9bf5eeb88d738e998ee8f1720487b55e12e.tar.gz
samba-2d21a9bf5eeb88d738e998ee8f1720487b55e12e.tar.bz2
samba-2d21a9bf5eeb88d738e998ee8f1720487b55e12e.zip
s4-dsdb: Use only the replication USN for schema reload.
This way we do not track both the partition seq number and the replication USN for schema reload purposes. We only need one indication of actual data change, and the replication per-partition sequence number is no more expensive to obtain than the ldb per-partition sequence number. Andrew Bartlett
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/schema_load.c60
1 files changed, 0 insertions, 60 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/schema_load.c b/source4/dsdb/samdb/ldb_modules/schema_load.c
index 0ba0180e95..2521cab367 100644
--- a/source4/dsdb/samdb/ldb_modules/schema_load.c
+++ b/source4/dsdb/samdb/ldb_modules/schema_load.c
@@ -188,30 +188,6 @@ static struct dsdb_schema *dsdb_schema_refresh(struct ldb_module *module, struct
return schema;
}
- res = talloc_zero(schema, struct ldb_result);
- if (res == NULL) {
- return NULL;
- }
- tseq = talloc_zero(res, struct ldb_seqnum_request);
- if (tseq == NULL) {
- talloc_free(res);
- return NULL;
- }
- tseq->type = LDB_SEQ_HIGHEST_SEQ;
-
- ret = ldb_build_extended_req(&treq, ldb_module_get_ctx(module), res,
- LDB_EXTENDED_SEQUENCE_NUMBER,
- tseq,
- NULL,
- res,
- ldb_extended_default_callback,
- NULL);
- LDB_REQ_SET_LOCATION(treq);
- if (ret != LDB_SUCCESS) {
- talloc_free(res);
- return NULL;
- }
-
/*
* We update right now the last refresh timestamp so that if
* the schema partition hasn't change we don't keep on retrying.
@@ -230,42 +206,6 @@ static struct dsdb_schema *dsdb_schema_refresh(struct ldb_module *module, struct
}
schema->last_refresh = ts;
- ctrl = talloc(treq, struct dsdb_control_current_partition);
- if (!ctrl) {
- talloc_free(res);
- return NULL;
- }
- ctrl->version = DSDB_CONTROL_CURRENT_PARTITION_VERSION;
- ctrl->dn = schema->base_dn;
-
- ret = ldb_request_add_control(treq,
- DSDB_CONTROL_CURRENT_PARTITION_OID,
- false, ctrl);
- if (ret != LDB_SUCCESS) {
- talloc_free(res);
- return NULL;
- }
-
- ret = ldb_next_request(module, treq);
- if (ret != LDB_SUCCESS) {
- talloc_free(res);
- return NULL;
- }
- ret = ldb_wait(treq->handle, LDB_WAIT_ALL);
- if (ret != LDB_SUCCESS) {
- talloc_free(res);
- return NULL;
- }
- tseqr = talloc_get_type(res->extended->data,
- struct ldb_seqnum_result);
- if (tseqr->seq_num == schema->reload_seq_number) {
- talloc_free(res);
- return schema;
- }
-
- schema->reload_seq_number = tseqr->seq_num;
- talloc_free(res);
-
ret = dsdb_module_load_partition_usn(module, schema->base_dn, &current_usn, NULL, NULL);
if (ret != LDB_SUCCESS || current_usn == schema->loaded_usn) {
return schema;