New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Under specific values of nsDS5ReplicaName, replication may get broken or updates missing #826
Comments
Comment from jyotidas81 at 2013-08-29 12:52:47 Hi, Can anyone please verify this fix? Thanks in advance. Regards, |
Comment from tbordaz (@tbordaz) at 2013-09-09 23:19:28 Here is the current status
Then started DS, I can see the logs:
Here are the next steps
|
Comment from tbordaz (@tbordaz) at 2013-09-12 19:07:27 attachment |
Comment from rmeggins (@richm) at 2013-09-12 20:04:15 Can we get this fix into RHEL 6.5? Does this affect 389-ds-base-1.2.11? |
Comment from rmeggins (@richm) at 2013-09-12 20:07:52 Ticket has been cloned to Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1007452 |
Comment from tbordaz (@tbordaz) at 2013-09-12 20:16:27 Thanks Rich for the review. At the source level, it applies on 1.2.11. |
Comment from tbordaz (@tbordaz) at 2013-09-12 20:49:41 I confirm the same bug applies on 389-ds-base-1.2.11. |
Comment from tbordaz (@tbordaz) at 2013-09-13 01:11:18 Push to master: git merge ticket47489 Updating b73f1e8..7a7609d git push origin master Counting objects: 13, done. commit 7a7609d |
Comment from nhosoi (@nhosoi) at 2013-09-27 05:19:57 389-ds-base-1.3.1 branch: commit ac8aad8 |
Comment from tbordaz (@tbordaz) at 2017-02-11 23:10:37 Metadata Update from @tbordaz:
|
Cloned from Pagure issue: https://pagure.io/389-ds-base/issue/47489
In a replication environment, if the changelog db file name contains extension string multiple times in the file name, the change log file is getting recreated if we perform the db2ldif and ldif2db on the master/hub instance.
Ex: d736e482-198111e1-8d7bedb4-8c53b85f_502ce263000000020000.db4
In this file name "db4" is present twice, once as the extension and other one is in the replica name string ("8d7bedb4").
There is a logic problem in the below function where it is trying to find the filename ends with extension. It calls strstr()function to search the "ext" and which returns the first occurrence of the "ext" string in the filename. if the the "ext" string exist multiple times in the file name it returns false always, which result in creating multiple changelog db file.
====
filename: cl5_api.c
/*
- return 1: true (the "filename" ends with "ext")
- return 0: false
*/
static int _cl5FileEndsWith(const char *filename, const char *ext)
{
char *p = NULL;
int flen = strlen(filename);
int elen = strlen(ext);
if (0 == flen || 0 == elen)
{
return 0;
}
p = strstr(filename, ext);
if (NULL == p)
{
return 0;
}
if (p - filename + elen == flen)
{
return 1;
}
return 0;
}
I have modified this function to fix this issue. Could you please verify the same and include the fix in the master branch?
/*
- return 1: true (the "filename" ends with "ext")
- return 0: false
*/
static int _cl5FileEndsWith(const char *filename, const char *ext)
{
char *p = NULL;
int flen = strlen(filename);
int elen = strlen(ext);
if (0 == flen || 0 == elen)
{
return 0;
}
p = strstr(filename, ext);
if (NULL == p)
{
return 0;
}
}
Thanks and Regards,
Jyoti
The text was updated successfully, but these errors were encountered: