[Csync2] Csync2 latest source code : replication not working... is it a regression issue?

Samba saasira at gmail.com
Thu Nov 10 07:56:31 CET 2011


Interestingly, many of the files (that are reported as L by command "csync2
-T") which could not be replicated when I ran "csync2 -x" have been
replicated smoothly when I explicitly ran "csync2 -x file_name" for each
such file. The only problem has been the file which has been modified on
the master and thus marked X by 'csync2 -T' command.

Is it that csync2 is stopping to replicate all the remaining files when it
encounters the first conflict? (although this is not a conflict and perhaps
a regression issue).
It would be great if a fix can be delivered for this issue, or at least
some hints as to where this needs to be fixed and how?

Thanks and Regards,
Samba

------------------------------------------------------------------------------------------------------------------------------------------------------------------
On Wed, Nov 9, 2011 at 6:12 PM, Samba <saasira at gmail.com> wrote:

> Hi,
>
> I cloned csync2 repository(latest) and built an rpm on centos5.
>
> csync2 worked properly the first time but thereafter it is giving errors.
>
>  i think csync2 is copying the file to the slave only when it is not
> present on slave, if the file is also present on the slave, then it is
> giving the error:
>
> While syncing file /opt/test/yum.log: ERROR from peer(/opt/test/yum.log):
>> slave.abc.com
>>
>
> If the file is present on both master and slave but is modified on the
> master, then the error is:
>
> While syncing file /opt/test/db.c:
>> ERROR from peer(/opt/test/db.c): slave.abc.com Stating original file
>> /opt rc: 0 mode: 40755
>> Auto-resolving conflict: Won 'master/slave' test.
>> While syncing file /opt/test/db.c:
>> ERROR from peer(/opt/test/db.c): slave.abc.com Changing owner of
>> /var/backups/csync2/opt to user 0 and group 0, rc= 0
>> ERROR: Auto-resolving failed. Giving up.
>> ERROR from peer(<no file>): slave.abc.com Changing mode of
>> /var/backups/csync2/opt/test/db.c to mode 33188, rc= 0
>>
>
> Please note that I modified the file /opt/test/db.c
>
> When I ran csync2 -T, the output is:
>
> X    master.abc.com    slave.abc.com    /opt/test/db.c
>> L    master.abc.com    slave.abc.com    /opt/test/maillog.1
>> L    master.abc.com    slave.abc.com    /opt/test/messages.1
>> L    master.abc.com    slave.abc.com    /opt/test/rpmpkgs.1
>> L    master.abc.com    slave.abc.com    /opt/test/rpmpkgs.2
>> L    master.abc.com    slave.abc.com    /opt/test/rpmpkgs.3
>> L    master.abc.com    slave.abc.com    /opt/test/rpmpkgs.4
>> L    master.abc.com    slave.abc.com    /opt/test/scrollkeeper.log
>> L    master.abc.com    slave.abc.com    /opt/test/secure.1
>> L    master.abc.com    slave.abc.com    /opt/test/snmpd.log
>> L    master.abc.com    slave.abc.com    /opt/test/spooler.1
>> L    master.abc.com    slave.abc.com    /opt/test/yum.log
>>
>
> Here is my csync2 configuration file:
>
> ================================================================
>
> # Csync2 Configuration File
> # ---------------------------------
> #
> # Please read the documentation:
> # http://oss.linbit.com/csync2/paper.pdf
> nossl * *;
> group smgr
> {
>         host master.abc.com;
>         host (slave.abc.com);
>
>         key /etc/csync2.key;
>
>         include /opt/test;
>
>         backup-directory /var/backups/csync2;
>         backup-generations 3;
>
>         auto left;
> }
>
>
> Csync2 1.34 is working properly but the latest git codebase is giving this
> error. Am I doing something wrong or is this a regression issue? If it is a
> regression issue, then I can test and verify a patch if you can provide one
> (may be i can try if some hints can be given, but i'm not so good at C,
> hence hesitation :) ).
>
> Thanks and Regards,
> Samba
>
>
> PS:
>
> I had faced another minor issue with the latest codebase from Git where it
> complained "no such column: TRUE" pointing to the line:218 in the file
> check.c.
>  Here is the code snippet that is responsible for that:
>
> void csync_check_del(const char *file, int recursive, int init_run)
>> 211 {
>> 212         char *where_rec = "";
>> 213         struct textlist *tl = 0, *t;
>> 214         struct stat st;
>> 215
>> 216         if ( recursive ) {
>> 217                 if ( !strcmp(file, "/") )
>> 218                   ASPRINTF(&where_rec, "OR TRUE");
>> 219                 else
>> 220                   ASPRINTF(&where_rec, "UNION ALL SELECT filename
>> from file where filename > '%s/' "
>> 221                                 "and filename < '%s0'",
>> 222                                 url_encode(file), url_encode(file));
>> 223         }
>> 224
>> 225         SQL_BEGIN("Checking for removed files",
>> 226                         "SELECT filename from file where "
>> 227                         "filename = '%s' %s ORDER BY filename",
>> url_encode(file), where_rec)
>> 228         {
>>
>
> I had changed "OR TRUE" to "OR 1=1" which I think would work on all the
> databases.
>
> I'm using sqlite3, and the issue may be with the standard compliance of
> sqlite3 but I think it is better to go with minimum common denominator and
> hence would suggest to use "OR 1=1" instead of "OR TRUE" in the above
> mentioned context.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linbit.com/pipermail/csync2/attachments/20111110/c9d8c3f2/attachment.htm>


More information about the Csync2 mailing list