ldap/servers
by Mark Reynolds
ldap/servers/slapd/configdse.c | 1 -
ldap/servers/slapd/libglobs.c | 10 +++++++---
2 files changed, 7 insertions(+), 4 deletions(-)
New commits:
commit 43959232f792db2b79e614f6db78f7569920fdc1
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Thu Dec 12 12:48:08 2013 -0500
Ticket 47613 - Issues setting allowed mechanisms
Bug Description: Adding an empty value for nsslapd-allowed-sasl-mechanisms blocks all
sasl authentication. Also changing the allowed sasl mechansism does
require a restart after making a change.
Fix Description: Reject an empty values for nsslapd-allowed-sasl-mechanisms, and allow
config changes to occur without restarting the server.
https://fedorahosted.org/389/ticket/47613
Reviewed by: nhosoi(Thanks!)
diff --git a/ldap/servers/slapd/configdse.c b/ldap/servers/slapd/configdse.c
index bd1566e..b54062d 100644
--- a/ldap/servers/slapd/configdse.c
+++ b/ldap/servers/slapd/configdse.c
@@ -81,7 +81,6 @@ static const char *requires_restart[] = {
#endif
"cn=config:" CONFIG_RETURN_EXACT_CASE_ATTRIBUTE,
"cn=config:" CONFIG_SCHEMA_IGNORE_TRAILING_SPACES,
- "cn=config:nsslapd-allowed-sasl-mechanisms",
"cn=config,cn=ldbm:nsslapd-idlistscanlimit",
"cn=config,cn=ldbm:nsslapd-parentcheck",
"cn=config,cn=ldbm:nsslapd-dbcachesize",
diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c
index f269742..9165e08 100644
--- a/ldap/servers/slapd/libglobs.c
+++ b/ldap/servers/slapd/libglobs.c
@@ -6817,8 +6817,7 @@ config_set_allowed_sasl_mechs(const char *attrname, char *value, char *errorbuf,
{
slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
- if(!apply || slapdFrontendConfig->allowed_sasl_mechs){
- /* we only set this at startup, if we try again just return SUCCESS */
+ if(!apply){
return LDAP_SUCCESS;
}
@@ -6833,6 +6832,7 @@ config_set_allowed_sasl_mechs(const char *attrname, char *value, char *errorbuf,
}
CFG_LOCK_WRITE(slapdFrontendConfig);
+ slapi_ch_free_string(&slapdFrontendConfig->allowed_sasl_mechs);
slapdFrontendConfig->allowed_sasl_mechs = slapi_ch_strdup(value);
CFG_UNLOCK_WRITE(slapdFrontendConfig);
@@ -7619,7 +7619,11 @@ invalid_sasl_mech(char *str)
int i;
if(str == NULL){
- return 0;
+ return 1;
+ }
+ if(strlen(str) < 1){
+ /* ignore empty values */
+ return 1;
}
/*
10 years, 4 months
Branch '389-ds-base-1.3.2' - ldap/servers
by Mark Reynolds
ldap/servers/plugins/replication/cl5.h | 3 -
ldap/servers/plugins/replication/cl5_api.c | 17 ++++--
ldap/servers/plugins/replication/cl5_api.h | 63 ++++++++++++-------------
ldap/servers/plugins/replication/cl5_config.c | 40 ++++++++++++---
ldap/servers/plugins/replication/cl5_init.c | 2
ldap/servers/plugins/replication/cl5_test.c | 2
ldap/servers/plugins/replication/repl_shared.h | 1
7 files changed, 80 insertions(+), 48 deletions(-)
New commits:
commit 668e85c87b52c29902b18a584990a10130200310
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Wed Dec 11 16:57:24 2013 -0500
Ticket 47617 - allow configuring changelog trim interval
Description: Add a new config setting for changelog trimming interval.
https://fedorahosted.org/389/ticket/47617
Reviewed by: rmeggins(Thanks!!)
(cherry picked from commit 9f750277b5849fb9cc07030728147defac46c9c5)
diff --git a/ldap/servers/plugins/replication/cl5.h b/ldap/servers/plugins/replication/cl5.h
index 9939d5b..9666e9a 100644
--- a/ldap/servers/plugins/replication/cl5.h
+++ b/ldap/servers/plugins/replication/cl5.h
@@ -56,7 +56,8 @@ typedef struct changelog5Config
/* the changelog DB configuration parameters are defined as CL5DBConfig in cl5_api.h */
CL5DBConfig dbconfig;
char *symmetricKey;
- int compactInterval;
+ int compactInterval;
+ int trimInterval;
}changelog5Config;
/* initializes changelog*/
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 0fecf8c..4a9d81c 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -241,6 +241,7 @@ typedef struct cl5trim
time_t maxAge; /* maximum entry age in seconds */
int maxEntries; /* maximum number of entries across all changelog files */
int compactInterval; /* interval to compact changelog db */
+ int trimInterval; /* trimming interval */
PRLock* lock; /* controls access to trimming configuration */
} CL5Trim;
@@ -1177,12 +1178,13 @@ int cl5GetState ()
Description: sets changelog trimming parameters; changelog must be open.
Parameters: maxEntries - maximum number of entries in the chnagelog (in all files);
maxAge - maximum entry age;
- compactInterval - interval to compact changelog db
+ compactInterval - interval to compact changelog db;
+ trimInterval - changelog trimming interval.
Return: CL5_SUCCESS if successful;
CL5_BAD_STATE if changelog is not open
*/
int
-cl5ConfigTrimming (int maxEntries, const char *maxAge, int compactInterval)
+cl5ConfigTrimming (int maxEntries, const char *maxAge, int compactInterval, int trimInterval)
{
if (s_cl5Desc.dbState == CL5_STATE_NONE)
{
@@ -1225,6 +1227,11 @@ cl5ConfigTrimming (int maxEntries, const char *maxAge, int compactInterval)
s_cl5Desc.dbTrim.compactInterval = compactInterval;
}
+ if (trimInterval != CL5_NUM_IGNORE)
+ {
+ s_cl5Desc.dbTrim.trimInterval = trimInterval;
+ }
+
PR_Unlock (s_cl5Desc.dbTrim.lock);
_cl5RemoveThread ();
@@ -3427,18 +3434,16 @@ static void _cl5TrimCleanup ()
static int _cl5TrimMain (void *param)
{
- PRIntervalTime interval;
time_t timePrev = current_time ();
time_t timeCompactPrev = current_time ();
time_t timeNow;
PR_AtomicIncrement (&s_cl5Desc.threadCount);
- interval = PR_SecondsToInterval(CHANGELOGDB_TRIM_INTERVAL);
while (s_cl5Desc.dbState != CL5_STATE_CLOSING)
{
timeNow = current_time ();
- if (timeNow - timePrev >= CHANGELOGDB_TRIM_INTERVAL)
+ if (timeNow - timePrev >= s_cl5Desc.dbTrim.trimInterval)
{
/* time to trim */
timePrev = timeNow;
@@ -3458,7 +3463,7 @@ static int _cl5TrimMain (void *param)
}
PR_Lock(s_cl5Desc.clLock);
- PR_WaitCondVar(s_cl5Desc.clCvar, interval);
+ PR_WaitCondVar(s_cl5Desc.clCvar, PR_SecondsToInterval(s_cl5Desc.dbTrim.trimInterval));
PR_Unlock(s_cl5Desc.clLock);
}
diff --git a/ldap/servers/plugins/replication/cl5_api.h b/ldap/servers/plugins/replication/cl5_api.h
index 59d3bf2..ba9eb32 100644
--- a/ldap/servers/plugins/replication/cl5_api.h
+++ b/ldap/servers/plugins/replication/cl5_api.h
@@ -55,8 +55,8 @@
#define CL5_TYPE "Changelog5" /* changelog type */
#define VERSION_SIZE 127 /* size of the buffer to hold changelog version */
#define CL5_DEFAULT_CONFIG -1 /* value that indicates to changelog to use default */
-#define CL5_STR_IGNORE "-1" /* tels function to ignore this parameter */
-#define CL5_NUM_IGNORE -1 /* tels function to ignore this parameter */
+#define CL5_STR_IGNORE "-1" /* tells function to ignore this parameter */
+#define CL5_NUM_IGNORE -1 /* tells function to ignore this parameter */
#define CL5_STR_UNLIMITED "0" /* represent unlimited value (trimming ) */
#define CL5_NUM_UNLIMITED 0 /* represent unlimited value (trimming ) */
@@ -85,7 +85,7 @@ typedef struct cl5entry
/*
* For historical reasons, dbcachesize refers to number of bytes at the DB level,
* whereas cachesize refers to number of entries at the changelog cache level (cachememsize is the
- * one refering to number of bytes at the changelog cache level)
+ * one referring to number of bytes at the changelog cache level)
*/
#define CL5_DEFAULT_CONFIG_DB_DBCACHESIZE 10485760 /* 10M bytes */
#define CL5_DEFAULT_CONFIG_DB_DURABLE_TRANSACTIONS 1
@@ -178,10 +178,10 @@ void cl5Cleanup ();
Parameters: dir - changelog dir
config - db configuration parameters; currently not used
openMode - open mode
- Return: CL5_SUCCESS if successfull;
+ Return: CL5_SUCCESS if successful;
CL5_BAD_DATA if invalid directory is passed;
CL5_BAD_DBVERSION if dbversion file is missing or has unexpected data
- CL5_SYSTEM_ERROR if NSPR error occured (during db directory creation);
+ CL5_SYSTEM_ERROR if NSPR error occurred (during db directory creation);
CL5_MEMORY_ERROR if memory allocation fails;
CL5_DB_ERROR if db initialization or open fails.
*/
@@ -218,9 +218,9 @@ int cl5DeleteDBSync (Object *replica);
stored in the changelog for the replica.
Parameters: r - replica for which the vector is requested
ruv - contains a copy of the upper bound ruv if function is successful;
- unchanged otherwise. It is responsobility pf the caller to free
+ unchanged otherwise. It is responsibility of the caller to free
the ruv when it is no longer is in use
- Return: CL5_SUCCESS if function is successfull
+ Return: CL5_SUCCESS if function is successful
CL5_BAD_STATE if the changelog is not initialized;
CL5_BAD_DATA - if NULL id is supplied
CL5_NOTFOUND, if changelog file for replica is not found
@@ -233,12 +233,12 @@ int cl5GetUpperBoundRUV (Replica *r, RUV **ruv);
ldifFile - full path to ldif file to write
replicas - optional list of replicas whose changes should be exported;
if the list is NULL, entire changelog is exported.
- Return: CL5_SUCCESS if function is successfull;
+ Return: CL5_SUCCESS if function is successful;
CL5_BAD_DATA if invalid parameter is passed;
CL5_BAD_STATE if changelog is not initialized;
CL5_DB_ERROR if db api fails;
CL5_SYSTEM_ERROR if NSPR call fails;
- CL5_MEMORY_ERROR if memory allocation fials.
+ CL5_MEMORY_ERROR if memory allocation fails.
*/
int cl5ExportLDIF (const char *ldifFile, Object **replicas);
@@ -248,12 +248,12 @@ int cl5ExportLDIF (const char *ldifFile, Object **replicas);
ldifFile - absolute path to the ldif file to import
replicas - optional list of replicas whose data should be imported;
if the list is NULL, all data in the file is imported.
- Return: CL5_SUCCESS if function is successfull;
+ Return: CL5_SUCCESS if function is successful;
CL5_BAD_DATA if invalid parameter is passed;
- CL5_BAD_STATE if changelog is open or not inititalized;
+ CL5_BAD_STATE if changelog is open or not initialized;
CL5_DB_ERROR if db api fails;
CL5_SYSTEM_ERROR if NSPR call fails;
- CL5_MEMORY_ERROR if memory allocation fials.
+ CL5_MEMORY_ERROR if memory allocation fails.
*/
int cl5ImportLDIF (const char *clDir, const char *ldifFile, Object **replicas);
@@ -269,21 +269,22 @@ int cl5GetState ();
Description: sets changelog trimming parameters
Parameters: maxEntries - maximum number of entries in the log;
maxAge - maximum entry age;
- compactInterval - interval to compact changelog db
+ compactInterval - interval to compact changelog db;
+ trimInterval - interval for changelog trimming.
Return: CL5_SUCCESS if successful;
CL5_BAD_STATE if changelog has not been open
*/
-int cl5ConfigTrimming (int maxEntries, const char *maxAge, int compactInterval);
+int cl5ConfigTrimming (int maxEntries, const char *maxAge, int compactInterval, int trimInterval);
/* Name: cl5GetOperation
- Description: retireves operation specified by its csn and databaseid
+ Description: retrieves operation specified by its csn and databaseid
Parameters: op - must contain csn and databaseid; the rest of data is
- filled if function is successfull
- Return: CL5_SUCCESS if function is successfull;
+ filled if function is successful
+ Return: CL5_SUCCESS if function is successful;
CL5_BAD_DATA if invalid op is passed;
CL5_BAD_STATE if db has not been initialized;
CL5_NOTFOUND if entry was not found;
- CL5_DB_ERROR if any other db error occured;
+ CL5_DB_ERROR if any other db error occurred;
CL5_BADFORMAT if db data format does not match entry format.
*/
int cl5GetOperation (Object *replica, slapi_operation_parameters *op);
@@ -333,11 +334,11 @@ void cl5DestroyIterator (void *iterator);
op - operation to write
local - this is a non-replicated operation
txn - the containing transaction
- Return: CL5_SUCCESS if function is successfull;
+ Return: CL5_SUCCESS if function is successful;
CL5_BAD_DATA if invalid op is passed;
CL5_BAD_STATE if db has not been initialized;
CL5_MEMORY_ERROR if memory allocation failed;
- CL5_DB_ERROR if any other db error occured;
+ CL5_DB_ERROR if any other db error occurred;
*/
int cl5WriteOperationTxn(const char *repl_name, const char *repl_gen,
const slapi_operation_parameters *op, PRBool local, void *txn);
@@ -351,23 +352,23 @@ int cl5WriteOperationTxn(const char *repl_name, const char *repl_gen,
is in progress (if the data is reloaded). !!!
op - operation to write
local - this is a non-replicated operation
- Return: CL5_SUCCESS if function is successfull;
+ Return: CL5_SUCCESS if function is successful;
CL5_BAD_DATA if invalid op is passed;
CL5_BAD_STATE if db has not been initialized;
CL5_MEMORY_ERROR if memory allocation failed;
- CL5_DB_ERROR if any other db error occured;
+ CL5_DB_ERROR if any other db error occurred;
*/
int cl5WriteOperation(const char *repl_name, const char *repl_gen,
const slapi_operation_parameters *op, PRBool local);
/* Name: cl5CreateReplayIterator
- Description: creates an iterator that allows to retireve changes that should
- to be sent to the consumer identified by ruv The iteration is peformed by
+ Description: creates an iterator that allows to retrieve changes that should
+ to be sent to the consumer identified by ruv The iteration is performed by
repeated calls to cl5GetNextOperationToReplay.
Parameters: replica - replica whose data we wish to iterate;
ruv - consumer ruv;
iterator - iterator to be passed to cl5GetNextOperationToReplay call
- Return: CL5_SUCCESS, if function is successfull;
+ Return: CL5_SUCCESS, if function is successful;
CL5_MISSING_DATA, if data that should be in the changelog is missing
CL5_PURGED_DATA, if some data that consumer needs has been purged.
Note that the iterator can be non null if the supplier contains
@@ -375,7 +376,7 @@ int cl5WriteOperation(const char *repl_name, const char *repl_gen,
CL5_NOTFOUND if the consumer is up to data with respect to the supplier
CL5_BAD_DATA if invalid parameter is passed;
CL5_BAD_STATE if db has not been open;
- CL5_DB_ERROR if any other db error occured;
+ CL5_DB_ERROR if any other db error occurred;
CL5_MEMORY_ERROR if memory allocation fails.
*/
int cl5CreateReplayIterator (Private_Repl_Protocol *prp, const RUV *ruv,
@@ -390,11 +391,11 @@ int cl5CreateReplayIteratorEx (Private_Repl_Protocol *prp, const RUV *consumerRu
is encoded in the iterator parameter that must be created by calling
to cl5CreateIterator.
Parameters: iterator - iterator that identifies next entry to retrieve;
- op - operation retireved if function is successful
- Return: CL5_SUCCESS if function is successfull;
+ op - operation retrieved if function is successful
+ Return: CL5_SUCCESS if function is successful;
CL5_BAD_DATA if invalid parameter is passed;
CL5_NOTFOUND if end of iteration list is reached
- CL5_DB_ERROR if any other db error occured;
+ CL5_DB_ERROR if any other db error occurred;
CL5_BADFORMAT if data in db is of unrecognized format;
CL5_MEMORY_ERROR if memory allocation fails.
*/
@@ -402,8 +403,8 @@ int cl5GetNextOperationToReplay (CL5ReplayIterator *iterator,
CL5Entry *entry);
/* Name: cl5DestroyReplayIterator
- Description: destorys iterator
- Parameters: iterator - iterator to destory
+ Description: destroys iterator
+ Parameters: iterator - iterator to destroy
Return: none
*/
void cl5DestroyReplayIterator (CL5ReplayIterator **iterator);
diff --git a/ldap/servers/plugins/replication/cl5_config.c b/ldap/servers/plugins/replication/cl5_config.c
index a523a80..e168bbd 100644
--- a/ldap/servers/plugins/replication/cl5_config.c
+++ b/ldap/servers/plugins/replication/cl5_config.c
@@ -244,7 +244,7 @@ changelog5_config_add (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter
}
/* set trimming parameters */
- rc = cl5ConfigTrimming (config.maxEntries, config.maxAge, config.compactInterval);
+ rc = cl5ConfigTrimming (config.maxEntries, config.maxAge, config.compactInterval, config.trimInterval);
if (rc != CL5_SUCCESS)
{
*returncode = 1;
@@ -339,6 +339,7 @@ changelog5_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr
config.compactInterval = CL5_NUM_IGNORE;
slapi_ch_free_string(&config.maxAge);
config.maxAge = slapi_ch_strdup(CL5_STR_IGNORE);
+ config.trimInterval = CL5_NUM_IGNORE;
slapi_pblock_get( pb, SLAPI_MODIFY_MODS, &mods );
for (i = 0; mods[i] != NULL; i++)
@@ -411,6 +412,17 @@ changelog5_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr
config.compactInterval = 0;
}
}
+ else if ( strcasecmp ( config_attr, CONFIG_CHANGELOG_TRIM_ATTRIBUTE ) == 0 )
+ {
+ if (config_attr_value && config_attr_value[0] != '\0')
+ {
+ config.trimInterval = atoi (config_attr_value);
+ }
+ else
+ {
+ config.trimInterval = CHANGELOGDB_TRIM_INTERVAL;
+ }
+ }
else if ( strcasecmp ( config_attr, CONFIG_CHANGELOG_SYMMETRIC_KEY ) == 0 )
{
slapi_ch_free_string(&config.symmetricKey);
@@ -438,6 +450,8 @@ changelog5_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr
config.maxEntries = originalConfig->maxEntries;
if (config.compactInterval == CL5_NUM_IGNORE)
config.compactInterval = originalConfig->compactInterval;
+ if (config.trimInterval == CL5_NUM_IGNORE)
+ config.trimInterval = originalConfig->trimInterval;
if (strcmp (config.maxAge, CL5_STR_IGNORE) == 0) {
slapi_ch_free_string(&config.maxAge);
if (originalConfig->maxAge)
@@ -560,9 +574,10 @@ changelog5_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr
/* one of the changelog parameters is modified */
if (config.maxEntries != CL5_NUM_IGNORE ||
+ config.trimInterval != CL5_NUM_IGNORE ||
strcmp (config.maxAge, CL5_STR_IGNORE) != 0)
{
- rc = cl5ConfigTrimming (config.maxEntries, config.maxAge, config.compactInterval);
+ rc = cl5ConfigTrimming (config.maxEntries, config.maxAge, config.compactInterval, config.trimInterval);
if (rc != CL5_SUCCESS)
{
*returncode = 1;
@@ -721,6 +736,7 @@ static changelog5Config * changelog5_dup_config(changelog5Config *config)
dup->maxEntries = config->maxEntries;
dup->compactInterval = config->compactInterval;
+ dup->trimInterval = config->trimInterval;
dup->dbconfig.pageSize = config->dbconfig.pageSize;
dup->dbconfig.fileMode = config->dbconfig.fileMode;
@@ -741,13 +757,13 @@ static void changelog5_extract_config(Slapi_Entry* entry, changelog5Config *conf
config->dir = slapi_entry_attr_get_charptr(entry,CONFIG_CHANGELOG_DIR_ATTRIBUTE);
replace_bslash (config->dir);
- arg= slapi_entry_attr_get_charptr(entry,CONFIG_CHANGELOG_MAXENTRIES_ATTRIBUTE);
+ arg = slapi_entry_attr_get_charptr(entry,CONFIG_CHANGELOG_MAXENTRIES_ATTRIBUTE);
if (arg)
{
config->maxEntries = atoi (arg);
slapi_ch_free_string(&arg);
}
- arg= slapi_entry_attr_get_charptr(entry,CONFIG_CHANGELOG_COMPACTDB_ATTRIBUTE);
+ arg = slapi_entry_attr_get_charptr(entry,CONFIG_CHANGELOG_COMPACTDB_ATTRIBUTE);
if (arg)
{
config->compactInterval = atoi (arg);
@@ -757,13 +773,22 @@ static void changelog5_extract_config(Slapi_Entry* entry, changelog5Config *conf
{
config->compactInterval = CHANGELOGDB_COMPACT_INTERVAL;
}
-
+ arg = slapi_entry_attr_get_charptr(entry, CONFIG_CHANGELOG_TRIM_ATTRIBUTE);
+ if (arg)
+ {
+ config->trimInterval = atoi (arg);
+ slapi_ch_free_string(&arg);
+ }
+ else
+ {
+ config->trimInterval = CHANGELOGDB_TRIM_INTERVAL;
+ }
config->maxAge = slapi_entry_attr_get_charptr(entry,CONFIG_CHANGELOG_MAXAGE_ATTRIBUTE);
/*
* Read the Changelog Internal Configuration Parameters for the Changelog DB
*/
- arg= slapi_entry_attr_get_charptr(entry, CONFIG_CHANGELOG_MAX_CONCURRENT_WRITES);
+ arg = slapi_entry_attr_get_charptr(entry, CONFIG_CHANGELOG_MAX_CONCURRENT_WRITES);
if (arg)
{
config->dbconfig.maxConcurrentWrites = atoi (arg);
@@ -777,8 +802,7 @@ static void changelog5_extract_config(Slapi_Entry* entry, changelog5Config *conf
/*
* changelog encryption
*/
- arg = slapi_entry_attr_get_charptr(entry,
- CONFIG_CHANGELOG_ENCRYPTION_ALGORITHM);
+ arg = slapi_entry_attr_get_charptr(entry, CONFIG_CHANGELOG_ENCRYPTION_ALGORITHM);
if (arg)
{
config->dbconfig.encryptionAlgorithm = slapi_ch_strdup(arg);
diff --git a/ldap/servers/plugins/replication/cl5_init.c b/ldap/servers/plugins/replication/cl5_init.c
index 60e538d..5071432 100644
--- a/ldap/servers/plugins/replication/cl5_init.c
+++ b/ldap/servers/plugins/replication/cl5_init.c
@@ -88,7 +88,7 @@ int changelog5_init()
}
/* set trimming parameters */
- rc = cl5ConfigTrimming (config.maxEntries, config.maxAge, config.compactInterval);
+ rc = cl5ConfigTrimming (config.maxEntries, config.maxAge, config.compactInterval, config.trimInterval);
if (rc != CL5_SUCCESS)
{
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
diff --git a/ldap/servers/plugins/replication/cl5_test.c b/ldap/servers/plugins/replication/cl5_test.c
index 4bb83a7..8f15b2f 100644
--- a/ldap/servers/plugins/replication/cl5_test.c
+++ b/ldap/servers/plugins/replication/cl5_test.c
@@ -314,7 +314,7 @@ static void testTrimming ()
rc = populateChangelog (300, NULL);
if (rc == 0)
- rc = cl5ConfigTrimming (300, "1d");
+ rc = cl5ConfigTrimming (300, "1d", CHANGELOGDB_COMPACT_INTERVAL, CHANGELOGDB_TRIM_INTERVAL);
interval = PR_SecondsToInterval(300); /* 5 min is default trimming interval */
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
diff --git a/ldap/servers/plugins/replication/repl_shared.h b/ldap/servers/plugins/replication/repl_shared.h
index f79a657..9a0d014 100644
--- a/ldap/servers/plugins/replication/repl_shared.h
+++ b/ldap/servers/plugins/replication/repl_shared.h
@@ -64,6 +64,7 @@
#define CONFIG_CHANGELOG_MAXENTRIES_ATTRIBUTE "nsslapd-changelogmaxentries"
#define CONFIG_CHANGELOG_MAXAGE_ATTRIBUTE "nsslapd-changelogmaxage"
#define CONFIG_CHANGELOG_COMPACTDB_ATTRIBUTE "nsslapd-changelogcompactdb-interval"
+#define CONFIG_CHANGELOG_TRIM_ATTRIBUTE "nsslapd-changelogtrim-interval"
/* Changelog Internal Configuration Parameters -> Changelog Cache related */
#define CONFIG_CHANGELOG_MAX_CONCURRENT_WRITES "nsslapd-changelogmaxconcurrentwrites"
#define CONFIG_CHANGELOG_ENCRYPTION_ALGORITHM "nsslapd-encryptionalgorithm"
10 years, 4 months
ldap/servers
by Mark Reynolds
ldap/servers/plugins/replication/cl5.h | 3 -
ldap/servers/plugins/replication/cl5_api.c | 17 ++++--
ldap/servers/plugins/replication/cl5_api.h | 63 ++++++++++++-------------
ldap/servers/plugins/replication/cl5_config.c | 40 ++++++++++++---
ldap/servers/plugins/replication/cl5_init.c | 2
ldap/servers/plugins/replication/cl5_test.c | 2
ldap/servers/plugins/replication/repl_shared.h | 1
7 files changed, 80 insertions(+), 48 deletions(-)
New commits:
commit 9f750277b5849fb9cc07030728147defac46c9c5
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Wed Dec 11 16:57:24 2013 -0500
Ticket 47617 - allow configuring changelog trim interval
Description: Add a new config setting for changelog trimming interval.
https://fedorahosted.org/389/ticket/47617
Reviewed by: rmeggins(Thanks!!)
diff --git a/ldap/servers/plugins/replication/cl5.h b/ldap/servers/plugins/replication/cl5.h
index 9939d5b..9666e9a 100644
--- a/ldap/servers/plugins/replication/cl5.h
+++ b/ldap/servers/plugins/replication/cl5.h
@@ -56,7 +56,8 @@ typedef struct changelog5Config
/* the changelog DB configuration parameters are defined as CL5DBConfig in cl5_api.h */
CL5DBConfig dbconfig;
char *symmetricKey;
- int compactInterval;
+ int compactInterval;
+ int trimInterval;
}changelog5Config;
/* initializes changelog*/
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 0fecf8c..4a9d81c 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -241,6 +241,7 @@ typedef struct cl5trim
time_t maxAge; /* maximum entry age in seconds */
int maxEntries; /* maximum number of entries across all changelog files */
int compactInterval; /* interval to compact changelog db */
+ int trimInterval; /* trimming interval */
PRLock* lock; /* controls access to trimming configuration */
} CL5Trim;
@@ -1177,12 +1178,13 @@ int cl5GetState ()
Description: sets changelog trimming parameters; changelog must be open.
Parameters: maxEntries - maximum number of entries in the chnagelog (in all files);
maxAge - maximum entry age;
- compactInterval - interval to compact changelog db
+ compactInterval - interval to compact changelog db;
+ trimInterval - changelog trimming interval.
Return: CL5_SUCCESS if successful;
CL5_BAD_STATE if changelog is not open
*/
int
-cl5ConfigTrimming (int maxEntries, const char *maxAge, int compactInterval)
+cl5ConfigTrimming (int maxEntries, const char *maxAge, int compactInterval, int trimInterval)
{
if (s_cl5Desc.dbState == CL5_STATE_NONE)
{
@@ -1225,6 +1227,11 @@ cl5ConfigTrimming (int maxEntries, const char *maxAge, int compactInterval)
s_cl5Desc.dbTrim.compactInterval = compactInterval;
}
+ if (trimInterval != CL5_NUM_IGNORE)
+ {
+ s_cl5Desc.dbTrim.trimInterval = trimInterval;
+ }
+
PR_Unlock (s_cl5Desc.dbTrim.lock);
_cl5RemoveThread ();
@@ -3427,18 +3434,16 @@ static void _cl5TrimCleanup ()
static int _cl5TrimMain (void *param)
{
- PRIntervalTime interval;
time_t timePrev = current_time ();
time_t timeCompactPrev = current_time ();
time_t timeNow;
PR_AtomicIncrement (&s_cl5Desc.threadCount);
- interval = PR_SecondsToInterval(CHANGELOGDB_TRIM_INTERVAL);
while (s_cl5Desc.dbState != CL5_STATE_CLOSING)
{
timeNow = current_time ();
- if (timeNow - timePrev >= CHANGELOGDB_TRIM_INTERVAL)
+ if (timeNow - timePrev >= s_cl5Desc.dbTrim.trimInterval)
{
/* time to trim */
timePrev = timeNow;
@@ -3458,7 +3463,7 @@ static int _cl5TrimMain (void *param)
}
PR_Lock(s_cl5Desc.clLock);
- PR_WaitCondVar(s_cl5Desc.clCvar, interval);
+ PR_WaitCondVar(s_cl5Desc.clCvar, PR_SecondsToInterval(s_cl5Desc.dbTrim.trimInterval));
PR_Unlock(s_cl5Desc.clLock);
}
diff --git a/ldap/servers/plugins/replication/cl5_api.h b/ldap/servers/plugins/replication/cl5_api.h
index 59d3bf2..ba9eb32 100644
--- a/ldap/servers/plugins/replication/cl5_api.h
+++ b/ldap/servers/plugins/replication/cl5_api.h
@@ -55,8 +55,8 @@
#define CL5_TYPE "Changelog5" /* changelog type */
#define VERSION_SIZE 127 /* size of the buffer to hold changelog version */
#define CL5_DEFAULT_CONFIG -1 /* value that indicates to changelog to use default */
-#define CL5_STR_IGNORE "-1" /* tels function to ignore this parameter */
-#define CL5_NUM_IGNORE -1 /* tels function to ignore this parameter */
+#define CL5_STR_IGNORE "-1" /* tells function to ignore this parameter */
+#define CL5_NUM_IGNORE -1 /* tells function to ignore this parameter */
#define CL5_STR_UNLIMITED "0" /* represent unlimited value (trimming ) */
#define CL5_NUM_UNLIMITED 0 /* represent unlimited value (trimming ) */
@@ -85,7 +85,7 @@ typedef struct cl5entry
/*
* For historical reasons, dbcachesize refers to number of bytes at the DB level,
* whereas cachesize refers to number of entries at the changelog cache level (cachememsize is the
- * one refering to number of bytes at the changelog cache level)
+ * one referring to number of bytes at the changelog cache level)
*/
#define CL5_DEFAULT_CONFIG_DB_DBCACHESIZE 10485760 /* 10M bytes */
#define CL5_DEFAULT_CONFIG_DB_DURABLE_TRANSACTIONS 1
@@ -178,10 +178,10 @@ void cl5Cleanup ();
Parameters: dir - changelog dir
config - db configuration parameters; currently not used
openMode - open mode
- Return: CL5_SUCCESS if successfull;
+ Return: CL5_SUCCESS if successful;
CL5_BAD_DATA if invalid directory is passed;
CL5_BAD_DBVERSION if dbversion file is missing or has unexpected data
- CL5_SYSTEM_ERROR if NSPR error occured (during db directory creation);
+ CL5_SYSTEM_ERROR if NSPR error occurred (during db directory creation);
CL5_MEMORY_ERROR if memory allocation fails;
CL5_DB_ERROR if db initialization or open fails.
*/
@@ -218,9 +218,9 @@ int cl5DeleteDBSync (Object *replica);
stored in the changelog for the replica.
Parameters: r - replica for which the vector is requested
ruv - contains a copy of the upper bound ruv if function is successful;
- unchanged otherwise. It is responsobility pf the caller to free
+ unchanged otherwise. It is responsibility of the caller to free
the ruv when it is no longer is in use
- Return: CL5_SUCCESS if function is successfull
+ Return: CL5_SUCCESS if function is successful
CL5_BAD_STATE if the changelog is not initialized;
CL5_BAD_DATA - if NULL id is supplied
CL5_NOTFOUND, if changelog file for replica is not found
@@ -233,12 +233,12 @@ int cl5GetUpperBoundRUV (Replica *r, RUV **ruv);
ldifFile - full path to ldif file to write
replicas - optional list of replicas whose changes should be exported;
if the list is NULL, entire changelog is exported.
- Return: CL5_SUCCESS if function is successfull;
+ Return: CL5_SUCCESS if function is successful;
CL5_BAD_DATA if invalid parameter is passed;
CL5_BAD_STATE if changelog is not initialized;
CL5_DB_ERROR if db api fails;
CL5_SYSTEM_ERROR if NSPR call fails;
- CL5_MEMORY_ERROR if memory allocation fials.
+ CL5_MEMORY_ERROR if memory allocation fails.
*/
int cl5ExportLDIF (const char *ldifFile, Object **replicas);
@@ -248,12 +248,12 @@ int cl5ExportLDIF (const char *ldifFile, Object **replicas);
ldifFile - absolute path to the ldif file to import
replicas - optional list of replicas whose data should be imported;
if the list is NULL, all data in the file is imported.
- Return: CL5_SUCCESS if function is successfull;
+ Return: CL5_SUCCESS if function is successful;
CL5_BAD_DATA if invalid parameter is passed;
- CL5_BAD_STATE if changelog is open or not inititalized;
+ CL5_BAD_STATE if changelog is open or not initialized;
CL5_DB_ERROR if db api fails;
CL5_SYSTEM_ERROR if NSPR call fails;
- CL5_MEMORY_ERROR if memory allocation fials.
+ CL5_MEMORY_ERROR if memory allocation fails.
*/
int cl5ImportLDIF (const char *clDir, const char *ldifFile, Object **replicas);
@@ -269,21 +269,22 @@ int cl5GetState ();
Description: sets changelog trimming parameters
Parameters: maxEntries - maximum number of entries in the log;
maxAge - maximum entry age;
- compactInterval - interval to compact changelog db
+ compactInterval - interval to compact changelog db;
+ trimInterval - interval for changelog trimming.
Return: CL5_SUCCESS if successful;
CL5_BAD_STATE if changelog has not been open
*/
-int cl5ConfigTrimming (int maxEntries, const char *maxAge, int compactInterval);
+int cl5ConfigTrimming (int maxEntries, const char *maxAge, int compactInterval, int trimInterval);
/* Name: cl5GetOperation
- Description: retireves operation specified by its csn and databaseid
+ Description: retrieves operation specified by its csn and databaseid
Parameters: op - must contain csn and databaseid; the rest of data is
- filled if function is successfull
- Return: CL5_SUCCESS if function is successfull;
+ filled if function is successful
+ Return: CL5_SUCCESS if function is successful;
CL5_BAD_DATA if invalid op is passed;
CL5_BAD_STATE if db has not been initialized;
CL5_NOTFOUND if entry was not found;
- CL5_DB_ERROR if any other db error occured;
+ CL5_DB_ERROR if any other db error occurred;
CL5_BADFORMAT if db data format does not match entry format.
*/
int cl5GetOperation (Object *replica, slapi_operation_parameters *op);
@@ -333,11 +334,11 @@ void cl5DestroyIterator (void *iterator);
op - operation to write
local - this is a non-replicated operation
txn - the containing transaction
- Return: CL5_SUCCESS if function is successfull;
+ Return: CL5_SUCCESS if function is successful;
CL5_BAD_DATA if invalid op is passed;
CL5_BAD_STATE if db has not been initialized;
CL5_MEMORY_ERROR if memory allocation failed;
- CL5_DB_ERROR if any other db error occured;
+ CL5_DB_ERROR if any other db error occurred;
*/
int cl5WriteOperationTxn(const char *repl_name, const char *repl_gen,
const slapi_operation_parameters *op, PRBool local, void *txn);
@@ -351,23 +352,23 @@ int cl5WriteOperationTxn(const char *repl_name, const char *repl_gen,
is in progress (if the data is reloaded). !!!
op - operation to write
local - this is a non-replicated operation
- Return: CL5_SUCCESS if function is successfull;
+ Return: CL5_SUCCESS if function is successful;
CL5_BAD_DATA if invalid op is passed;
CL5_BAD_STATE if db has not been initialized;
CL5_MEMORY_ERROR if memory allocation failed;
- CL5_DB_ERROR if any other db error occured;
+ CL5_DB_ERROR if any other db error occurred;
*/
int cl5WriteOperation(const char *repl_name, const char *repl_gen,
const slapi_operation_parameters *op, PRBool local);
/* Name: cl5CreateReplayIterator
- Description: creates an iterator that allows to retireve changes that should
- to be sent to the consumer identified by ruv The iteration is peformed by
+ Description: creates an iterator that allows to retrieve changes that should
+ to be sent to the consumer identified by ruv The iteration is performed by
repeated calls to cl5GetNextOperationToReplay.
Parameters: replica - replica whose data we wish to iterate;
ruv - consumer ruv;
iterator - iterator to be passed to cl5GetNextOperationToReplay call
- Return: CL5_SUCCESS, if function is successfull;
+ Return: CL5_SUCCESS, if function is successful;
CL5_MISSING_DATA, if data that should be in the changelog is missing
CL5_PURGED_DATA, if some data that consumer needs has been purged.
Note that the iterator can be non null if the supplier contains
@@ -375,7 +376,7 @@ int cl5WriteOperation(const char *repl_name, const char *repl_gen,
CL5_NOTFOUND if the consumer is up to data with respect to the supplier
CL5_BAD_DATA if invalid parameter is passed;
CL5_BAD_STATE if db has not been open;
- CL5_DB_ERROR if any other db error occured;
+ CL5_DB_ERROR if any other db error occurred;
CL5_MEMORY_ERROR if memory allocation fails.
*/
int cl5CreateReplayIterator (Private_Repl_Protocol *prp, const RUV *ruv,
@@ -390,11 +391,11 @@ int cl5CreateReplayIteratorEx (Private_Repl_Protocol *prp, const RUV *consumerRu
is encoded in the iterator parameter that must be created by calling
to cl5CreateIterator.
Parameters: iterator - iterator that identifies next entry to retrieve;
- op - operation retireved if function is successful
- Return: CL5_SUCCESS if function is successfull;
+ op - operation retrieved if function is successful
+ Return: CL5_SUCCESS if function is successful;
CL5_BAD_DATA if invalid parameter is passed;
CL5_NOTFOUND if end of iteration list is reached
- CL5_DB_ERROR if any other db error occured;
+ CL5_DB_ERROR if any other db error occurred;
CL5_BADFORMAT if data in db is of unrecognized format;
CL5_MEMORY_ERROR if memory allocation fails.
*/
@@ -402,8 +403,8 @@ int cl5GetNextOperationToReplay (CL5ReplayIterator *iterator,
CL5Entry *entry);
/* Name: cl5DestroyReplayIterator
- Description: destorys iterator
- Parameters: iterator - iterator to destory
+ Description: destroys iterator
+ Parameters: iterator - iterator to destroy
Return: none
*/
void cl5DestroyReplayIterator (CL5ReplayIterator **iterator);
diff --git a/ldap/servers/plugins/replication/cl5_config.c b/ldap/servers/plugins/replication/cl5_config.c
index a523a80..e168bbd 100644
--- a/ldap/servers/plugins/replication/cl5_config.c
+++ b/ldap/servers/plugins/replication/cl5_config.c
@@ -244,7 +244,7 @@ changelog5_config_add (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter
}
/* set trimming parameters */
- rc = cl5ConfigTrimming (config.maxEntries, config.maxAge, config.compactInterval);
+ rc = cl5ConfigTrimming (config.maxEntries, config.maxAge, config.compactInterval, config.trimInterval);
if (rc != CL5_SUCCESS)
{
*returncode = 1;
@@ -339,6 +339,7 @@ changelog5_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr
config.compactInterval = CL5_NUM_IGNORE;
slapi_ch_free_string(&config.maxAge);
config.maxAge = slapi_ch_strdup(CL5_STR_IGNORE);
+ config.trimInterval = CL5_NUM_IGNORE;
slapi_pblock_get( pb, SLAPI_MODIFY_MODS, &mods );
for (i = 0; mods[i] != NULL; i++)
@@ -411,6 +412,17 @@ changelog5_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr
config.compactInterval = 0;
}
}
+ else if ( strcasecmp ( config_attr, CONFIG_CHANGELOG_TRIM_ATTRIBUTE ) == 0 )
+ {
+ if (config_attr_value && config_attr_value[0] != '\0')
+ {
+ config.trimInterval = atoi (config_attr_value);
+ }
+ else
+ {
+ config.trimInterval = CHANGELOGDB_TRIM_INTERVAL;
+ }
+ }
else if ( strcasecmp ( config_attr, CONFIG_CHANGELOG_SYMMETRIC_KEY ) == 0 )
{
slapi_ch_free_string(&config.symmetricKey);
@@ -438,6 +450,8 @@ changelog5_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr
config.maxEntries = originalConfig->maxEntries;
if (config.compactInterval == CL5_NUM_IGNORE)
config.compactInterval = originalConfig->compactInterval;
+ if (config.trimInterval == CL5_NUM_IGNORE)
+ config.trimInterval = originalConfig->trimInterval;
if (strcmp (config.maxAge, CL5_STR_IGNORE) == 0) {
slapi_ch_free_string(&config.maxAge);
if (originalConfig->maxAge)
@@ -560,9 +574,10 @@ changelog5_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr
/* one of the changelog parameters is modified */
if (config.maxEntries != CL5_NUM_IGNORE ||
+ config.trimInterval != CL5_NUM_IGNORE ||
strcmp (config.maxAge, CL5_STR_IGNORE) != 0)
{
- rc = cl5ConfigTrimming (config.maxEntries, config.maxAge, config.compactInterval);
+ rc = cl5ConfigTrimming (config.maxEntries, config.maxAge, config.compactInterval, config.trimInterval);
if (rc != CL5_SUCCESS)
{
*returncode = 1;
@@ -721,6 +736,7 @@ static changelog5Config * changelog5_dup_config(changelog5Config *config)
dup->maxEntries = config->maxEntries;
dup->compactInterval = config->compactInterval;
+ dup->trimInterval = config->trimInterval;
dup->dbconfig.pageSize = config->dbconfig.pageSize;
dup->dbconfig.fileMode = config->dbconfig.fileMode;
@@ -741,13 +757,13 @@ static void changelog5_extract_config(Slapi_Entry* entry, changelog5Config *conf
config->dir = slapi_entry_attr_get_charptr(entry,CONFIG_CHANGELOG_DIR_ATTRIBUTE);
replace_bslash (config->dir);
- arg= slapi_entry_attr_get_charptr(entry,CONFIG_CHANGELOG_MAXENTRIES_ATTRIBUTE);
+ arg = slapi_entry_attr_get_charptr(entry,CONFIG_CHANGELOG_MAXENTRIES_ATTRIBUTE);
if (arg)
{
config->maxEntries = atoi (arg);
slapi_ch_free_string(&arg);
}
- arg= slapi_entry_attr_get_charptr(entry,CONFIG_CHANGELOG_COMPACTDB_ATTRIBUTE);
+ arg = slapi_entry_attr_get_charptr(entry,CONFIG_CHANGELOG_COMPACTDB_ATTRIBUTE);
if (arg)
{
config->compactInterval = atoi (arg);
@@ -757,13 +773,22 @@ static void changelog5_extract_config(Slapi_Entry* entry, changelog5Config *conf
{
config->compactInterval = CHANGELOGDB_COMPACT_INTERVAL;
}
-
+ arg = slapi_entry_attr_get_charptr(entry, CONFIG_CHANGELOG_TRIM_ATTRIBUTE);
+ if (arg)
+ {
+ config->trimInterval = atoi (arg);
+ slapi_ch_free_string(&arg);
+ }
+ else
+ {
+ config->trimInterval = CHANGELOGDB_TRIM_INTERVAL;
+ }
config->maxAge = slapi_entry_attr_get_charptr(entry,CONFIG_CHANGELOG_MAXAGE_ATTRIBUTE);
/*
* Read the Changelog Internal Configuration Parameters for the Changelog DB
*/
- arg= slapi_entry_attr_get_charptr(entry, CONFIG_CHANGELOG_MAX_CONCURRENT_WRITES);
+ arg = slapi_entry_attr_get_charptr(entry, CONFIG_CHANGELOG_MAX_CONCURRENT_WRITES);
if (arg)
{
config->dbconfig.maxConcurrentWrites = atoi (arg);
@@ -777,8 +802,7 @@ static void changelog5_extract_config(Slapi_Entry* entry, changelog5Config *conf
/*
* changelog encryption
*/
- arg = slapi_entry_attr_get_charptr(entry,
- CONFIG_CHANGELOG_ENCRYPTION_ALGORITHM);
+ arg = slapi_entry_attr_get_charptr(entry, CONFIG_CHANGELOG_ENCRYPTION_ALGORITHM);
if (arg)
{
config->dbconfig.encryptionAlgorithm = slapi_ch_strdup(arg);
diff --git a/ldap/servers/plugins/replication/cl5_init.c b/ldap/servers/plugins/replication/cl5_init.c
index 60e538d..5071432 100644
--- a/ldap/servers/plugins/replication/cl5_init.c
+++ b/ldap/servers/plugins/replication/cl5_init.c
@@ -88,7 +88,7 @@ int changelog5_init()
}
/* set trimming parameters */
- rc = cl5ConfigTrimming (config.maxEntries, config.maxAge, config.compactInterval);
+ rc = cl5ConfigTrimming (config.maxEntries, config.maxAge, config.compactInterval, config.trimInterval);
if (rc != CL5_SUCCESS)
{
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
diff --git a/ldap/servers/plugins/replication/cl5_test.c b/ldap/servers/plugins/replication/cl5_test.c
index 4bb83a7..8f15b2f 100644
--- a/ldap/servers/plugins/replication/cl5_test.c
+++ b/ldap/servers/plugins/replication/cl5_test.c
@@ -314,7 +314,7 @@ static void testTrimming ()
rc = populateChangelog (300, NULL);
if (rc == 0)
- rc = cl5ConfigTrimming (300, "1d");
+ rc = cl5ConfigTrimming (300, "1d", CHANGELOGDB_COMPACT_INTERVAL, CHANGELOGDB_TRIM_INTERVAL);
interval = PR_SecondsToInterval(300); /* 5 min is default trimming interval */
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
diff --git a/ldap/servers/plugins/replication/repl_shared.h b/ldap/servers/plugins/replication/repl_shared.h
index f79a657..9a0d014 100644
--- a/ldap/servers/plugins/replication/repl_shared.h
+++ b/ldap/servers/plugins/replication/repl_shared.h
@@ -64,6 +64,7 @@
#define CONFIG_CHANGELOG_MAXENTRIES_ATTRIBUTE "nsslapd-changelogmaxentries"
#define CONFIG_CHANGELOG_MAXAGE_ATTRIBUTE "nsslapd-changelogmaxage"
#define CONFIG_CHANGELOG_COMPACTDB_ATTRIBUTE "nsslapd-changelogcompactdb-interval"
+#define CONFIG_CHANGELOG_TRIM_ATTRIBUTE "nsslapd-changelogtrim-interval"
/* Changelog Internal Configuration Parameters -> Changelog Cache related */
#define CONFIG_CHANGELOG_MAX_CONCURRENT_WRITES "nsslapd-changelogmaxconcurrentwrites"
#define CONFIG_CHANGELOG_ENCRYPTION_ALGORITHM "nsslapd-encryptionalgorithm"
10 years, 4 months
Branch '389-ds-base-1.3.2' - ldap/servers Makefile.am Makefile.in
by Mark Reynolds
Makefile.am | 3 ++-
Makefile.in | 6 ++++--
ldap/servers/slapd/dynalib.c | 2 +-
ldap/servers/slapd/fedse.c | 9 ++++++---
4 files changed, 13 insertions(+), 7 deletions(-)
New commits:
commit a2fa1cb305646b3a3398faf893671bf6e066cd10
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Wed Dec 11 16:13:11 2013 -0500
Ticket 47601 - Plugin library path validation prevents intentional loading of out-of-tree modules
Bug Description: The fix for ticket 47384 does not allow plugins to have their shared libs stored
anywhere else but in the default location.
Fix Description: Allow plugin paths that are not in the default area if the absolute path has been
specified, and the library can be opened.
https://fedorahosted.org/389/ticket/47601
Reviewed by: rmeggins(Thanks!)
(cherry picked from commit d8e8a90fd151d131666d9d72bd6d40d356f4bdf0)
diff --git a/Makefile.am b/Makefile.am
index bfa42f5..26174bf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -65,6 +65,7 @@ PCRE_LINK = @pcre_lib@ -lpcre
NETSNMP_LINK = @netsnmp_lib@ @netsnmp_link@
PAM_LINK = -lpam
KERBEROS_LINK = $(kerberos_lib)
+DLOPEN_LINK = -ldl
LIBSOCKET=@LIBSOCKET@
LIBNSL=@LIBNSL@
@@ -1462,7 +1463,7 @@ ns_slapd_SOURCES = ldap/servers/slapd/abandon.c \
ns_slapd_CPPFLAGS = $(AM_CPPFLAGS) @sasl_inc@ @openldap_inc@ @ldapsdk_inc@ @nss_inc@ \
@nspr_inc@ @svrcore_inc@
-ns_slapd_LDADD = libslapd.la libldaputil.a $(LDAPSDK_LINK) $(NSS_LINK) \
+ns_slapd_LDADD = libslapd.la libldaputil.a $(LDAPSDK_LINK) $(NSS_LINK) $(DLOPEN_LINK) \
$(NSPR_LINK) $(SASL_LINK) $(SVRCORE_LINK) $(LIBNSL) $(LIBSOCKET) $(THREADLIB)
# We need to link ns-slapd with the C++ compiler on HP-UX since we load
# some C++ shared libraries (such as icu).
diff --git a/Makefile.in b/Makefile.in
index 12215d7..d5574ed 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1000,7 +1000,8 @@ ns_slapd_DEPENDENCIES = libslapd.la libldaputil.a \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
am_pwdhash_bin_OBJECTS = \
ldap/servers/slapd/tools/pwdhash_bin-pwenc.$(OBJEXT)
pwdhash_bin_OBJECTS = $(am_pwdhash_bin_OBJECTS)
@@ -1431,6 +1432,7 @@ PCRE_LINK = @pcre_lib@ -lpcre
NETSNMP_LINK = @netsnmp_lib@ @netsnmp_link@
PAM_LINK = -lpam
KERBEROS_LINK = $(kerberos_lib)
+DLOPEN_LINK = -ldl
#------------------------
# Generated Sources
@@ -2666,7 +2668,7 @@ ns_slapd_SOURCES = ldap/servers/slapd/abandon.c \
ns_slapd_CPPFLAGS = $(AM_CPPFLAGS) @sasl_inc@ @openldap_inc@ @ldapsdk_inc@ @nss_inc@ \
@nspr_inc@ @svrcore_inc@
-ns_slapd_LDADD = libslapd.la libldaputil.a $(LDAPSDK_LINK) $(NSS_LINK) \
+ns_slapd_LDADD = libslapd.la libldaputil.a $(LDAPSDK_LINK) $(NSS_LINK) $(DLOPEN_LINK) \
$(NSPR_LINK) $(SASL_LINK) $(SVRCORE_LINK) $(LIBNSL) $(LIBSOCKET) $(THREADLIB)
@HPUX_FALSE@ns_slapd_LINK = $(LINK)
diff --git a/ldap/servers/slapd/dynalib.c b/ldap/servers/slapd/dynalib.c
index 0448537..367fbba 100644
--- a/ldap/servers/slapd/dynalib.c
+++ b/ldap/servers/slapd/dynalib.c
@@ -107,7 +107,7 @@ sym_load_with_flags( char *libpath, char *symbol, char *plugin, int report_error
}
if (PR_SUCCESS != PR_Access(libpath, PR_ACCESS_READ_OK)) {
- if (strncmp(libpath, PLUGINDIR, strlen(PLUGINDIR))) {
+ if (strncmp(libpath, PLUGINDIR, strlen(PLUGINDIR)) && libpath[0] != '/') {
libSpec.value.pathname = slapi_get_plugin_name(PLUGINDIR, libpath);
} else {
libSpec.value.pathname = slapi_get_plugin_name(NULL, libpath);
diff --git a/ldap/servers/slapd/fedse.c b/ldap/servers/slapd/fedse.c
index cb6c2ed..0b537bb 100644
--- a/ldap/servers/slapd/fedse.c
+++ b/ldap/servers/slapd/fedse.c
@@ -67,6 +67,7 @@
#include <errno.h>
#include <prio.h>
#include <prcountr.h>
+#include <dlfcn.h>
#include "slap.h"
#include "fe.h"
@@ -1921,7 +1922,6 @@ check_plugin_path(Slapi_PBlock *pb,
{
/* check for invalid nsslapd-pluginPath */
char **vals = slapi_entry_attr_get_charray (e, ATTR_PLUGIN_PATH);
- int plugindir_len = sizeof(PLUGINDIR)-1;
int j = 0;
int rc = SLAPI_DSE_CALLBACK_OK;
@@ -1930,6 +1930,7 @@ check_plugin_path(Slapi_PBlock *pb,
vals = slapi_entry_attr_get_charray (entryBefore, ATTR_PLUGIN_PATH);
}
for (j = 0; vals && vals[j]; j++) {
+ void *handle;
char *full_path = NULL;
char *resolved_path = NULL;
char *res = NULL;
@@ -1942,10 +1943,12 @@ check_plugin_path(Slapi_PBlock *pb,
resolved_path = slapi_ch_malloc(strlen(full_path) + 1);
res = realpath( full_path, resolved_path );
if (res) {
- if (strncmp(PLUGINDIR, resolved_path, plugindir_len) != 0) {
+ if ((handle = dlopen(res, RTLD_NOW)) == NULL) {
*returncode = LDAP_UNWILLING_TO_PERFORM;
- PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE,"Invalid plugin path");
+ PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE,"Invalid plugin path - failed to open library");
rc = SLAPI_DSE_CALLBACK_ERROR;
+ } else {
+ dlclose(handle);
}
} else {
*returncode = LDAP_UNWILLING_TO_PERFORM;
10 years, 4 months
ldap/servers Makefile.am Makefile.in
by Mark Reynolds
Makefile.am | 3 ++-
Makefile.in | 6 ++++--
ldap/servers/slapd/dynalib.c | 2 +-
ldap/servers/slapd/fedse.c | 9 ++++++---
4 files changed, 13 insertions(+), 7 deletions(-)
New commits:
commit d8e8a90fd151d131666d9d72bd6d40d356f4bdf0
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Wed Dec 11 16:13:11 2013 -0500
Ticket 47601 - Plugin library path validation prevents intentional loading of out-of-tree modules
Bug Description: The fix for ticket 47384 does not allow plugins to have their shared libs stored
anywhere else but in the default location.
Fix Description: Allow plugin paths that are not in the default area if the absolute path has been
specified, and the library can be opened.
https://fedorahosted.org/389/ticket/47601
Reviewed by: rmeggins(Thanks!)
diff --git a/Makefile.am b/Makefile.am
index bfa42f5..26174bf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -65,6 +65,7 @@ PCRE_LINK = @pcre_lib@ -lpcre
NETSNMP_LINK = @netsnmp_lib@ @netsnmp_link@
PAM_LINK = -lpam
KERBEROS_LINK = $(kerberos_lib)
+DLOPEN_LINK = -ldl
LIBSOCKET=@LIBSOCKET@
LIBNSL=@LIBNSL@
@@ -1462,7 +1463,7 @@ ns_slapd_SOURCES = ldap/servers/slapd/abandon.c \
ns_slapd_CPPFLAGS = $(AM_CPPFLAGS) @sasl_inc@ @openldap_inc@ @ldapsdk_inc@ @nss_inc@ \
@nspr_inc@ @svrcore_inc@
-ns_slapd_LDADD = libslapd.la libldaputil.a $(LDAPSDK_LINK) $(NSS_LINK) \
+ns_slapd_LDADD = libslapd.la libldaputil.a $(LDAPSDK_LINK) $(NSS_LINK) $(DLOPEN_LINK) \
$(NSPR_LINK) $(SASL_LINK) $(SVRCORE_LINK) $(LIBNSL) $(LIBSOCKET) $(THREADLIB)
# We need to link ns-slapd with the C++ compiler on HP-UX since we load
# some C++ shared libraries (such as icu).
diff --git a/Makefile.in b/Makefile.in
index fb4f2a9..3b6e477 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1063,7 +1063,8 @@ ns_slapd_DEPENDENCIES = libslapd.la libldaputil.a \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
am_pwdhash_bin_OBJECTS = \
ldap/servers/slapd/tools/pwdhash_bin-pwenc.$(OBJEXT)
pwdhash_bin_OBJECTS = $(am_pwdhash_bin_OBJECTS)
@@ -1548,6 +1549,7 @@ PCRE_LINK = @pcre_lib@ -lpcre
NETSNMP_LINK = @netsnmp_lib@ @netsnmp_link@
PAM_LINK = -lpam
KERBEROS_LINK = $(kerberos_lib)
+DLOPEN_LINK = -ldl
#------------------------
# Generated Sources
@@ -2783,7 +2785,7 @@ ns_slapd_SOURCES = ldap/servers/slapd/abandon.c \
ns_slapd_CPPFLAGS = $(AM_CPPFLAGS) @sasl_inc@ @openldap_inc@ @ldapsdk_inc@ @nss_inc@ \
@nspr_inc@ @svrcore_inc@
-ns_slapd_LDADD = libslapd.la libldaputil.a $(LDAPSDK_LINK) $(NSS_LINK) \
+ns_slapd_LDADD = libslapd.la libldaputil.a $(LDAPSDK_LINK) $(NSS_LINK) $(DLOPEN_LINK) \
$(NSPR_LINK) $(SASL_LINK) $(SVRCORE_LINK) $(LIBNSL) $(LIBSOCKET) $(THREADLIB)
@HPUX_FALSE@ns_slapd_LINK = $(LINK)
diff --git a/ldap/servers/slapd/dynalib.c b/ldap/servers/slapd/dynalib.c
index 0448537..367fbba 100644
--- a/ldap/servers/slapd/dynalib.c
+++ b/ldap/servers/slapd/dynalib.c
@@ -107,7 +107,7 @@ sym_load_with_flags( char *libpath, char *symbol, char *plugin, int report_error
}
if (PR_SUCCESS != PR_Access(libpath, PR_ACCESS_READ_OK)) {
- if (strncmp(libpath, PLUGINDIR, strlen(PLUGINDIR))) {
+ if (strncmp(libpath, PLUGINDIR, strlen(PLUGINDIR)) && libpath[0] != '/') {
libSpec.value.pathname = slapi_get_plugin_name(PLUGINDIR, libpath);
} else {
libSpec.value.pathname = slapi_get_plugin_name(NULL, libpath);
diff --git a/ldap/servers/slapd/fedse.c b/ldap/servers/slapd/fedse.c
index cb6c2ed..0b537bb 100644
--- a/ldap/servers/slapd/fedse.c
+++ b/ldap/servers/slapd/fedse.c
@@ -67,6 +67,7 @@
#include <errno.h>
#include <prio.h>
#include <prcountr.h>
+#include <dlfcn.h>
#include "slap.h"
#include "fe.h"
@@ -1921,7 +1922,6 @@ check_plugin_path(Slapi_PBlock *pb,
{
/* check for invalid nsslapd-pluginPath */
char **vals = slapi_entry_attr_get_charray (e, ATTR_PLUGIN_PATH);
- int plugindir_len = sizeof(PLUGINDIR)-1;
int j = 0;
int rc = SLAPI_DSE_CALLBACK_OK;
@@ -1930,6 +1930,7 @@ check_plugin_path(Slapi_PBlock *pb,
vals = slapi_entry_attr_get_charray (entryBefore, ATTR_PLUGIN_PATH);
}
for (j = 0; vals && vals[j]; j++) {
+ void *handle;
char *full_path = NULL;
char *resolved_path = NULL;
char *res = NULL;
@@ -1942,10 +1943,12 @@ check_plugin_path(Slapi_PBlock *pb,
resolved_path = slapi_ch_malloc(strlen(full_path) + 1);
res = realpath( full_path, resolved_path );
if (res) {
- if (strncmp(PLUGINDIR, resolved_path, plugindir_len) != 0) {
+ if ((handle = dlopen(res, RTLD_NOW)) == NULL) {
*returncode = LDAP_UNWILLING_TO_PERFORM;
- PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE,"Invalid plugin path");
+ PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE,"Invalid plugin path - failed to open library");
rc = SLAPI_DSE_CALLBACK_ERROR;
+ } else {
+ dlclose(handle);
}
} else {
*returncode = LDAP_UNWILLING_TO_PERFORM;
10 years, 4 months
Branch '389-ds-base-1.3.0' - ldap/servers
by Mark Reynolds
ldap/servers/plugins/replication/cl5_api.c | 2 -
ldap/servers/plugins/replication/repl5_ruv.c | 42 +++++++++++++++++++++------
ldap/servers/plugins/replication/repl5_ruv.h | 3 +
3 files changed, 37 insertions(+), 10 deletions(-)
New commits:
commit 5dfbef117ee019fd79f4b2297a1280e7c6f64641
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Wed Dec 11 11:25:44 2013 -0500
Ticket 47627 - changelog iteration should ignore cleaned rids when getting the minCSN
Description: If a change is not found in the change log the server will look for a min csn
to start the replay. This minCSN should not come from a cleaned RUV element.
https://fedorahosted.org/389/ticket/47627
Reviewed by: rmeggins & lkrispenz(Thanks!!)
(cherry picked from commit 9c6e9bb12327a2d50e651221614d34984b605427)
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index f17650d..a769fa7 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -5132,7 +5132,7 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum
{
/* use the supplier min csn for the buffer start csn - we know
this csn is in our changelog */
- if ((RUV_SUCCESS == ruv_get_min_csn(supplierRuv, &startCSN)) &&
+ if ((RUV_SUCCESS == ruv_get_min_csn_ext(supplierRuv, &startCSN, 1 /* ignore cleaned rids */)) &&
startCSN)
{ /* must now free startCSN */
if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) {
diff --git a/ldap/servers/plugins/replication/repl5_ruv.c b/ldap/servers/plugins/replication/repl5_ruv.c
index 2808c58..d9a3b26 100644
--- a/ldap/servers/plugins/replication/repl5_ruv.c
+++ b/ldap/servers/plugins/replication/repl5_ruv.c
@@ -986,9 +986,9 @@ ruv_covers_csn_cleanallruv(const RUV *ruv, const CSN *csn)
* or max{maxcsns of all ruv elements} if get_the_max != 0.
*/
static int
-ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid)
+ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid, int ignore_cleaned_rid)
{
- int return_value;
+ int return_value = RUV_SUCCESS;
if (ruv == NULL || csn == NULL)
{
@@ -1000,6 +1000,7 @@ ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid
CSN *found = NULL;
RUVElement *replica;
int cookie;
+
slapi_rwlock_rdlock (ruv->lock);
for (replica = dl_get_first (ruv->elements, &cookie); replica;
replica = dl_get_next (ruv->elements, &cookie))
@@ -1016,6 +1017,10 @@ ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid
{
continue;
}
+ if(ignore_cleaned_rid && is_cleaned_rid(replica->rid)){
+ continue;
+ }
+
if(rid){ /* we are only interested in this rid's maxcsn */
if(replica->rid == rid){
found = replica->csn;
@@ -1029,36 +1034,55 @@ ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid
found = replica->csn;
}
}
- }
+ }
+
if (found == NULL)
{
- *csn = NULL;
+ *csn = NULL;
}
else
{
*csn = csn_dup (found);
}
slapi_rwlock_unlock (ruv->lock);
- return_value = RUV_SUCCESS;
}
return return_value;
}
int
-ruv_get_rid_max_csn(const RUV *ruv, CSN **csn, ReplicaId rid){
- return ruv_get_min_or_max_csn(ruv, csn, 1 /* get the max */, rid);
+ruv_get_rid_max_csn(const RUV *ruv, CSN **csn, ReplicaId rid)
+{
+ return ruv_get_rid_max_csn_ext(ruv, csn, rid, 0);
+}
+
+int
+ruv_get_rid_max_csn_ext(const RUV *ruv, CSN **csn, ReplicaId rid, int ignore_cleaned_rid)
+{
+ return ruv_get_min_or_max_csn(ruv, csn, 1 /* get the max */, rid, ignore_cleaned_rid);
}
int
ruv_get_max_csn(const RUV *ruv, CSN **csn)
{
- return ruv_get_min_or_max_csn(ruv, csn, 1 /* get the max */, 0 /* rid */);
+ return ruv_get_max_csn_ext(ruv, csn, 0);
+}
+
+int
+ruv_get_max_csn_ext(const RUV *ruv, CSN **csn, int ignore_cleaned_rid)
+{
+ return ruv_get_min_or_max_csn(ruv, csn, 1 /* get the max */, 0 /* rid */, ignore_cleaned_rid);
}
int
ruv_get_min_csn(const RUV *ruv, CSN **csn)
{
- return ruv_get_min_or_max_csn(ruv, csn, 0 /* get the min */, 0 /* rid */);
+ return ruv_get_min_csn_ext(ruv, csn, 0);
+}
+
+int
+ruv_get_min_csn_ext(const RUV *ruv, CSN **csn, int ignore_cleaned_rid)
+{
+ return ruv_get_min_or_max_csn(ruv, csn, 0 /* get the min */, 0 /* rid */, ignore_cleaned_rid);
}
int
diff --git a/ldap/servers/plugins/replication/repl5_ruv.h b/ldap/servers/plugins/replication/repl5_ruv.h
index fdc8af2..5264395 100644
--- a/ldap/servers/plugins/replication/repl5_ruv.h
+++ b/ldap/servers/plugins/replication/repl5_ruv.h
@@ -118,8 +118,11 @@ PRBool ruv_covers_csn(const RUV *ruv, const CSN *csn);
PRBool ruv_covers_csn_strict(const RUV *ruv, const CSN *csn);
PRBool ruv_covers_csn_cleanallruv(const RUV *ruv, const CSN *csn);
int ruv_get_min_csn(const RUV *ruv, CSN **csn);
+int ruv_get_min_csn_ext(const RUV *ruv, CSN **csn, int ignore_cleaned_rid);
int ruv_get_max_csn(const RUV *ruv, CSN **csn);
+int ruv_get_max_csn_ext(const RUV *ruv, CSN **csn, int ignore_cleaned_rid);
int ruv_get_rid_max_csn(const RUV *ruv, CSN **csn, ReplicaId rid);
+int ruv_get_rid_max_csn_ext(const RUV *ruv, CSN **csn, ReplicaId rid, int ignore_cleaned_rid);
int ruv_enumerate_elements (const RUV *ruv, FNEnumRUV fn, void *arg);
int ruv_to_smod(const RUV *ruv, Slapi_Mod *smod);
int ruv_last_modified_to_smod(const RUV *ruv, Slapi_Mod *smod);
10 years, 4 months
Branch '389-ds-base-1.2.11' - ldap/servers
by Mark Reynolds
ldap/servers/plugins/replication/cl5_api.c | 2 -
ldap/servers/plugins/replication/repl5_ruv.c | 42 +++++++++++++++++++++------
ldap/servers/plugins/replication/repl5_ruv.h | 3 +
3 files changed, 37 insertions(+), 10 deletions(-)
New commits:
commit e746f7e02826bce27819c1a4ca514ef3d23085c5
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Wed Dec 11 11:25:44 2013 -0500
Ticket 47627 - changelog iteration should ignore cleaned rids when getting the minCSN
Description: If a change is not found in the change log the server will look for a min csn
to start the replay. This minCSN should not come from a cleaned RUV element.
https://fedorahosted.org/389/ticket/47627
Reviewed by: rmeggins & lkrispenz(Thanks!!)
(cherry picked from commit 9c6e9bb12327a2d50e651221614d34984b605427)
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index f2e038e..55bda39 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -5132,7 +5132,7 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum
{
/* use the supplier min csn for the buffer start csn - we know
this csn is in our changelog */
- if ((RUV_SUCCESS == ruv_get_min_csn(supplierRuv, &startCSN)) &&
+ if ((RUV_SUCCESS == ruv_get_min_csn_ext(supplierRuv, &startCSN, 1 /* ignore cleaned rids */)) &&
startCSN)
{ /* must now free startCSN */
if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) {
diff --git a/ldap/servers/plugins/replication/repl5_ruv.c b/ldap/servers/plugins/replication/repl5_ruv.c
index 2808c58..d9a3b26 100644
--- a/ldap/servers/plugins/replication/repl5_ruv.c
+++ b/ldap/servers/plugins/replication/repl5_ruv.c
@@ -986,9 +986,9 @@ ruv_covers_csn_cleanallruv(const RUV *ruv, const CSN *csn)
* or max{maxcsns of all ruv elements} if get_the_max != 0.
*/
static int
-ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid)
+ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid, int ignore_cleaned_rid)
{
- int return_value;
+ int return_value = RUV_SUCCESS;
if (ruv == NULL || csn == NULL)
{
@@ -1000,6 +1000,7 @@ ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid
CSN *found = NULL;
RUVElement *replica;
int cookie;
+
slapi_rwlock_rdlock (ruv->lock);
for (replica = dl_get_first (ruv->elements, &cookie); replica;
replica = dl_get_next (ruv->elements, &cookie))
@@ -1016,6 +1017,10 @@ ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid
{
continue;
}
+ if(ignore_cleaned_rid && is_cleaned_rid(replica->rid)){
+ continue;
+ }
+
if(rid){ /* we are only interested in this rid's maxcsn */
if(replica->rid == rid){
found = replica->csn;
@@ -1029,36 +1034,55 @@ ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid
found = replica->csn;
}
}
- }
+ }
+
if (found == NULL)
{
- *csn = NULL;
+ *csn = NULL;
}
else
{
*csn = csn_dup (found);
}
slapi_rwlock_unlock (ruv->lock);
- return_value = RUV_SUCCESS;
}
return return_value;
}
int
-ruv_get_rid_max_csn(const RUV *ruv, CSN **csn, ReplicaId rid){
- return ruv_get_min_or_max_csn(ruv, csn, 1 /* get the max */, rid);
+ruv_get_rid_max_csn(const RUV *ruv, CSN **csn, ReplicaId rid)
+{
+ return ruv_get_rid_max_csn_ext(ruv, csn, rid, 0);
+}
+
+int
+ruv_get_rid_max_csn_ext(const RUV *ruv, CSN **csn, ReplicaId rid, int ignore_cleaned_rid)
+{
+ return ruv_get_min_or_max_csn(ruv, csn, 1 /* get the max */, rid, ignore_cleaned_rid);
}
int
ruv_get_max_csn(const RUV *ruv, CSN **csn)
{
- return ruv_get_min_or_max_csn(ruv, csn, 1 /* get the max */, 0 /* rid */);
+ return ruv_get_max_csn_ext(ruv, csn, 0);
+}
+
+int
+ruv_get_max_csn_ext(const RUV *ruv, CSN **csn, int ignore_cleaned_rid)
+{
+ return ruv_get_min_or_max_csn(ruv, csn, 1 /* get the max */, 0 /* rid */, ignore_cleaned_rid);
}
int
ruv_get_min_csn(const RUV *ruv, CSN **csn)
{
- return ruv_get_min_or_max_csn(ruv, csn, 0 /* get the min */, 0 /* rid */);
+ return ruv_get_min_csn_ext(ruv, csn, 0);
+}
+
+int
+ruv_get_min_csn_ext(const RUV *ruv, CSN **csn, int ignore_cleaned_rid)
+{
+ return ruv_get_min_or_max_csn(ruv, csn, 0 /* get the min */, 0 /* rid */, ignore_cleaned_rid);
}
int
diff --git a/ldap/servers/plugins/replication/repl5_ruv.h b/ldap/servers/plugins/replication/repl5_ruv.h
index fdc8af2..5264395 100644
--- a/ldap/servers/plugins/replication/repl5_ruv.h
+++ b/ldap/servers/plugins/replication/repl5_ruv.h
@@ -118,8 +118,11 @@ PRBool ruv_covers_csn(const RUV *ruv, const CSN *csn);
PRBool ruv_covers_csn_strict(const RUV *ruv, const CSN *csn);
PRBool ruv_covers_csn_cleanallruv(const RUV *ruv, const CSN *csn);
int ruv_get_min_csn(const RUV *ruv, CSN **csn);
+int ruv_get_min_csn_ext(const RUV *ruv, CSN **csn, int ignore_cleaned_rid);
int ruv_get_max_csn(const RUV *ruv, CSN **csn);
+int ruv_get_max_csn_ext(const RUV *ruv, CSN **csn, int ignore_cleaned_rid);
int ruv_get_rid_max_csn(const RUV *ruv, CSN **csn, ReplicaId rid);
+int ruv_get_rid_max_csn_ext(const RUV *ruv, CSN **csn, ReplicaId rid, int ignore_cleaned_rid);
int ruv_enumerate_elements (const RUV *ruv, FNEnumRUV fn, void *arg);
int ruv_to_smod(const RUV *ruv, Slapi_Mod *smod);
int ruv_last_modified_to_smod(const RUV *ruv, Slapi_Mod *smod);
10 years, 4 months
Branch '389-ds-base-1.3.1' - ldap/servers
by Mark Reynolds
ldap/servers/plugins/replication/cl5_api.c | 2 -
ldap/servers/plugins/replication/repl5_ruv.c | 42 +++++++++++++++++++++------
ldap/servers/plugins/replication/repl5_ruv.h | 3 +
3 files changed, 37 insertions(+), 10 deletions(-)
New commits:
commit 8004449ae206d0d417497324ffedf79ca9e25572
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Wed Dec 11 11:25:44 2013 -0500
Ticket 47627 - changelog iteration should ignore cleaned rids when getting the minCSN
Description: If a change is not found in the change log the server will look for a min csn
to start the replay. This minCSN should not come from a cleaned RUV element.
https://fedorahosted.org/389/ticket/47627
Reviewed by: rmeggins & lkrispenz(Thanks!!)
(cherry picked from commit 9c6e9bb12327a2d50e651221614d34984b605427)
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 7bedc2c..064a628 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -5172,7 +5172,7 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum
{
/* use the supplier min csn for the buffer start csn - we know
this csn is in our changelog */
- if ((RUV_SUCCESS == ruv_get_min_csn(supplierRuv, &startCSN)) &&
+ if ((RUV_SUCCESS == ruv_get_min_csn_ext(supplierRuv, &startCSN, 1 /* ignore cleaned rids */)) &&
startCSN)
{ /* must now free startCSN */
if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) {
diff --git a/ldap/servers/plugins/replication/repl5_ruv.c b/ldap/servers/plugins/replication/repl5_ruv.c
index 7395195..dc83555 100644
--- a/ldap/servers/plugins/replication/repl5_ruv.c
+++ b/ldap/servers/plugins/replication/repl5_ruv.c
@@ -998,9 +998,9 @@ ruv_covers_csn_cleanallruv(const RUV *ruv, const CSN *csn)
* or max{maxcsns of all ruv elements} if get_the_max != 0.
*/
static int
-ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid)
+ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid, int ignore_cleaned_rid)
{
- int return_value;
+ int return_value = RUV_SUCCESS;
if (ruv == NULL || csn == NULL)
{
@@ -1012,6 +1012,7 @@ ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid
CSN *found = NULL;
RUVElement *replica;
int cookie;
+
slapi_rwlock_rdlock (ruv->lock);
for (replica = dl_get_first (ruv->elements, &cookie); replica;
replica = dl_get_next (ruv->elements, &cookie))
@@ -1028,6 +1029,10 @@ ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid
{
continue;
}
+ if(ignore_cleaned_rid && is_cleaned_rid(replica->rid)){
+ continue;
+ }
+
if(rid){ /* we are only interested in this rid's maxcsn */
if(replica->rid == rid){
found = replica->csn;
@@ -1041,36 +1046,55 @@ ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid
found = replica->csn;
}
}
- }
+ }
+
if (found == NULL)
{
- *csn = NULL;
+ *csn = NULL;
}
else
{
*csn = csn_dup (found);
}
slapi_rwlock_unlock (ruv->lock);
- return_value = RUV_SUCCESS;
}
return return_value;
}
int
-ruv_get_rid_max_csn(const RUV *ruv, CSN **csn, ReplicaId rid){
- return ruv_get_min_or_max_csn(ruv, csn, 1 /* get the max */, rid);
+ruv_get_rid_max_csn(const RUV *ruv, CSN **csn, ReplicaId rid)
+{
+ return ruv_get_rid_max_csn_ext(ruv, csn, rid, 0);
+}
+
+int
+ruv_get_rid_max_csn_ext(const RUV *ruv, CSN **csn, ReplicaId rid, int ignore_cleaned_rid)
+{
+ return ruv_get_min_or_max_csn(ruv, csn, 1 /* get the max */, rid, ignore_cleaned_rid);
}
int
ruv_get_max_csn(const RUV *ruv, CSN **csn)
{
- return ruv_get_min_or_max_csn(ruv, csn, 1 /* get the max */, 0 /* rid */);
+ return ruv_get_max_csn_ext(ruv, csn, 0);
+}
+
+int
+ruv_get_max_csn_ext(const RUV *ruv, CSN **csn, int ignore_cleaned_rid)
+{
+ return ruv_get_min_or_max_csn(ruv, csn, 1 /* get the max */, 0 /* rid */, ignore_cleaned_rid);
}
int
ruv_get_min_csn(const RUV *ruv, CSN **csn)
{
- return ruv_get_min_or_max_csn(ruv, csn, 0 /* get the min */, 0 /* rid */);
+ return ruv_get_min_csn_ext(ruv, csn, 0);
+}
+
+int
+ruv_get_min_csn_ext(const RUV *ruv, CSN **csn, int ignore_cleaned_rid)
+{
+ return ruv_get_min_or_max_csn(ruv, csn, 0 /* get the min */, 0 /* rid */, ignore_cleaned_rid);
}
int
diff --git a/ldap/servers/plugins/replication/repl5_ruv.h b/ldap/servers/plugins/replication/repl5_ruv.h
index 799dc7f..4593b84 100644
--- a/ldap/servers/plugins/replication/repl5_ruv.h
+++ b/ldap/servers/plugins/replication/repl5_ruv.h
@@ -123,8 +123,11 @@ PRBool ruv_covers_csn(const RUV *ruv, const CSN *csn);
PRBool ruv_covers_csn_strict(const RUV *ruv, const CSN *csn);
PRBool ruv_covers_csn_cleanallruv(const RUV *ruv, const CSN *csn);
int ruv_get_min_csn(const RUV *ruv, CSN **csn);
+int ruv_get_min_csn_ext(const RUV *ruv, CSN **csn, int ignore_cleaned_rid);
int ruv_get_max_csn(const RUV *ruv, CSN **csn);
+int ruv_get_max_csn_ext(const RUV *ruv, CSN **csn, int ignore_cleaned_rid);
int ruv_get_rid_max_csn(const RUV *ruv, CSN **csn, ReplicaId rid);
+int ruv_get_rid_max_csn_ext(const RUV *ruv, CSN **csn, ReplicaId rid, int ignore_cleaned_rid);
int ruv_enumerate_elements (const RUV *ruv, FNEnumRUV fn, void *arg);
int ruv_to_smod(const RUV *ruv, Slapi_Mod *smod);
int ruv_last_modified_to_smod(const RUV *ruv, Slapi_Mod *smod);
10 years, 4 months
Branch '389-ds-base-1.3.2' - ldap/servers
by Mark Reynolds
ldap/servers/plugins/replication/cl5_api.c | 2 -
ldap/servers/plugins/replication/repl5_ruv.c | 42 +++++++++++++++++++++------
ldap/servers/plugins/replication/repl5_ruv.h | 3 +
3 files changed, 37 insertions(+), 10 deletions(-)
New commits:
commit 37d922fe3a5b09a30d78ade3608d6de9806151a6
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Wed Dec 11 11:25:44 2013 -0500
Ticket 47627 - changelog iteration should ignore cleaned rids when getting the minCSN
Description: If a change is not found in the change log the server will look for a min csn
to start the replay. This minCSN should not come from a cleaned RUV element.
https://fedorahosted.org/389/ticket/47627
Reviewed by: rmeggins & lkrispenz(Thanks!!)
(cherry picked from commit 9c6e9bb12327a2d50e651221614d34984b605427)
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 35553b9..0fecf8c 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -5252,7 +5252,7 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum
{
/* use the supplier min csn for the buffer start csn - we know
this csn is in our changelog */
- if ((RUV_SUCCESS == ruv_get_min_csn(supplierRuv, &startCSN)) &&
+ if ((RUV_SUCCESS == ruv_get_min_csn_ext(supplierRuv, &startCSN, 1 /* ignore cleaned rids */)) &&
startCSN)
{ /* must now free startCSN */
if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) {
diff --git a/ldap/servers/plugins/replication/repl5_ruv.c b/ldap/servers/plugins/replication/repl5_ruv.c
index b68223b..1c3e92e 100644
--- a/ldap/servers/plugins/replication/repl5_ruv.c
+++ b/ldap/servers/plugins/replication/repl5_ruv.c
@@ -998,9 +998,9 @@ ruv_covers_csn_cleanallruv(const RUV *ruv, const CSN *csn)
* or max{maxcsns of all ruv elements} if get_the_max != 0.
*/
static int
-ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid)
+ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid, int ignore_cleaned_rid)
{
- int return_value;
+ int return_value = RUV_SUCCESS;
if (ruv == NULL || csn == NULL)
{
@@ -1012,6 +1012,7 @@ ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid
CSN *found = NULL;
RUVElement *replica;
int cookie;
+
slapi_rwlock_rdlock (ruv->lock);
for (replica = dl_get_first (ruv->elements, &cookie); replica;
replica = dl_get_next (ruv->elements, &cookie))
@@ -1028,6 +1029,10 @@ ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid
{
continue;
}
+ if(ignore_cleaned_rid && is_cleaned_rid(replica->rid)){
+ continue;
+ }
+
if(rid){ /* we are only interested in this rid's maxcsn */
if(replica->rid == rid){
found = replica->csn;
@@ -1041,36 +1046,55 @@ ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid
found = replica->csn;
}
}
- }
+ }
+
if (found == NULL)
{
- *csn = NULL;
+ *csn = NULL;
}
else
{
*csn = csn_dup (found);
}
slapi_rwlock_unlock (ruv->lock);
- return_value = RUV_SUCCESS;
}
return return_value;
}
int
-ruv_get_rid_max_csn(const RUV *ruv, CSN **csn, ReplicaId rid){
- return ruv_get_min_or_max_csn(ruv, csn, 1 /* get the max */, rid);
+ruv_get_rid_max_csn(const RUV *ruv, CSN **csn, ReplicaId rid)
+{
+ return ruv_get_rid_max_csn_ext(ruv, csn, rid, 0);
+}
+
+int
+ruv_get_rid_max_csn_ext(const RUV *ruv, CSN **csn, ReplicaId rid, int ignore_cleaned_rid)
+{
+ return ruv_get_min_or_max_csn(ruv, csn, 1 /* get the max */, rid, ignore_cleaned_rid);
}
int
ruv_get_max_csn(const RUV *ruv, CSN **csn)
{
- return ruv_get_min_or_max_csn(ruv, csn, 1 /* get the max */, 0 /* rid */);
+ return ruv_get_max_csn_ext(ruv, csn, 0);
+}
+
+int
+ruv_get_max_csn_ext(const RUV *ruv, CSN **csn, int ignore_cleaned_rid)
+{
+ return ruv_get_min_or_max_csn(ruv, csn, 1 /* get the max */, 0 /* rid */, ignore_cleaned_rid);
}
int
ruv_get_min_csn(const RUV *ruv, CSN **csn)
{
- return ruv_get_min_or_max_csn(ruv, csn, 0 /* get the min */, 0 /* rid */);
+ return ruv_get_min_csn_ext(ruv, csn, 0);
+}
+
+int
+ruv_get_min_csn_ext(const RUV *ruv, CSN **csn, int ignore_cleaned_rid)
+{
+ return ruv_get_min_or_max_csn(ruv, csn, 0 /* get the min */, 0 /* rid */, ignore_cleaned_rid);
}
int
diff --git a/ldap/servers/plugins/replication/repl5_ruv.h b/ldap/servers/plugins/replication/repl5_ruv.h
index a5a0c19..ae7d25c 100644
--- a/ldap/servers/plugins/replication/repl5_ruv.h
+++ b/ldap/servers/plugins/replication/repl5_ruv.h
@@ -123,8 +123,11 @@ PRBool ruv_covers_csn(const RUV *ruv, const CSN *csn);
PRBool ruv_covers_csn_strict(const RUV *ruv, const CSN *csn);
PRBool ruv_covers_csn_cleanallruv(const RUV *ruv, const CSN *csn);
int ruv_get_min_csn(const RUV *ruv, CSN **csn);
+int ruv_get_min_csn_ext(const RUV *ruv, CSN **csn, int ignore_cleaned_rid);
int ruv_get_max_csn(const RUV *ruv, CSN **csn);
+int ruv_get_max_csn_ext(const RUV *ruv, CSN **csn, int ignore_cleaned_rid);
int ruv_get_rid_max_csn(const RUV *ruv, CSN **csn, ReplicaId rid);
+int ruv_get_rid_max_csn_ext(const RUV *ruv, CSN **csn, ReplicaId rid, int ignore_cleaned_rid);
int ruv_enumerate_elements (const RUV *ruv, FNEnumRUV fn, void *arg);
Slapi_Value **ruv_last_modified_to_valuearray(RUV *ruv);
Slapi_Value **ruv_to_valuearray(RUV *ruv);
10 years, 4 months
ldap/servers
by Mark Reynolds
ldap/servers/plugins/replication/cl5_api.c | 2 -
ldap/servers/plugins/replication/repl5_ruv.c | 42 +++++++++++++++++++++------
ldap/servers/plugins/replication/repl5_ruv.h | 3 +
3 files changed, 37 insertions(+), 10 deletions(-)
New commits:
commit 9c6e9bb12327a2d50e651221614d34984b605427
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Wed Dec 11 11:25:44 2013 -0500
Ticket 47627 - changelog iteration should ignore cleaned rids when getting the minCSN
Description: If a change is not found in the change log the server will look for a min csn
to start the replay. This minCSN should not come from a cleaned RUV element.
https://fedorahosted.org/389/ticket/47627
Reviewed by: rmeggins & lkrispenz(Thanks!!)
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 35553b9..0fecf8c 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -5252,7 +5252,7 @@ static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consum
{
/* use the supplier min csn for the buffer start csn - we know
this csn is in our changelog */
- if ((RUV_SUCCESS == ruv_get_min_csn(supplierRuv, &startCSN)) &&
+ if ((RUV_SUCCESS == ruv_get_min_csn_ext(supplierRuv, &startCSN, 1 /* ignore cleaned rids */)) &&
startCSN)
{ /* must now free startCSN */
if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) {
diff --git a/ldap/servers/plugins/replication/repl5_ruv.c b/ldap/servers/plugins/replication/repl5_ruv.c
index d6a7448..500fd7a 100644
--- a/ldap/servers/plugins/replication/repl5_ruv.c
+++ b/ldap/servers/plugins/replication/repl5_ruv.c
@@ -998,9 +998,9 @@ ruv_covers_csn_cleanallruv(const RUV *ruv, const CSN *csn)
* or max{maxcsns of all ruv elements} if get_the_max != 0.
*/
static int
-ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid)
+ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid, int ignore_cleaned_rid)
{
- int return_value;
+ int return_value = RUV_SUCCESS;
if (ruv == NULL || csn == NULL)
{
@@ -1012,6 +1012,7 @@ ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid
CSN *found = NULL;
RUVElement *replica;
int cookie;
+
slapi_rwlock_rdlock (ruv->lock);
for (replica = dl_get_first (ruv->elements, &cookie); replica;
replica = dl_get_next (ruv->elements, &cookie))
@@ -1028,6 +1029,10 @@ ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid
{
continue;
}
+ if(ignore_cleaned_rid && is_cleaned_rid(replica->rid)){
+ continue;
+ }
+
if(rid){ /* we are only interested in this rid's maxcsn */
if(replica->rid == rid){
found = replica->csn;
@@ -1041,36 +1046,55 @@ ruv_get_min_or_max_csn(const RUV *ruv, CSN **csn, int get_the_max, ReplicaId rid
found = replica->csn;
}
}
- }
+ }
+
if (found == NULL)
{
- *csn = NULL;
+ *csn = NULL;
}
else
{
*csn = csn_dup (found);
}
slapi_rwlock_unlock (ruv->lock);
- return_value = RUV_SUCCESS;
}
return return_value;
}
int
-ruv_get_rid_max_csn(const RUV *ruv, CSN **csn, ReplicaId rid){
- return ruv_get_min_or_max_csn(ruv, csn, 1 /* get the max */, rid);
+ruv_get_rid_max_csn(const RUV *ruv, CSN **csn, ReplicaId rid)
+{
+ return ruv_get_rid_max_csn_ext(ruv, csn, rid, 0);
+}
+
+int
+ruv_get_rid_max_csn_ext(const RUV *ruv, CSN **csn, ReplicaId rid, int ignore_cleaned_rid)
+{
+ return ruv_get_min_or_max_csn(ruv, csn, 1 /* get the max */, rid, ignore_cleaned_rid);
}
int
ruv_get_max_csn(const RUV *ruv, CSN **csn)
{
- return ruv_get_min_or_max_csn(ruv, csn, 1 /* get the max */, 0 /* rid */);
+ return ruv_get_max_csn_ext(ruv, csn, 0);
+}
+
+int
+ruv_get_max_csn_ext(const RUV *ruv, CSN **csn, int ignore_cleaned_rid)
+{
+ return ruv_get_min_or_max_csn(ruv, csn, 1 /* get the max */, 0 /* rid */, ignore_cleaned_rid);
}
int
ruv_get_min_csn(const RUV *ruv, CSN **csn)
{
- return ruv_get_min_or_max_csn(ruv, csn, 0 /* get the min */, 0 /* rid */);
+ return ruv_get_min_csn_ext(ruv, csn, 0);
+}
+
+int
+ruv_get_min_csn_ext(const RUV *ruv, CSN **csn, int ignore_cleaned_rid)
+{
+ return ruv_get_min_or_max_csn(ruv, csn, 0 /* get the min */, 0 /* rid */, ignore_cleaned_rid);
}
int
diff --git a/ldap/servers/plugins/replication/repl5_ruv.h b/ldap/servers/plugins/replication/repl5_ruv.h
index a5a0c19..ae7d25c 100644
--- a/ldap/servers/plugins/replication/repl5_ruv.h
+++ b/ldap/servers/plugins/replication/repl5_ruv.h
@@ -123,8 +123,11 @@ PRBool ruv_covers_csn(const RUV *ruv, const CSN *csn);
PRBool ruv_covers_csn_strict(const RUV *ruv, const CSN *csn);
PRBool ruv_covers_csn_cleanallruv(const RUV *ruv, const CSN *csn);
int ruv_get_min_csn(const RUV *ruv, CSN **csn);
+int ruv_get_min_csn_ext(const RUV *ruv, CSN **csn, int ignore_cleaned_rid);
int ruv_get_max_csn(const RUV *ruv, CSN **csn);
+int ruv_get_max_csn_ext(const RUV *ruv, CSN **csn, int ignore_cleaned_rid);
int ruv_get_rid_max_csn(const RUV *ruv, CSN **csn, ReplicaId rid);
+int ruv_get_rid_max_csn_ext(const RUV *ruv, CSN **csn, ReplicaId rid, int ignore_cleaned_rid);
int ruv_enumerate_elements (const RUV *ruv, FNEnumRUV fn, void *arg);
Slapi_Value **ruv_last_modified_to_valuearray(RUV *ruv);
Slapi_Value **ruv_to_valuearray(RUV *ruv);
10 years, 4 months