struct dsdb_partition *p;
int ret;
- p = find_partition(data, NULL, req);
- if (p != NULL) {
- /* the caller specified what partition they want the
- * sequence number operation on - just pass it on
- */
- return ldb_next_request(p->module, req);
- }
-
seq = talloc_get_type_abort(req->op.extended.data, struct ldb_seqnum_request);
switch (seq->type) {
case LDB_SEQ_NEXT:
break;
case LDB_SEQ_HIGHEST_SEQ:
+
+ /*
+ * We can only query per-partition the individual
+ * partition sequence number, so we don't need to run
+ * this reload for every query of the next global seq
+ * number
+ */
+ ret = partition_reload_if_required(module, data, req);
+ if (ret != LDB_SUCCESS) {
+ return ret;
+ }
+
+ p = find_partition(data, NULL, req);
+ if (p != NULL) {
+ /* the caller specified what partition they want the
+ * sequence number operation on - just pass it on
+ */
+ return ldb_next_request(p->module, req);
+ }
+
ret = partition_metadata_sequence_number(module, &seq_number);
if (ret != LDB_SUCCESS) {
return ret;
ret = partition_metadata_inc_schema_sequence(module);
return ldb_module_done(req, NULL, NULL, ret);
}
-
- /* see if we are still up-to-date */
- ret = partition_reload_if_required(module, data, req);
- if (ret != LDB_SUCCESS) {
- return ret;
- }
if (strcmp(req->op.extended.oid, LDB_EXTENDED_SEQUENCE_NUMBER) == 0) {
return partition_sequence_number(module, req);
return LDB_ERR_UNWILLING_TO_PERFORM;
}
+ /* see if we are still up-to-date */
+ ret = partition_reload_if_required(module, data, req);
+ if (ret != LDB_SUCCESS) {
+ return ret;
+ }
+
for (i=0; data->partitions && data->partitions[i]; i++) {
if (ldb_dn_compare(data->partitions[i]->ctrl->dn, dn) == 0) {
partition = data->partitions[i];