[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: followup for ITS 1575 (2) (ITS#1585)



I've committed a patch based upon your submission.  Thanks!

Kurt

At 08:09 AM 2002-02-06, jongchoi@us.ibm.com wrote:
>Attached is a new one using a local variable for ID store.
>Thanks Kurt.
>- Jong
>
>------------------------
>Jong Hyuk Choi
>IBM Thomas J. Watson Research Center - Enterprise Linux Group
>P. O. Box 218, Yorktown Heights, NY 10598
>email: jongchoi@us.ibm.com
>(phone) 914-945-3979    (fax) 914-945-4425   TL: 862-3979
>
>
>==============================================================
>
>diff -Naur ldap-head-Feb04/configure ldap-head-Feb04new/configure
>--- ldap-head-Feb04/configure Wed Jan 30 00:31:44 2002
>+++ ldap-head-Feb04new/configure    Mon Feb  4 15:57:28 2002
>@@ -2651,7 +2651,7 @@
> LDBM_LIB=
> LDBM_LIBS=
> LTHREAD_LIBS=
>-LUTIL_LIBS=
>+LUTIL_LIBS=-luuid
>
> SLAPD_LIBS=
> SLURPD_LIBS=
>diff -Naur ldap-head-Feb04/configure.in ldap-head-Feb04new/configure.in
>--- ldap-head-Feb04/configure.in    Wed Jan 30 00:21:10 2002
>+++ ldap-head-Feb04new/configure.in Mon Feb  4 15:57:34 2002
>@@ -475,7 +475,7 @@
> LDBM_LIB=
> LDBM_LIBS=
> LTHREAD_LIBS=
>-LUTIL_LIBS=
>+LUTIL_LIBS=-luuid
>
> SLAPD_LIBS=
> SLURPD_LIBS=
>diff -Naur ldap-head-Feb04/servers/slapd/back-bdb/add.c
>ldap-head-Feb04new/servers/slapd/back-bdb/add.c
>--- ldap-head-Feb04/servers/slapd/back-bdb/add.c      Sat Feb  2 02:28:32
>2002
>+++ ldap-head-Feb04new/servers/slapd/back-bdb/add.c   Wed Feb  6 14:53:56
>2002
>@@ -13,8 +13,6 @@
> #include "back-bdb.h"
> #include "external.h"
>
>-static char bdb_gid[DB_XIDDATASIZE];
>-
> int
> bdb_add(
>      BackendDB   *be,
>@@ -39,9 +37,14 @@
>      u_int32_t   lockid;
>      DB_LOCK           lock;
> #endif
>+     char        id_str[DB_XIDDATASIZE];
>
>      Debug(LDAP_DEBUG_ARGS, "==> bdb_add: %s\n", e->e_dn, 0, 0);
>
>+     /* get global transaction id */
>+     sprintf(id_str,
>"%s-%08x-%08x",bdb_gid_str,conn->c_connid,op->o_opid);
>+     printf("%s\n", id_str);
>+
>      /* check entry's schema */
>      rc = entry_schema_check( be, e, NULL, &text, textbuf, textlen );
>      if ( rc != LDAP_SUCCESS ) {
>@@ -360,7 +363,7 @@
>            }
>
>      } else {
>-           if (( rc=TXN_PREPARE( ltid, bdb_gid )) != 0 ) {
>+           if (( rc=TXN_PREPARE( ltid, id_str )) != 0 ) {
>                  text = "txn_prepare failed";
>
>            } else {
>diff -Naur ldap-head-Feb04/servers/slapd/back-bdb/external.h
>ldap-head-Feb04new/servers/slapd/back-bdb/external.h
>--- ldap-head-Feb04/servers/slapd/back-bdb/external.h Fri Jan  4 20:17:49
>2002
>+++ ldap-head-Feb04new/servers/slapd/back-bdb/external.h    Wed Feb  6
>15:27:45 2002
>@@ -39,7 +39,8 @@
> extern BI_tool_entry_put     bdb_tool_entry_put;
> extern BI_tool_entry_reindex bdb_tool_entry_reindex;
>
>-
>+/* init.c */
>+extern char      bdb_gid_str[];
>
> LDAP_END_DECL
>
>diff -Naur ldap-head-Feb04/servers/slapd/back-bdb/init.c
>ldap-head-Feb04new/servers/slapd/back-bdb/init.c
>--- ldap-head-Feb04/servers/slapd/back-bdb/init.c     Sat Feb  2 05:25:05
>2002
>+++ ldap-head-Feb04new/servers/slapd/back-bdb/init.c  Wed Feb  6 15:28:35
>2002
>@@ -11,6 +11,7 @@
> #include <ac/string.h>
> #include <ac/unistd.h>
> #include <ac/stdlib.h>
>+#include <uuid/uuid.h>
>
> #include "back-bdb.h"
> #include "external.h"
>@@ -30,6 +31,9 @@
>      { NULL, NULL, 0, 0 }
> };
>
>+static     uuid_t      bdb_gid;
>+char bdb_gid_str[DB_XIDDATASIZE];
>+
> #if 0
> static int
> bdb_destroy( BackendInfo *bi )
>@@ -491,6 +495,12 @@
>
>      bi->bi_connection_init = 0;
>      bi->bi_connection_destroy = 0;
>+
>+     /*
>+      * uuid generate
>+      */
>+     (void) uuid_generate(bdb_gid);
>+        (void) uuid_unparse(bdb_gid, bdb_gid_str);
>
>      return 0;
> }
>diff -Naur ldap-head-Feb04/servers/slapd/back-bdb/modrdn.c
>ldap-head-Feb04new/servers/slapd/back-bdb/modrdn.c
>--- ldap-head-Feb04/servers/slapd/back-bdb/modrdn.c   Sat Feb  2 02:28:32
>2002
>+++ ldap-head-Feb04new/servers/slapd/back-bdb/modrdn.c      Wed Feb  6
>14:54:13 2002
>@@ -13,8 +13,6 @@
> #include "back-bdb.h"
> #include "external.h"
>
>-static char bdb_gid[DB_XIDDATASIZE];
>-
> int
> bdb_modrdn(
>      Backend     *be,
>@@ -57,10 +55,15 @@
>
>      int         manageDSAit = get_manageDSAit( op );
>
>+     char        id_str[DB_XIDDATASIZE];
>+
>      Debug( LDAP_DEBUG_TRACE, "==>bdb_modrdn(%s,%s,%s)\n",
>            dn->bv_val, newrdn->bv_val,
>            newSuperior ? newSuperior->bv_val : "NULL" );
>
>+     /* get global transaction id */
>+     sprintf(id_str,
>"%s-%08x-%08x",bdb_gid_str,conn->c_connid,op->o_opid);
>+
> #if 0
>      if( newSuperior != NULL ) {
>            rc = LDAP_UNWILLING_TO_PERFORM;
>@@ -631,7 +634,7 @@
>            }
>
>      } else {
>-           if(( rc=TXN_PREPARE( ltid, bdb_gid )) != 0 ) {
>+           if(( rc=TXN_PREPARE( ltid, id_str )) != 0 ) {
>                  text = "txn_prepare failed";
>            } else {
>                  if( bdb_cache_update_entry(&bdb->bi_cache, e) == -1 ) {