[Csync2] synchronizing file deletions

Michael Johnson mikjo.sas at gmail.com
Tue May 21 18:18:11 CEST 2013


As I've been expanding my tests, I got to the point of synchronizing
deleting a file and having that deletion propagate.  To do this, I ran
csync2 -nr on one "node" to make sure that the presence of the file
was recorded in the db, removed the file from that "node", ran csync2
-nr again to record that the file was missing, and ran csync2 -u to
try to synchronize it. Unfortunately, it is not being removed.

Here's the relevant segment of the test (when the test starts, a file
named a/conflict exists and has been synchronized across all the
nodes; testing conflict resolution succeeded):

remove_conflict()
{
        (
        set -xe
        # ensure that all content really conflicts
        rm $1/a/conflict
        )
}
assert_no_conflict()
{
        (
        set -xe
        for i in $* ; do
                [ -f $i/a/conflict ] && false
        done
        )
}
TEST    "record conflict file on d2"    csync2 -C n2 -N $N2 -cr $D2
TEST    "remove d2 conflict"    remove_conflict $D2
TEST    "assert no conflict D2" assert_no_conflict $D2
TEST_EXPECT_EXIT_CODE   1 "diff -rq D1D2 fail"  diff -rq $D1 $D2
TEST    "record conflict file deletion" csync2 -C n2 -N $N2 -cr $D2
TEST    "csync2 -uv inbound"    csync2_u ${N2}:n2 ${N1}:hub
TEST    "assert no conflict D1" assert_no_conflict $D1

That last test fails because the deletion of 2/a/conflict has not been
propagated to deleting 1/a/conflict.

(Once that is completed, further tests ensure that the deletion gets
pushed out to all the other spokes in my hub-and-spoke arrangement.)

I have read the man page, the current version of the paper, and some
messages from the archives, and everything seems to imply that this
should work. I'm not marking any nodes as slaves in their respective
configurations.What other reasons might there be for deletions not
being recognized and propagated?

Thanks!


More information about the Csync2 mailing list