From 78220857bd3c420fd2b09b1a83eaae23ec2e0c33 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Wed, 13 Jun 2012 15:06:14 -0400 Subject: drop support for directory server transactions Transaction support the way we added it is an all-or-nothing proposition for a server installation, which turned out to be problematic, so 389 is going to pursue another strategy for that. The new way requires that we not register as a betxn plugin, ever. --- src/back-shr.c | 157 --------------------------------------------------------- 1 file changed, 157 deletions(-) (limited to 'src/back-shr.c') diff --git a/src/back-shr.c b/src/back-shr.c index 101b857..a2c31c9 100644 --- a/src/back-shr.c +++ b/src/back-shr.c @@ -900,27 +900,6 @@ backend_shr_update_references_cb(const char *group, const char *set, cbdata = cbdata_ptr; state = set_data->state; -#ifdef USE_SLAPI_BE_TXNS - /* If the backend type is "ldbm database" and we have no transaction, - * do nothing, because we'll be called again later post-transaction, - * and we'll deal with it then. */ - if (cbdata->pb != NULL) { - void *txn; - char *be_type; - txn = NULL; - be_type = NULL; -#ifdef SLAPI_TXN - slapi_pblock_get(cbdata->pb, SLAPI_TXN, &txn); -#endif -#ifdef SLAPI_TXN - slapi_pblock_get(cbdata->pb, SLAPI_BE_TYPE, &be_type); -#endif - if ((txn == NULL) && (strcmp(be_type, "ldbm database") == 0)) { - return 0; - } - } -#endif - /* If the entry didn't change any attributes which are at all relevant * to this map, then we don't need to recompute anything. */ if (set_data->skip_uninteresting_updates && @@ -1559,27 +1538,6 @@ backend_shr_add_cb(Slapi_PBlock *pb) return 0; } -#ifdef USE_SLAPI_BE_TXNS - /* If the backend type is "ldbm database" and we have no transaction, - * do nothing, because we'll be called again later post-transaction, - * and we'll deal with it then. */ - if (pb != NULL) { - void *txn; - char *be_type; - txn = NULL; - be_type = NULL; -#ifdef SLAPI_TXN - slapi_pblock_get(pb, SLAPI_TXN, &txn); -#endif -#ifdef SLAPI_TXN - slapi_pblock_get(pb, SLAPI_BE_TYPE, &be_type); -#endif - if ((txn == NULL) && (strcmp(be_type, "ldbm database") == 0)) { - return 0; - } - } -#endif - /* Read parameters from the pblock. */ slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &cbdata.state); if (cbdata.state->plugin_base == NULL) { @@ -1952,27 +1910,6 @@ backend_shr_modify_cb(Slapi_PBlock *pb) return 0; } -#ifdef USE_SLAPI_BE_TXNS - /* If the backend type is "ldbm database" and we have no transaction, - * do nothing, because we'll be called again later post-transaction, - * and we'll deal with it then. */ - if (pb != NULL) { - void *txn; - char *be_type; - txn = NULL; - be_type = NULL; -#ifdef SLAPI_TXN - slapi_pblock_get(pb, SLAPI_TXN, &txn); -#endif -#ifdef SLAPI_TXN - slapi_pblock_get(pb, SLAPI_BE_TYPE, &be_type); -#endif - if ((txn == NULL) && (strcmp(be_type, "ldbm database") == 0)) { - return 0; - } - } -#endif - /* Read parameters from the pblock. */ slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &cbdata.state); if (cbdata.state->plugin_base == NULL) { @@ -2142,27 +2079,6 @@ backend_shr_modrdn_cb(Slapi_PBlock *pb) return 0; } -#ifdef USE_SLAPI_BE_TXNS - /* If the backend type is "ldbm database" and we have no transaction, - * do nothing, because we'll be called again later post-transaction, - * and we'll deal with it then. */ - if (pb != NULL) { - void *txn; - char *be_type; - txn = NULL; - be_type = NULL; -#ifdef SLAPI_TXN - slapi_pblock_get(pb, SLAPI_TXN, &txn); -#endif -#ifdef SLAPI_TXN - slapi_pblock_get(pb, SLAPI_BE_TYPE, &be_type); -#endif - if ((txn == NULL) && (strcmp(be_type, "ldbm database") == 0)) { - return 0; - } - } -#endif - /* Read parameters from the pblock. */ slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &cbdata.state); if (cbdata.state->plugin_base == NULL) { @@ -2274,27 +2190,6 @@ backend_shr_delete_cb(Slapi_PBlock *pb) return 0; } -#ifdef USE_SLAPI_BE_TXNS - /* If the backend type is "ldbm database" and we have no transaction, - * do nothing, because we'll be called again later post-transaction, - * and we'll deal with it then. */ - if (pb != NULL) { - void *txn; - char *be_type; - txn = NULL; - be_type = NULL; -#ifdef SLAPI_TXN - slapi_pblock_get(pb, SLAPI_TXN, &txn); -#endif -#ifdef SLAPI_TXN - slapi_pblock_get(pb, SLAPI_BE_TYPE, &be_type); -#endif - if ((txn == NULL) && (strcmp(be_type, "ldbm database") == 0)) { - return 0; - } - } -#endif - /* Read parameters from the pblock. */ slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &cbdata.state); if (cbdata.state->plugin_base == NULL) { @@ -2406,55 +2301,3 @@ backend_shr_internal_postop_init(Slapi_PBlock *pb, struct plugin_state *state) } return 0; } - -#ifdef USE_SLAPI_BE_TXNS -static int -backend_shr_be_txn_post_add_cb(Slapi_PBlock *pb) -{ - return backend_shr_add_cb(pb); -} -static int -backend_shr_be_txn_post_modify_cb(Slapi_PBlock *pb) -{ - return backend_shr_modify_cb(pb); -} -static int -backend_shr_be_txn_post_modrdn_cb(Slapi_PBlock *pb) -{ - return backend_shr_modrdn_cb(pb); -} -static int -backend_shr_be_txn_post_delete_cb(Slapi_PBlock *pb) -{ - return backend_shr_delete_cb(pb); -} -int -backend_shr_be_txn_postop_init(Slapi_PBlock *pb, struct plugin_state *state) -{ - if (slapi_pblock_set(pb, SLAPI_PLUGIN_BE_TXN_POST_ADD_FN, - backend_shr_be_txn_post_add_cb) != 0) { - slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, - "error hooking up be-txn-post add callback\n"); - return -1; - } - if (slapi_pblock_set(pb, SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN, - backend_shr_be_txn_post_modify_cb) != 0) { - slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, - "error hooking up be-txn-post modify callback\n"); - return -1; - } - if (slapi_pblock_set(pb, SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN, - backend_shr_be_txn_post_modrdn_cb) != 0) { - slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, - "error hooking up be-txn-post modrdn callback\n"); - return -1; - } - if (slapi_pblock_set(pb, SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN, - backend_shr_be_txn_post_delete_cb) != 0) { - slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, - "error hooking up be-txn-post delete callback\n"); - return -1; - } - return 0; -} -#endif -- cgit