Hi, <br><br>I cloned csync2 repository(latest) and built an rpm on centos5. <br><br>csync2 worked properly the first time but thereafter it is giving errors.<br><br> 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:<br>
<br><blockquote style="margin: 0pt 0pt 0pt 6.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">While syncing file /opt/test/yum.log: ERROR from peer(/opt/test/yum.log): <a href="http://slave.abc.com">slave.abc.com</a><br>
</blockquote><br>If the file is present on both master and slave but is modified on the master, then the error is:<br><br><blockquote style="margin: 0pt 0pt 0pt 6.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">
While syncing file /opt/test/db.c:<br>ERROR from peer(/opt/test/db.c): <a href="http://slave.abc.com">slave.abc.com</a> Stating original file /opt rc: 0 mode: 40755<br>Auto-resolving conflict: Won 'master/slave' test.<br>
While syncing file /opt/test/db.c:<br>ERROR from peer(/opt/test/db.c): <a href="http://slave.abc.com">slave.abc.com</a> Changing owner of /var/backups/csync2/opt to user 0 and group 0, rc= 0 <br>ERROR: Auto-resolving failed. Giving up.<br>
ERROR from peer(<no file>): <a href="http://slave.abc.com">slave.abc.com</a> Changing mode of /var/backups/csync2/opt/test/db.c to mode 33188, rc= 0 <br></blockquote><br>Please note that I modified the file /opt/test/db.c<br>
<br>When I ran csync2 -T, the output is:<br><br><blockquote style="margin: 0pt 0pt 0pt 6.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">X <a href="http://master.abc.com">master.abc.com</a> <a href="http://slave.abc.com">slave.abc.com</a> /opt/test/db.c<br>
L <a href="http://master.abc.com">master.abc.com</a> <a href="http://slave.abc.com">slave.abc.com</a> /opt/test/maillog.1<br>L <a href="http://master.abc.com">master.abc.com</a> <a href="http://slave.abc.com">slave.abc.com</a> /opt/test/messages.1<br>
L <a href="http://master.abc.com">master.abc.com</a> <a href="http://slave.abc.com">slave.abc.com</a> /opt/test/rpmpkgs.1<br>L <a href="http://master.abc.com">master.abc.com</a> <a href="http://slave.abc.com">slave.abc.com</a> /opt/test/rpmpkgs.2<br>
L <a href="http://master.abc.com">master.abc.com</a> <a href="http://slave.abc.com">slave.abc.com</a> /opt/test/rpmpkgs.3<br>L <a href="http://master.abc.com">master.abc.com</a> <a href="http://slave.abc.com">slave.abc.com</a> /opt/test/rpmpkgs.4<br>
L <a href="http://master.abc.com">master.abc.com</a> <a href="http://slave.abc.com">slave.abc.com</a> /opt/test/scrollkeeper.log<br>L <a href="http://master.abc.com">master.abc.com</a> <a href="http://slave.abc.com">slave.abc.com</a> /opt/test/secure.1<br>
L <a href="http://master.abc.com">master.abc.com</a> <a href="http://slave.abc.com">slave.abc.com</a> /opt/test/snmpd.log<br>L <a href="http://master.abc.com">master.abc.com</a> <a href="http://slave.abc.com">slave.abc.com</a> /opt/test/spooler.1<br>
L <a href="http://master.abc.com">master.abc.com</a> <a href="http://slave.abc.com">slave.abc.com</a> /opt/test/yum.log<br></blockquote><br>Here is my csync2 configuration file:<br><br>================================================================<br>
<br># Csync2 Configuration File<br># ---------------------------------<br>#<br># Please read the documentation:<br># <a href="http://oss.linbit.com/csync2/paper.pdf">http://oss.linbit.com/csync2/paper.pdf</a><br>nossl * *;<br>
group smgr<br>{<br> host <a href="http://master.abc.com">master.abc.com</a>;<br> host (<a href="http://slave.abc.com">slave.abc.com</a>);<br><br> key /etc/csync2.key;<br><br> include /opt/test;<br>
<br> backup-directory /var/backups/csync2;<br> backup-generations 3;<br><br> auto left;<br>}<br><br><br>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 :) ).<br>
<br>Thanks and Regards,<br>Samba<br><br><br>PS:<br><br>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.<br>
Here is the code snippet that is responsible for that:<br><br><blockquote style="margin: 0pt 0pt 0pt 6.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">void csync_check_del(const char *file, int recursive, int init_run)<br>
211 {<br>212 char *where_rec = "";<br>213 struct textlist *tl = 0, *t;<br>214 struct stat st;<br>215 <br>216 if ( recursive ) {<br>217 if ( !strcmp(file, "/") )<br>
218 ASPRINTF(&where_rec, "OR TRUE");<br>219 else<br>220 ASPRINTF(&where_rec, "UNION ALL SELECT filename from file where filename > '%s/' "<br>
221 "and filename < '%s0'",<br>222 url_encode(file), url_encode(file));<br>223 }<br>224 <br>225 SQL_BEGIN("Checking for removed files",<br>
226 "SELECT filename from file where "<br>227 "filename = '%s' %s ORDER BY filename", url_encode(file), where_rec)<br>228 {<br></blockquote>
<br>I had changed "OR TRUE" to "OR 1=1" which I think would work on all the databases.<br><br>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.<br>