VERSION.sh | 2 +- ldap/servers/plugins/replication/cl5_api.c | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-)
New commits: commit cea00f839b55349c2591b1e7ff4e50b7a536944c Author: Rich Megginson rmeggins@redhat.com Date: Fri Jan 11 07:58:13 2013 -0700
bump version to 1.2.10.25
diff --git a/VERSION.sh b/VERSION.sh index 82145f0..2f2f4ab 100644 --- a/VERSION.sh +++ b/VERSION.sh @@ -10,7 +10,7 @@ vendor="389 Project" # PACKAGE_VERSION is constructed from these VERSION_MAJOR=1 VERSION_MINOR=2 -VERSION_MAINT=10.24 +VERSION_MAINT=10.25 # if this is a PRERELEASE, set VERSION_PREREL # otherwise, comment it out # be sure to include the dot prefix in the prerel
commit 231dbd32a6a58256039571d9eb7f84e6cc16feeb Author: Rich Megginson rmeggins@redhat.com Date: Wed Mar 28 16:11:20 2012 -0600
Ticket #331 - transaction errors with db 4.3 and db 4.2
https://fedorahosted.org/389/ticket/331 Resolves: Ticket #331 Bug Description: transaction errors with db 4.3 and db 4.2 Reviewed by: nhosoi (Thanks!) Branch: 389-ds-base-1.2.10 Fix Description: we are enabling transactions everywhere - since we are opening databases with DB_AUTO_COMMIT we must either open and pass a valid txn handle to all operations that modify the database (put, del) or we must pass the DB_AUTO_COMMIT flag to those operations. Platforms tested: RHEL6 x86_64, RHEL5 i386 Flag Day: no Doc impact: no (cherry picked from commit 9c7e9d51309cb8daa900a3e37c56267477aa666d)
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c index 6d65680..8147bc0 100644 --- a/ldap/servers/plugins/replication/cl5_api.c +++ b/ldap/servers/plugins/replication/cl5_api.c @@ -95,7 +95,15 @@ #if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4100 #define USE_DB_TXN 1 /* use transactions */ #define DEFAULT_DB_ENV_OP_FLAGS DB_AUTO_COMMIT -#define DEFAULT_DB_OP_FLAGS 0 +#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR <= 4300 +/* we are enabling transactions everywhere - since we are opening databases + with DB_AUTO_COMMIT we must either open and pass a valid txn handle to + all operations that modify the database (put, del) or we must pass the + DB_AUTO_COMMIT flag to those operations */ +#define DEFAULT_DB_OP_FLAGS(txn) (txn ? 0 : DB_AUTO_COMMIT) +#else +#define DEFAULT_DB_OP_FLAGS(txn) 0 +#endif #define DB_OPEN(oflags, db, txnid, file, database, type, flags, mode, rval) \ { \ if (((oflags) & DB_INIT_TXN) && ((oflags) & DB_INIT_LOG)) \ @@ -108,7 +116,7 @@ } \ } #else /* older then db 41 */ -#define DEFAULT_DB_OP_FLAGS 0 +#define DEFAULT_DB_OP_FLAGS(txn) 0 #define DB_OPEN(oflags, db, txnid, file, database, type, flags, mode, rval) \ (rval) = (db)->open((db), (file), (database), (type), (flags), (mode)) #endif @@ -3683,7 +3691,7 @@ static int _cl5ReadRUV (const char *replGen, Object *obj, PRBool purge)
/* delete the entry; it is re-added when file is successfully closed */ - file->db->del (file->db, NULL, &key, DEFAULT_DB_OP_FLAGS); + file->db->del (file->db, NULL, &key, DEFAULT_DB_OP_FLAGS(NULL)); rc = CL5_SUCCESS; goto done; @@ -3754,7 +3762,7 @@ static int _cl5WriteRUV (CL5DBFile *file, PRBool purge) return CL5_DB_ERROR; } #endif - rc = file->db->put(file->db, txnid, &key, &data, DEFAULT_DB_OP_FLAGS); + rc = file->db->put(file->db, txnid, &key, &data, DEFAULT_DB_OP_FLAGS(txnid));
slapi_ch_free (&(data.data)); if ( rc == 0 ) @@ -4058,7 +4066,7 @@ static int _cl5GetEntryCount (CL5DBFile *file)
/* delete the entry. the entry is re-added when file is successfully closed */ - file->db->del (file->db, NULL, &key, DEFAULT_DB_OP_FLAGS); + file->db->del (file->db, NULL, &key, DEFAULT_DB_OP_FLAGS(NULL)); slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5GetEntryCount: %d changes for replica %s\n", file->entryCount, file->replName); @@ -4122,7 +4130,7 @@ static int _cl5WriteEntryCount (CL5DBFile *file) return CL5_DB_ERROR; } #endif - rc = file->db->put(file->db, txnid, &key, &data, DEFAULT_DB_OP_FLAGS); + rc = file->db->put(file->db, txnid, &key, &data, DEFAULT_DB_OP_FLAGS(txnid)); if (rc == 0) { #if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR < 4100 @@ -4618,7 +4626,7 @@ static int _cl5WriteOperationTxn(const char *replName, const char *replGen, { PR_WaitSemaphore(file->sema); } - rc = file->db->put(file->db, txnid, &key, data, DEFAULT_DB_OP_FLAGS); + rc = file->db->put(file->db, txnid, &key, data, DEFAULT_DB_OP_FLAGS(txnid)); if ( file->sema ) { PR_PostSemaphore(file->sema);
389-commits@lists.fedoraproject.org