Branch '389-ds-base-1.3.1' - ldap/servers
by Mark Reynolds
ldap/servers/plugins/cos/cos_cache.c | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit a2fc9d46b9ea2997670996d46b8aa94351c8d606
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Tue Dec 2 13:38:06 2014 -0500
Ticket 47969 - COS memory leak when rebuilding the cache
Bug Description: When the COS cache is released, not all of the schema
objectclasses are freed. So every time we rebuild the
COS cache we leak memory.
Fix Description: After we free the schema attributes, the very first
attribute still needs to be freed. It is not freed
initially because of the duplicate checking logic, so
it is now done after the loop.
https://fedorahosted.org/389/ticket/47969
Reviewed by: nhosoi(Thanks!)
(cherry picked from commit d2dfda95c543f106443f898436151b00c68e4270)
diff --git a/ldap/servers/plugins/cos/cos_cache.c b/ldap/servers/plugins/cos/cos_cache.c
index aa737b7..980e49d 100644
--- a/ldap/servers/plugins/cos/cos_cache.c
+++ b/ldap/servers/plugins/cos/cos_cache.c
@@ -1864,6 +1864,8 @@ static void cos_cache_del_schema(cosCache *pCache)
}
}
}
+ /* Finally, remove the first attribute's objectclass list */
+ cos_cache_del_attrval_list(&(pCache->ppAttrIndex[0]->pObjectclasses));
LDAPDebug( LDAP_DEBUG_TRACE, "<-- cos_cache_del_schema\n",0,0,0);
}
9 years, 4 months
Branch '389-ds-base-1.3.2' - ldap/servers
by Mark Reynolds
ldap/servers/plugins/cos/cos_cache.c | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit 5237b2151b6bdff8a39a9d9ff9fc2a2013fb51ab
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Tue Dec 2 13:38:06 2014 -0500
Ticket 47969 - COS memory leak when rebuilding the cache
Bug Description: When the COS cache is released, not all of the schema
objectclasses are freed. So every time we rebuild the
COS cache we leak memory.
Fix Description: After we free the schema attributes, the very first
attribute still needs to be freed. It is not freed
initially because of the duplicate checking logic, so
it is now done after the loop.
https://fedorahosted.org/389/ticket/47969
Reviewed by: nhosoi(Thanks!)
(cherry picked from commit d2dfda95c543f106443f898436151b00c68e4270)
diff --git a/ldap/servers/plugins/cos/cos_cache.c b/ldap/servers/plugins/cos/cos_cache.c
index e3f808d..1174ed1 100644
--- a/ldap/servers/plugins/cos/cos_cache.c
+++ b/ldap/servers/plugins/cos/cos_cache.c
@@ -1864,6 +1864,8 @@ static void cos_cache_del_schema(cosCache *pCache)
}
}
}
+ /* Finally, remove the first attribute's objectclass list */
+ cos_cache_del_attrval_list(&(pCache->ppAttrIndex[0]->pObjectclasses));
LDAPDebug( LDAP_DEBUG_TRACE, "<-- cos_cache_del_schema\n",0,0,0);
}
9 years, 4 months
Branch '389-ds-base-1.3.3' - ldap/servers
by Mark Reynolds
ldap/servers/plugins/cos/cos_cache.c | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit bc47239c5c7e6d19564fcd2839c6f2bd81a5b540
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Tue Dec 2 13:38:06 2014 -0500
Ticket 47969 - COS memory leak when rebuilding the cache
Bug Description: When the COS cache is released, not all of the schema
objectclasses are freed. So every time we rebuild the
COS cache we leak memory.
Fix Description: After we free the schema attributes, the very first
attribute still needs to be freed. It is not freed
initially because of the duplicate checking logic, so
it is now done after the loop.
https://fedorahosted.org/389/ticket/47969
Reviewed by: nhosoi(Thanks!)
(cherry picked from commit d2dfda95c543f106443f898436151b00c68e4270)
diff --git a/ldap/servers/plugins/cos/cos_cache.c b/ldap/servers/plugins/cos/cos_cache.c
index a7993c8..fd163f9 100644
--- a/ldap/servers/plugins/cos/cos_cache.c
+++ b/ldap/servers/plugins/cos/cos_cache.c
@@ -1864,6 +1864,8 @@ static void cos_cache_del_schema(cosCache *pCache)
}
}
}
+ /* Finally, remove the first attribute's objectclass list */
+ cos_cache_del_attrval_list(&(pCache->ppAttrIndex[0]->pObjectclasses));
LDAPDebug( LDAP_DEBUG_TRACE, "<-- cos_cache_del_schema\n",0,0,0);
}
9 years, 4 months
ldap/servers
by Mark Reynolds
ldap/servers/plugins/cos/cos_cache.c | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit d2dfda95c543f106443f898436151b00c68e4270
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Tue Dec 2 13:38:06 2014 -0500
Ticket 47969 - COS memory leak when rebuilding the cache
Bug Description: When the COS cache is released, not all of the schema
objectclasses are freed. So every time we rebuild the
COS cache we leak memory.
Fix Description: After we free the schema attributes, the very first
attribute still needs to be freed. It is not freed
initially because of the duplicate checking logic, so
it is now done after the loop.
https://fedorahosted.org/389/ticket/47969
Reviewed by: nhosoi(Thanks!)
diff --git a/ldap/servers/plugins/cos/cos_cache.c b/ldap/servers/plugins/cos/cos_cache.c
index a7993c8..fd163f9 100644
--- a/ldap/servers/plugins/cos/cos_cache.c
+++ b/ldap/servers/plugins/cos/cos_cache.c
@@ -1864,6 +1864,8 @@ static void cos_cache_del_schema(cosCache *pCache)
}
}
}
+ /* Finally, remove the first attribute's objectclass list */
+ cos_cache_del_attrval_list(&(pCache->ppAttrIndex[0]->pObjectclasses));
LDAPDebug( LDAP_DEBUG_TRACE, "<-- cos_cache_del_schema\n",0,0,0);
}
9 years, 4 months
Branch '389-ds-base-1.2.11' - ldap/servers
by Mark Reynolds
ldap/servers/plugins/cos/cos_cache.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
New commits:
commit 9d03dcd0c0dee48364739e21ed5c131040d88ca7
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Thu Dec 4 11:11:13 2014 -0500
Ticket 47967 - cos_cache_build_definition_list does not stop during server shutdown
Bug Description: If the COS cache is being rebuilt (where there are many COS
definitions/templates), attempting to stop the server can
take take a very long time.
Fix Description: In the callback functions check for server shutdown to abort
out of the search callback loops.
https://fedorahosted.org/389/ticket/47967
Reviewed by: nhosoi(Thanks!)
(cherry picked from commit 99f99743617c1d082e748e7d3e83adf953d2ad05)
diff --git a/ldap/servers/plugins/cos/cos_cache.c b/ldap/servers/plugins/cos/cos_cache.c
index a89f5c5..9c49c12 100644
--- a/ldap/servers/plugins/cos/cos_cache.c
+++ b/ldap/servers/plugins/cos/cos_cache.c
@@ -765,7 +765,7 @@ struct dn_defs_info {
/*
* Currently, always returns 0 to continue the search for definitions, even
* if a particular attempt to add a definition fails: info.ret gets set to
- * zero only if we succed to add a def.
+ * zero only if we succeed to add a def.
*/
static int
cos_dn_defs_cb (Slapi_Entry* e, void *callback_data)
@@ -1099,10 +1099,10 @@ bail:
/* This particular definition may not have yielded anything
* worth caching (eg. no template was found for it) but
* that should not cause us to abort the search for other more well behaved
- * definitions.
+ * definitions unless we are shutting down.
* return info->ret;
- */
- return (0);
+ */
+ return slapi_is_shutting_down();
}
@@ -1159,7 +1159,7 @@ struct tmpl_info {
/*
* Currently, always returns 0 to continue the search for templates, even
* if a particular attempt to add a template fails: info.ret gets set to
- * zero only if we succed to add at least one tmpl.
+ * zero only if we succeed to add at least one tmpl.
*/
static int cos_dn_tmpl_entries_cb (Slapi_Entry* e, void *callback_data) {
cosAttrValue *pDn = 0;
@@ -1209,7 +1209,7 @@ static int cos_dn_tmpl_entries_cb (Slapi_Entry* e, void *callback_data) {
if(pSneakyVal == NULL)
{
- /* look for the atrribute in the dynamic attributes */
+ /* look for the attribute in the dynamic attributes */
if(cos_cache_attrval_exists(info->pAttrs, attrType))
{
pSneakyVal = &pCosAttribute;
@@ -1312,10 +1312,10 @@ static int cos_dn_tmpl_entries_cb (Slapi_Entry* e, void *callback_data) {
}
}
/*
- * Always contine the search even if a particular attempt
- * to add a template failed.
- */
- return 0;
+ * Always continue the search even if a particular attempt
+ * to add a template failed unless we are shutting down
+ */
+ return slapi_is_shutting_down();
}
/*
9 years, 4 months
Branch '389-ds-base-1.3.1' - ldap/servers
by Mark Reynolds
ldap/servers/plugins/cos/cos_cache.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
New commits:
commit a5d8b2c12586d7ec7705664a1523631eac5dc046
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Thu Dec 4 11:11:13 2014 -0500
Ticket 47967 - cos_cache_build_definition_list does not stop during server shutdown
Bug Description: If the COS cache is being rebuilt (where there are many COS
definitions/templates), attempting to stop the server can
take take a very long time.
Fix Description: In the callback functions check for server shutdown to abort
out of the search callback loops.
https://fedorahosted.org/389/ticket/47967
Reviewed by: nhosoi(Thanks!)
(cherry picked from commit 99f99743617c1d082e748e7d3e83adf953d2ad05)
diff --git a/ldap/servers/plugins/cos/cos_cache.c b/ldap/servers/plugins/cos/cos_cache.c
index a68e59f..aa737b7 100644
--- a/ldap/servers/plugins/cos/cos_cache.c
+++ b/ldap/servers/plugins/cos/cos_cache.c
@@ -725,7 +725,7 @@ struct dn_defs_info {
/*
* Currently, always returns 0 to continue the search for definitions, even
* if a particular attempt to add a definition fails: info.ret gets set to
- * zero only if we succed to add a def.
+ * zero only if we succeed to add a def.
*/
static int
cos_dn_defs_cb (Slapi_Entry* e, void *callback_data)
@@ -1056,10 +1056,10 @@ bail:
/* This particular definition may not have yielded anything
* worth caching (eg. no template was found for it) but
* that should not cause us to abort the search for other more well behaved
- * definitions.
+ * definitions unless we are shutting down.
* return info->ret;
- */
- return (0);
+ */
+ return slapi_is_shutting_down();
}
@@ -1116,7 +1116,7 @@ struct tmpl_info {
/*
* Currently, always returns 0 to continue the search for templates, even
* if a particular attempt to add a template fails: info.ret gets set to
- * zero only if we succed to add at least one tmpl.
+ * zero only if we succeed to add at least one tmpl.
*/
static int cos_dn_tmpl_entries_cb (Slapi_Entry* e, void *callback_data) {
cosAttrValue *pDn = 0;
@@ -1166,7 +1166,7 @@ static int cos_dn_tmpl_entries_cb (Slapi_Entry* e, void *callback_data) {
if(pSneakyVal == NULL)
{
- /* look for the atrribute in the dynamic attributes */
+ /* look for the attribute in the dynamic attributes */
if(cos_cache_attrval_exists(info->pAttrs, attrType))
{
pSneakyVal = &pCosAttribute;
@@ -1269,10 +1269,10 @@ static int cos_dn_tmpl_entries_cb (Slapi_Entry* e, void *callback_data) {
}
}
/*
- * Always contine the search even if a particular attempt
- * to add a template failed.
- */
- return 0;
+ * Always continue the search even if a particular attempt
+ * to add a template failed unless we are shutting down
+ */
+ return slapi_is_shutting_down();
}
/*
9 years, 4 months
Branch '389-ds-base-1.3.2' - ldap/servers
by Mark Reynolds
ldap/servers/plugins/cos/cos_cache.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
New commits:
commit 1e61e2c4023f863f8a40198343e4afa5e95d32e2
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Thu Dec 4 11:11:13 2014 -0500
Ticket 47967 - cos_cache_build_definition_list does not stop during server shutdown
Bug Description: If the COS cache is being rebuilt (where there are many COS
definitions/templates), attempting to stop the server can
take take a very long time.
Fix Description: In the callback functions check for server shutdown to abort
out of the search callback loops.
https://fedorahosted.org/389/ticket/47967
Reviewed by: nhosoi(Thanks!)
(cherry picked from commit 99f99743617c1d082e748e7d3e83adf953d2ad05)
diff --git a/ldap/servers/plugins/cos/cos_cache.c b/ldap/servers/plugins/cos/cos_cache.c
index 80eee95..e3f808d 100644
--- a/ldap/servers/plugins/cos/cos_cache.c
+++ b/ldap/servers/plugins/cos/cos_cache.c
@@ -725,7 +725,7 @@ struct dn_defs_info {
/*
* Currently, always returns 0 to continue the search for definitions, even
* if a particular attempt to add a definition fails: info.ret gets set to
- * zero only if we succed to add a def.
+ * zero only if we succeed to add a def.
*/
static int
cos_dn_defs_cb (Slapi_Entry* e, void *callback_data)
@@ -1056,10 +1056,10 @@ bail:
/* This particular definition may not have yielded anything
* worth caching (eg. no template was found for it) but
* that should not cause us to abort the search for other more well behaved
- * definitions.
+ * definitions unless we are shutting down.
* return info->ret;
- */
- return (0);
+ */
+ return slapi_is_shutting_down();
}
@@ -1116,7 +1116,7 @@ struct tmpl_info {
/*
* Currently, always returns 0 to continue the search for templates, even
* if a particular attempt to add a template fails: info.ret gets set to
- * zero only if we succed to add at least one tmpl.
+ * zero only if we succeed to add at least one tmpl.
*/
static int cos_dn_tmpl_entries_cb (Slapi_Entry* e, void *callback_data) {
cosAttrValue *pDn = 0;
@@ -1166,7 +1166,7 @@ static int cos_dn_tmpl_entries_cb (Slapi_Entry* e, void *callback_data) {
if(pSneakyVal == NULL)
{
- /* look for the atrribute in the dynamic attributes */
+ /* look for the attribute in the dynamic attributes */
if(cos_cache_attrval_exists(info->pAttrs, attrType))
{
pSneakyVal = &pCosAttribute;
@@ -1269,10 +1269,10 @@ static int cos_dn_tmpl_entries_cb (Slapi_Entry* e, void *callback_data) {
}
}
/*
- * Always contine the search even if a particular attempt
- * to add a template failed.
- */
- return 0;
+ * Always continue the search even if a particular attempt
+ * to add a template failed unless we are shutting down
+ */
+ return slapi_is_shutting_down();
}
/*
9 years, 4 months
Branch '389-ds-base-1.3.3' - ldap/servers
by Mark Reynolds
ldap/servers/plugins/cos/cos_cache.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
New commits:
commit f2df95ea7a78e95535eaf798fdf3edff9cb33b72
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Thu Dec 4 11:11:13 2014 -0500
Ticket 47967 - cos_cache_build_definition_list does not stop during server shutdown
Bug Description: If the COS cache is being rebuilt (where there are many COS
definitions/templates), attempting to stop the server can
take take a very long time.
Fix Description: In the callback functions check for server shutdown to abort
out of the search callback loops.
https://fedorahosted.org/389/ticket/47967
Reviewed by: nhosoi(Thanks!)
(cherry picked from commit 99f99743617c1d082e748e7d3e83adf953d2ad05)
diff --git a/ldap/servers/plugins/cos/cos_cache.c b/ldap/servers/plugins/cos/cos_cache.c
index 3f3841f..a7993c8 100644
--- a/ldap/servers/plugins/cos/cos_cache.c
+++ b/ldap/servers/plugins/cos/cos_cache.c
@@ -725,7 +725,7 @@ struct dn_defs_info {
/*
* Currently, always returns 0 to continue the search for definitions, even
* if a particular attempt to add a definition fails: info.ret gets set to
- * zero only if we succed to add a def.
+ * zero only if we succeed to add a def.
*/
static int
cos_dn_defs_cb (Slapi_Entry* e, void *callback_data)
@@ -1056,10 +1056,10 @@ bail:
/* This particular definition may not have yielded anything
* worth caching (eg. no template was found for it) but
* that should not cause us to abort the search for other more well behaved
- * definitions.
+ * definitions unless we are shutting down.
* return info->ret;
- */
- return (0);
+ */
+ return slapi_is_shutting_down();
}
@@ -1116,7 +1116,7 @@ struct tmpl_info {
/*
* Currently, always returns 0 to continue the search for templates, even
* if a particular attempt to add a template fails: info.ret gets set to
- * zero only if we succed to add at least one tmpl.
+ * zero only if we succeed to add at least one tmpl.
*/
static int cos_dn_tmpl_entries_cb (Slapi_Entry* e, void *callback_data) {
cosAttrValue *pDn = 0;
@@ -1166,7 +1166,7 @@ static int cos_dn_tmpl_entries_cb (Slapi_Entry* e, void *callback_data) {
if(pSneakyVal == NULL)
{
- /* look for the atrribute in the dynamic attributes */
+ /* look for the attribute in the dynamic attributes */
if(cos_cache_attrval_exists(info->pAttrs, attrType))
{
pSneakyVal = &pCosAttribute;
@@ -1269,10 +1269,10 @@ static int cos_dn_tmpl_entries_cb (Slapi_Entry* e, void *callback_data) {
}
}
/*
- * Always contine the search even if a particular attempt
- * to add a template failed.
- */
- return 0;
+ * Always continue the search even if a particular attempt
+ * to add a template failed unless we are shutting down
+ */
+ return slapi_is_shutting_down();
}
/*
9 years, 4 months
ldap/servers
by Mark Reynolds
ldap/servers/plugins/cos/cos_cache.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
New commits:
commit 99f99743617c1d082e748e7d3e83adf953d2ad05
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Thu Dec 4 11:11:13 2014 -0500
Ticket 47967 - cos_cache_build_definition_list does not stop during server shutdown
Bug Description: If the COS cache is being rebuilt (where there are many COS
definitions/templates), attempting to stop the server can
take take a very long time.
Fix Description: In the callback functions check for server shutdown to abort
out of the search callback loops.
https://fedorahosted.org/389/ticket/47967
Reviewed by: nhosoi(Thanks!)
diff --git a/ldap/servers/plugins/cos/cos_cache.c b/ldap/servers/plugins/cos/cos_cache.c
index 3f3841f..a7993c8 100644
--- a/ldap/servers/plugins/cos/cos_cache.c
+++ b/ldap/servers/plugins/cos/cos_cache.c
@@ -725,7 +725,7 @@ struct dn_defs_info {
/*
* Currently, always returns 0 to continue the search for definitions, even
* if a particular attempt to add a definition fails: info.ret gets set to
- * zero only if we succed to add a def.
+ * zero only if we succeed to add a def.
*/
static int
cos_dn_defs_cb (Slapi_Entry* e, void *callback_data)
@@ -1056,10 +1056,10 @@ bail:
/* This particular definition may not have yielded anything
* worth caching (eg. no template was found for it) but
* that should not cause us to abort the search for other more well behaved
- * definitions.
+ * definitions unless we are shutting down.
* return info->ret;
- */
- return (0);
+ */
+ return slapi_is_shutting_down();
}
@@ -1116,7 +1116,7 @@ struct tmpl_info {
/*
* Currently, always returns 0 to continue the search for templates, even
* if a particular attempt to add a template fails: info.ret gets set to
- * zero only if we succed to add at least one tmpl.
+ * zero only if we succeed to add at least one tmpl.
*/
static int cos_dn_tmpl_entries_cb (Slapi_Entry* e, void *callback_data) {
cosAttrValue *pDn = 0;
@@ -1166,7 +1166,7 @@ static int cos_dn_tmpl_entries_cb (Slapi_Entry* e, void *callback_data) {
if(pSneakyVal == NULL)
{
- /* look for the atrribute in the dynamic attributes */
+ /* look for the attribute in the dynamic attributes */
if(cos_cache_attrval_exists(info->pAttrs, attrType))
{
pSneakyVal = &pCosAttribute;
@@ -1269,10 +1269,10 @@ static int cos_dn_tmpl_entries_cb (Slapi_Entry* e, void *callback_data) {
}
}
/*
- * Always contine the search even if a particular attempt
- * to add a template failed.
- */
- return 0;
+ * Always continue the search even if a particular attempt
+ * to add a template failed unless we are shutting down
+ */
+ return slapi_is_shutting_down();
}
/*
9 years, 4 months
dirsrvtests/tickets
by thierry bordaz
dirsrvtests/tickets/ticket47490_test.py | 117 ++++++++++++++++++++++++++------
1 file changed, 98 insertions(+), 19 deletions(-)
New commits:
commit 73bbaa7171bf2d7bbb8537f5ce4fba17f8ab8c33
Author: Thierry bordaz (tbordaz) <tbordaz(a)redhat.com>
Date: Fri Nov 28 19:11:54 2014 +0100
Ticket 47490 - test case failing if 47721 is also fixed
Bug Description:
47490 fix prevented to:
- accept a schema where definition are missing compare to the running schema
- send a schema to a consumer containing extra definition
The fix 47721 allows a replica to learn missing definitions.
If 47721 is fixed then the testcase for 47490 should take it into account
Fix Description:
Test the DS version to determine if the 47721 is fixed (version >= 1.3.3)
https://fedorahosted.org/389/ticket/47490
Reviewed by: Mark Reynolds (Thanks Mark !)
Platforms tested: F17
Flag Day: no
Doc impact: no
diff --git a/dirsrvtests/tickets/ticket47490_test.py b/dirsrvtests/tickets/ticket47490_test.py
index 1f37d6c..a1946de 100644
--- a/dirsrvtests/tickets/ticket47490_test.py
+++ b/dirsrvtests/tickets/ticket47490_test.py
@@ -40,6 +40,13 @@ class TopologyMasterConsumer(object):
consumer.open()
self.consumer = consumer
+def _header(topology, label):
+ topology.master.log.info("\n\n###############################################")
+ topology.master.log.info("#######")
+ topology.master.log.info("####### %s" % label)
+ topology.master.log.info("#######")
+ topology.master.log.info("###################################################")
+
def pattern_errorlog(file, log_pattern):
try:
pattern_errorlog.last_pos += 1
@@ -84,17 +91,47 @@ def mod_OC(instance, oid_ext, name, old_must=None, old_may=None, new_must=None,
new_oc = _oc_definition(oid_ext, name, new_must, new_may)
instance.schema.del_schema('objectClasses', old_oc)
instance.schema.add_schema('objectClasses', new_oc)
+
+def support_schema_learning(topology):
+ """
+ with https://fedorahosted.org/389/ticket/47721, the supplier and consumer can learn
+ schema definitions when a replication occurs.
+ Before that ticket: replication of the schema fails requiring administrative operation
+ In the test the schemaCSN (master consumer) differs
-def trigger_schema_push(topology):
+ After that ticket: replication of the schema succeeds (after an initial phase of learning)
+ In the test the schema CSN (master consumer) are in sync
+
+ This function returns True if 47721 is fixed in the current release
+ False else
+ """
+ ent = topology.consumer.getEntry(DN_CONFIG, ldap.SCOPE_BASE, "(cn=config)", ['nsslapd-versionstring'])
+ if ent.hasAttr('nsslapd-versionstring'):
+ val = ent.getValue('nsslapd-versionstring')
+ version = val.split('/')[1].split('.') # something like ['1', '3', '1', '23', 'final_fix']
+ major = int(version[0])
+ minor = int(version[1])
+ if major > 1:
+ return True
+ if minor > 3:
+ # version is 1.4 or after
+ return True
+ if minor == 3:
+ if version[2].isdigit():
+ if int(version[2]) >= 3:
+ return True
+ return False
+
+def trigger_update(topology):
"""
It triggers an update on the supplier. This will start a replication
session and a schema push
"""
try:
- trigger_schema_push.value += 1
+ trigger_update.value += 1
except AttributeError:
- trigger_schema_push.value = 1
- replace = [(ldap.MOD_REPLACE, 'telephonenumber', str(trigger_schema_push.value))]
+ trigger_update.value = 1
+ replace = [(ldap.MOD_REPLACE, 'telephonenumber', str(trigger_update.value))]
topology.master.modify_s(ENTRY_DN, replace)
# wait 10 seconds that the update is replicated
@@ -103,15 +140,33 @@ def trigger_schema_push(topology):
try:
ent = topology.consumer.getEntry(ENTRY_DN, ldap.SCOPE_BASE, "(objectclass=*)", ['telephonenumber'])
val = ent.telephonenumber or "0"
- if int(val) == trigger_schema_push.value:
+ if int(val) == trigger_update.value:
return
# the expected value is not yet replicated. try again
time.sleep(1)
loop += 1
- log.debug("trigger_schema_push: receive %s (expected %d)" % (val, trigger_schema_push.value))
+ log.debug("trigger_update: receive %s (expected %d)" % (val, trigger_update.value))
except ldap.NO_SUCH_OBJECT:
time.sleep(1)
loop += 1
+
+def trigger_schema_push(topology):
+ '''
+ Trigger update to create a replication session.
+ In case of 47721 is fixed and the replica needs to learn the missing definition, then
+ the first replication session learn the definition and the second replication session
+ push the schema (and the schemaCSN.
+ This is why there is two updates and replica agreement is stopped/start (to create a second session)
+ '''
+ agreements = topology.master.agreement.list(suffix=SUFFIX, consumer_host=topology.consumer.host, consumer_port=topology.consumer.port)
+ assert(len(agreements) == 1)
+ ra = agreements[0]
+ trigger_update(topology)
+ topology.master.agreement.pause(ra.dn)
+ topology.master.agreement.resume(ra.dn)
+ trigger_update(topology)
+
+
@pytest.fixture(scope="module")
def topology(request):
@@ -313,6 +368,8 @@ def test_ticket47490_one(topology):
- consumer +masterNewOCA
"""
+ _header(topology, "Extra OC Schema is pushed - no error")
+
log.debug("test_ticket47490_one topology %r (master %r, consumer %r" % (topology, topology.master, topology.consumer))
# update the schema of the supplier so that it is a superset of
# consumer. Schema should be pushed
@@ -347,6 +404,8 @@ def test_ticket47490_two(topology):
"""
+ _header(topology, "Extra OC Schema is pushed - (ticket 47721 allows to learn missing def)")
+
# add this OC on consumer. Supplier will no push the schema
add_OC(topology.consumer, 1, 'consumerNewOCA')
@@ -363,14 +422,16 @@ def test_ticket47490_two(topology):
# with 47721, supplier learns the missing definition
log.debug("test_ticket47490_two master_schema_csn=%s", master_schema_csn)
log.debug("test_ticket47490_two consumer_schema_csn=%s", consumer_schema_csn)
- assert master_schema_csn != consumer_schema_csn
+ if support_schema_learning(topology):
+ assert master_schema_csn == consumer_schema_csn
+ else:
+ assert master_schema_csn != consumer_schema_csn
# Check the error log of the supplier does not contain an error
# This message may happen during the learning phase
regex = re.compile("must not be overwritten \(set replication log for additional info\)")
res = pattern_errorlog(topology.master.errorlog_file, regex)
-
def test_ticket47490_three(topology):
"""
Summary: Extra OC Schema is pushed - no error
@@ -384,7 +445,9 @@ def test_ticket47490_three(topology):
- supplier +masterNewOCA +masterNewOCB +consumerNewOCA
- consumer +masterNewOCA +masterNewOCB +consumerNewOCA
- """
+ """
+ _header(topology, "Extra OC Schema is pushed - no error")
+
# Do an upate to trigger the schema push attempt
# add this OC on consumer. Supplier will no push the schema
add_OC(topology.master, 1, 'consumerNewOCA')
@@ -419,7 +482,9 @@ def test_ticket47490_four(topology):
- consumer +masterNewOCA +masterNewOCB +consumerNewOCA
+must=telexnumber
- """
+ """
+ _header(topology, "Same OC - extra MUST: Schema is pushed - no error")
+
mod_OC(topology.master, 2, 'masterNewOCA', old_must=MUST_OLD, new_must=MUST_NEW, old_may=MAY_OLD, new_may=MAY_OLD)
@@ -455,7 +520,9 @@ def test_ticket47490_five(topology):
+must=telexnumber +must=telexnumber
Note: replication log is enabled to get more details
- """
+ """
+ _header(topology, "Same OC - extra MUST: Schema is pushed - (fix for 47721)")
+
# get more detail why it fails
topology.master.enableReplLogging()
@@ -473,12 +540,16 @@ def test_ticket47490_five(topology):
# with 47721, supplier learns the missing definition
log.debug("test_ticket47490_five master_schema_csn=%s", master_schema_csn)
log.debug("ctest_ticket47490_five onsumer_schema_csn=%s", consumer_schema_csn)
- assert master_schema_csn != consumer_schema_csn
+ if support_schema_learning(topology):
+ assert master_schema_csn == consumer_schema_csn
+ else:
+ assert master_schema_csn != consumer_schema_csn
# Check the error log of the supplier does not contain an error
# This message may happen during the learning phase
regex = re.compile("must not be overwritten \(set replication log for additional info\)")
res = pattern_errorlog(topology.master.errorlog_file, regex)
+
def test_ticket47490_six(topology):
"""
@@ -499,7 +570,8 @@ def test_ticket47490_six(topology):
+must=telexnumber +must=telexnumber
Note: replication log is enabled to get more details
- """
+ """
+ _header(topology, "Same OC - extra MUST: Schema is pushed - no error")
# add telenumber to 'consumerNewOCA' on the consumer
@@ -521,8 +593,6 @@ def test_ticket47490_six(topology):
assert res == None
-
-
def test_ticket47490_seven(topology):
"""
Summary: Same OC - extra MAY: Schema is pushed - no error
@@ -541,7 +611,9 @@ def test_ticket47490_seven(topology):
- consumer +masterNewOCA +masterNewOCB +consumerNewOCA +masterNewOCC
+must=telexnumber +must=telexnumber
+may=postOfficeBox
- """
+ """
+ _header(topology, "Same OC - extra MAY: Schema is pushed - no error")
+
mod_OC(topology.master, 2, 'masterNewOCA', old_must=MUST_NEW, new_must=MUST_NEW, old_may=MAY_OLD, new_may=MAY_NEW)
@@ -580,7 +652,9 @@ def test_ticket47490_eight(topology):
- consumer +masterNewOCA +masterNewOCB +consumerNewOCA +masterNewOCC
+must=telexnumber +must=telexnumber
+may=postOfficeBox +may=postOfficeBox
- """
+ """
+ _header(topology, "Same OC - extra MAY: Schema is pushed (fix for 47721)")
+
mod_OC(topology.consumer, 1, 'consumerNewOCA', old_must=MUST_NEW, new_must=MUST_NEW, old_may=MAY_OLD, new_may=MAY_NEW)
# modify OC on the supplier so that its nsSchemaCSN is larger than the consumer (wait 2s)
@@ -595,7 +669,10 @@ def test_ticket47490_eight(topology):
# with 47721, supplier learns the missing definition
log.debug("test_ticket47490_eight master_schema_csn=%s", master_schema_csn)
log.debug("ctest_ticket47490_eight onsumer_schema_csn=%s", consumer_schema_csn)
- assert master_schema_csn != consumer_schema_csn
+ if support_schema_learning(topology):
+ assert master_schema_csn == consumer_schema_csn
+ else:
+ assert master_schema_csn != consumer_schema_csn
# Check the error log of the supplier does not contain an error
# This message may happen during the learning phase
@@ -625,7 +702,9 @@ def test_ticket47490_nine(topology):
- consumer +masterNewOCA +masterNewOCB +consumerNewOCA +masterNewOCC
+must=telexnumber +must=telexnumber
+may=postOfficeBox +may=postOfficeBox +may=postOfficeBox
- """
+ """
+ _header(topology, "Same OC - extra MAY: Schema is pushed - no error")
+
mod_OC(topology.master, 1, 'consumerNewOCA', old_must=MUST_NEW, new_must=MUST_NEW, old_may=MAY_OLD, new_may=MAY_NEW)
trigger_schema_push(topology)
9 years, 4 months