[Csync2] csync2 prefix mapping ==> I/O Error 'No such file or directory' in rsync-check

Samba saasira at gmail.com
Mon Jun 18 18:28:57 CEST 2012


Noticed an issue with master-master setup

Configured Auto : younger

modified a file under subdir (C) A/B/C

then after sometime deleted the subdir (C) A/B/C

csync2 -x from deletion side:

errored with "Do not auto-resolve conflict; this is removal"

Ideally, the subdir "C" should have been deleted on the other peer.

Interestingly, when i run "csyc2 -x" from the other peer [since this is
master-master configuration], the file modification got synced back(with a
message 'auto resolving conflict : won younger/older test') to the node
where the subdir has been deleted.

Same is true with deletion happening on the peer and modification on the
local; it seems the modification is getting synced and deletion is failing
irrespective of whichever is younger, although csync2 is configured to sync
the 'younger' changes. If that part is corrected, then i  guess even the
deletions would sync properly.

Thanks and Regards,
Samba
====================================================

On Mon, Jun 18, 2012 at 7:12 PM, Samba <saasira at gmail.com> wrote:

> Lars,
>
> An important fact that need to be understood from these tests is that even
> after this fix, csync2 is not able to sync unmodified content to those
> directories that were deleted on the slave server; it is only able to sync
> just the modified content.
>
> A quick try could be to mark any parent folders [up in the hierarchy] as
> dirty on the slave but i doubt if that could trigger the master to sync the
> whole directory directory tree path; an ideal fix should be send a response
> to the master [via conn_printf] that the directory tree starting from so
> and so subdirectory has to be marked dirty and resynced.
>
> I'm not sure how to introduce that new 'tag' in the csync2 communication
> protocol; it would be great if you can give some pointer.
>
>
> Thanks and Regards,
> Samba
>
>
> ===================================================================================
> On Mon, Jun 18, 2012 at 4:08 PM, Samba <saasira at gmail.com> wrote:
>
>> Lars,
>>
>> I did not make that change myself but I felt that it would be safe to
>> resolve the prefixes in get_tempfile_name() and paranoid_file() functions
>> rather than expecting that the caller functions would resolve the prefixes
>> before passing the input parameters.
>>
>> Centralizing the logic has the other benefits like :
>>
>>    - resolving environment variables
>>    - resolving symbolic links
>>    - resolving relative paths, etc
>>
>> Regards,
>> Samba
>>
>>
>> ==================================================================================
>>
>> On Mon, Jun 18, 2012 at 2:27 PM, Samba <saasira at gmail.com> wrote:
>>
>>> Hi Lars,
>>>
>>> I managed to modify the patch submitted by *Dennis Schafroth *to also
>>> consider the configured 'tempdir' directive in csync2 config files.
>>> Further, Dennis's patch did not fix the issue of replication to deleted
>>> subdirectories on slave server, which this patch has fixed. On the
>>> otherhand, this patch also includes the fix given by Dennis for backing up
>>> of prefixed locations.
>>>
>>>
>>> The attached patch fixes the issue previously mentioned in this mail
>>> thread, namely 'fail to sync when a subdirectory gets deleted either on
>>> master or slave servers, WITH OR WITHOUT PREFIX MAPPING'.
>>>
>>>
>>> I tested it for regression and am confident that this did not introduce
>>> any new issues;
>>>
>>> Here are the test cases we have run after upgrading the Csync2 rpm
>>> [deleted subdir fix]:
>>>
>>>
>>>
>>>
>>>
>>> Self
>>>
>>> Peer
>>>
>>> Result
>>>
>>> file deleted on master
>>>
>>> no changes to that file on slave
>>>
>>> SUCCESS
>>>
>>> file deleted on master
>>>
>>> changes happened to that file on slave
>>>
>>> SUCCESS
>>>
>>> file deleted on master
>>>
>>> file deleted on slave
>>>
>>> SUCCESS
>>>
>>> file changed on master
>>>
>>> no changes to that file on slave
>>>
>>> SUCCESS
>>>
>>> file changed on master
>>>
>>> file changed on slave
>>>
>>> SUCCESS
>>>
>>> file chaned on master
>>>
>>> file deleted on slave
>>>
>>> SUCCESS
>>>
>>> subdir deleted on master
>>>
>>> no changes to that subdir or files under it on slave
>>>
>>> SUCCESS
>>>
>>> subdir deleted on master
>>>
>>> files under that subdir are modified on slave
>>>
>>> SUCCESS
>>>
>>> subdir deleted on master
>>>
>>> subdir deleted on slave
>>>
>>> SUCCESS
>>>
>>> files under that subdir are modified on master
>>>
>>>
>>>
>>> subdir deleted on slave
>>>
>>> SUCCESS [synced only the file that was modified on master, did not sync
>>> the complete subdirectory
>>>
>>> TODO: sync the complete subdir tree when it is detected that a subdir
>>> has been deleted on the slave]
>>>
>>> subdir deleted on master
>>>
>>> subdir deleted on slave
>>>
>>> SUCCESS
>>>
>>> dirtree deleted on master
>>>
>>> no changes on slave
>>>
>>> SUCCESS
>>>
>>> dirtree deleted on master
>>>
>>> some files in the hierarchy changed on slave
>>>
>>> SUCCESS
>>>
>>> dirtree modified on master
>>>
>>> part of the dirtree is deleted on slave
>>>
>>> SUCCESS [synced only the file that was modified on master, did not sync
>>> the complete subdirectory
>>>
>>> TODO: sync the complete subdir tree when it is detected that a subdir
>>> has been deleted on the slave]
>>>
>>> dirtree deleted on master
>>>
>>> dirtree deleted on slave
>>>
>>> SUCCESS
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>  Please review the attached patch and give feedback [ this is my first
>>> attempt at writing any usable C program, so please suggest appropriate
>>> corrections if any].
>>>
>>> I hope this patch gets committed to trunk soon.
>>>
>>> Thanks and Regards,
>>> Samba
>>>
>>>
>>>
>>> ===================================================================================
>>>
>>> On Tue, Jun 5, 2012 at 1:19 PM, Lars Ellenberg <
>>> lars.ellenberg at linbit.com> wrote:
>>>
>>>> On Sat, Jun 02, 2012 at 06:09:37AM +0530, Samba wrote:
>>>> > Sorry for flooding the list;
>>>>
>>>> Oh, please keep it coming ;)
>>>>
>>>> > I will review,
>>>> > test and verify the patch in a bit more detail and send my comments
>>>> in a
>>>> > couple of days.
>>>>
>>>> Thanks,
>>>>
>>>>
>>>> --
>>>> : Lars Ellenberg
>>>> : LINBIT | Your Way to High Availability
>>>> : DRBD/HA support and consulting http://www.linbit.com
>>>>
>>>> DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
>>>> _______________________________________________
>>>> Csync2 mailing list
>>>> Csync2 at lists.linbit.com
>>>> http://lists.linbit.com/mailman/listinfo/csync2
>>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linbit.com/pipermail/csync2/attachments/20120618/ce75d2d4/attachment-0001.htm>


More information about the Csync2 mailing list