summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@dahyabhai.net>2012-06-13 15:06:14 -0400
committerNalin Dahyabhai <nalin@dahyabhai.net>2012-06-13 15:06:14 -0400
commit78220857bd3c420fd2b09b1a83eaae23ec2e0c33 (patch)
tree89374acc9a2fda18f86e977721bdf7594d6336ad
parentc18ffce4be91de84a3c5e56895336829bdc16846 (diff)
downloadslapi-nis-78220857bd3c420fd2b09b1a83eaae23ec2e0c33.tar.gz
slapi-nis-78220857bd3c420fd2b09b1a83eaae23ec2e0c33.tar.xz
slapi-nis-78220857bd3c420fd2b09b1a83eaae23ec2e0c33.zip
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.
-rw-r--r--configure.ac22
-rw-r--r--src/back-nis.c10
-rw-r--r--src/back-sch.c10
-rw-r--r--src/back-shr.c157
-rw-r--r--src/back-shr.h3
-rw-r--r--src/backend.h4
-rw-r--r--src/plug-nis.c28
-rw-r--r--src/plug-sch.c28
-rw-r--r--src/wrap.c13
9 files changed, 0 insertions, 275 deletions
diff --git a/configure.ac b/configure.ac
index 0bcb8cd..66c978e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -105,10 +105,6 @@ dirsrv)
SLAPI_PLUGIN_INTERNAL_POST_MODIFY_FN,
SLAPI_PLUGIN_INTERNAL_POST_MODRDN_FN,
SLAPI_PLUGIN_INTERNAL_POST_DELETE_FN,
- SLAPI_PLUGIN_BE_TXN_POST_ADD_FN,
- SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN,
- SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN,
- SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN,
NULL]
,,,
[AC_INCLUDES_DEFAULT
@@ -121,24 +117,6 @@ dirsrv)
else
thread_lock_api=POSIX
fi
- AC_MSG_CHECKING([whether to build with backend transaction support])
- USE_SLAPI_BE_TXNS=false
- if test x$ac_cv_have_decl_SLAPI_PLUGIN_BE_TXN_POST_ADD_FN = xyes ; then
- if test x$ac_cv_have_decl_SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN = xyes ; then
- if test x$ac_cv_have_decl_SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN = xyes ; then
- if test x$ac_cv_have_decl_SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN = xyes ; then
- USE_SLAPI_BE_TXNS=true
- fi
- fi
- fi
- fi
- if $USE_SLAPI_BE_TXNS ; then
- AC_MSG_RESULT([yes])
- AC_DEFINE(USE_SLAPI_BE_TXNS,1,
- [Define to control whether or not the plugin attempts to process backend transactions.])
- else
- AC_MSG_RESULT([no])
- fi
;;
*)
RUNTIME_CFLAGS=
diff --git a/src/back-nis.c b/src/back-nis.c
index cd7a59a..fa810ab 100644
--- a/src/back-nis.c
+++ b/src/back-nis.c
@@ -985,13 +985,3 @@ backend_init_internal_postop(Slapi_PBlock *pb, struct plugin_state *state)
"hooking up internal postoperation callbacks\n");
return backend_shr_internal_postop_init(pb, state);
}
-
-#ifdef USE_SLAPI_BE_TXNS
-int
-backend_init_be_txn_postop(Slapi_PBlock *pb, struct plugin_state *state)
-{
- slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id,
- "hooking up be-txn postoperation callbacks\n");
- return backend_shr_be_txn_postop_init(pb, state);
-}
-#endif
diff --git a/src/back-sch.c b/src/back-sch.c
index 2870d4b..aecea67 100644
--- a/src/back-sch.c
+++ b/src/back-sch.c
@@ -1511,13 +1511,3 @@ backend_init_internal_postop(Slapi_PBlock *pb, struct plugin_state *state)
"hooking up internal postoperation callbacks\n");
return backend_shr_internal_postop_init(pb, state);
}
-
-#ifdef USE_SLAPI_BE_TXNS
-int
-backend_init_be_txn_postop(Slapi_PBlock *pb, struct plugin_state *state)
-{
- slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id,
- "hooking up be-txn postoperation callbacks\n");
- return backend_shr_be_txn_postop_init(pb, state);
-}
-#endif
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
diff --git a/src/back-shr.h b/src/back-shr.h
index 6db3005..e8c0213 100644
--- a/src/back-shr.h
+++ b/src/back-shr.h
@@ -38,9 +38,6 @@ void backend_shr_startup(struct plugin_state *state,
Slapi_PBlock *pb, const char *set_filter);
int backend_shr_postop_init(Slapi_PBlock *pb, struct plugin_state *state);
int backend_shr_internal_postop_init(Slapi_PBlock *pb, struct plugin_state *state);
-#ifdef USE_SLAPI_BE_TXNS
-int backend_shr_be_txn_postop_init(Slapi_PBlock *pb, struct plugin_state *state);
-#endif
int backend_shr_set_config_entry_add(struct plugin_state *state,
Slapi_PBlock *pb,
diff --git a/src/backend.h b/src/backend.h
index f981300..7f52915 100644
--- a/src/backend.h
+++ b/src/backend.h
@@ -55,10 +55,6 @@ int backend_init_preop(struct slapi_pblock *pb, struct plugin_state *state);
int backend_init_postop(struct slapi_pblock *pb, struct plugin_state *state);
int backend_init_internal_postop(struct slapi_pblock *pb,
struct plugin_state *state);
-#ifdef USE_SLAPI_BE_TXNS
-int backend_init_be_txn_postop(struct slapi_pblock *pb,
- struct plugin_state *state);
-#endif
/* Read the server's name. */
int backend_read_master_name(struct plugin_state *state,
diff --git a/src/plug-nis.c b/src/plug-nis.c
index cb6cad7..4c7ba98 100644
--- a/src/plug-nis.c
+++ b/src/plug-nis.c
@@ -60,7 +60,6 @@
#define PLUGIN_ID "nis-server-plugin"
#define PLUGIN_POSTOP_ID PLUGIN_ID "-postop"
#define PLUGIN_INTERNAL_POSTOP_ID PLUGIN_ID "-internal-postop"
-#define PLUGIN_BE_TXN_POSTOP_ID PLUGIN_ID "-be-txn-postop"
/* the module initialization function */
static Slapi_PluginDesc
@@ -479,22 +478,6 @@ nis_plugin_init_internal_postop(Slapi_PBlock *pb)
}
return 0;
}
-#ifdef USE_SLAPI_BE_TXNS
-static int
-nis_plugin_init_be_txn_postop(Slapi_PBlock *pb)
-{
- slapi_pblock_set(pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_VERSION_03);
- slapi_pblock_set(pb, SLAPI_PLUGIN_DESCRIPTION, &plugin_description);
- slapi_pblock_set(pb, SLAPI_PLUGIN_PRIVATE, global_plugin_state);
- if (backend_init_be_txn_postop(pb, global_plugin_state) == -1) {
- slapi_log_error(SLAPI_LOG_PLUGIN,
- global_plugin_state->plugin_desc->spd_id,
- "error registering be-txn postop hooks\n");
- return -1;
- }
- return 0;
-}
-#endif
int
nis_plugin_init(Slapi_PBlock *pb)
{
@@ -533,17 +516,6 @@ nis_plugin_init(Slapi_PBlock *pb)
"error registering internal postoperation plugin\n");
return -1;
}
-#ifdef USE_SLAPI_BE_TXNS
- if (slapi_register_plugin("betxnpostoperation", TRUE,
- "nis_plugin_init_be_txn_postop",
- nis_plugin_init_be_txn_postop,
- PLUGIN_BE_TXN_POSTOP_ID, NULL,
- state->plugin_identity) != 0) {
- slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id,
- "error registering be-txn postoperation plugin\n");
- return -1;
- }
-#endif
slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id,
"registered plugin hooks\n");
global_plugin_state = NULL;
diff --git a/src/plug-sch.c b/src/plug-sch.c
index c30af19..44b0918 100644
--- a/src/plug-sch.c
+++ b/src/plug-sch.c
@@ -60,7 +60,6 @@
#define PLUGIN_PREOP_ID PLUGIN_ID "-preop"
#define PLUGIN_POSTOP_ID PLUGIN_ID "-postop"
#define PLUGIN_INTERNAL_POSTOP_ID PLUGIN_ID "-internal-postop"
-#define PLUGIN_BE_TXN_POSTOP_ID PLUGIN_ID "-be-txn-postop"
/* the module initialization function */
static Slapi_PluginDesc
@@ -166,22 +165,6 @@ schema_compat_plugin_init_internal_postop(Slapi_PBlock *pb)
}
return 0;
}
-#ifdef USE_SLAPI_BE_TXNS
-static int
-schema_compat_plugin_init_be_txn_postop(Slapi_PBlock *pb)
-{
- slapi_pblock_set(pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_VERSION_03);
- slapi_pblock_set(pb, SLAPI_PLUGIN_DESCRIPTION, &plugin_description);
- slapi_pblock_set(pb, SLAPI_PLUGIN_PRIVATE, global_plugin_state);
- if (backend_init_be_txn_postop(pb, global_plugin_state) == -1) {
- slapi_log_error(SLAPI_LOG_PLUGIN,
- global_plugin_state->plugin_desc->spd_id,
- "error registering be-txn postop hooks\n");
- return -1;
- }
- return 0;
-}
-#endif
int
schema_compat_plugin_init(Slapi_PBlock *pb)
{
@@ -229,17 +212,6 @@ schema_compat_plugin_init(Slapi_PBlock *pb)
"error registering internal postoperation plugin\n");
return -1;
}
-#ifdef USE_SLAPI_BE_TXNS
- if (slapi_register_plugin("betxnpostoperation", TRUE,
- "schema_compat_plugin_init_be_txn_postop",
- schema_compat_plugin_init_be_txn_postop,
- PLUGIN_BE_TXN_POSTOP_ID, NULL,
- state->plugin_identity) != 0) {
- slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id,
- "error registering be-txn postoperation plugin\n");
- return -1;
- }
-#endif
slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id,
"registered plugin hooks\n");
global_plugin_state = NULL;
diff --git a/src/wrap.c b/src/wrap.c
index ac00737..629f697 100644
--- a/src/wrap.c
+++ b/src/wrap.c
@@ -275,19 +275,6 @@ wrap_pblock_new(Slapi_PBlock *parent)
Slapi_PBlock *ret;
ret = slapi_pblock_new();
-#if defined(SLAPI_TXN) && defined(SLAPI_PARENT_TXN)
- if (ret != NULL) {
- void *txn;
- slapi_pblock_get(parent, SLAPI_PARENT_TXN, &txn);
- if (txn != NULL) {
- slapi_pblock_set(ret, SLAPI_PARENT_TXN, txn);
- }
- slapi_pblock_get(parent, SLAPI_TXN, &txn);
- if (txn != NULL) {
- slapi_pblock_set(ret, SLAPI_TXN, txn);
- }
- }
-#endif
return ret;
}