osync icon indicating copy to clipboard operation
osync copied to clipboard

Adding a directory to ignore list make osync delete it

Open Artiom-M opened this issue 5 years ago • 4 comments

On a working 2 host replication I have added one directory (existing on both hosts) to the ignore list. osync has deleted it on both hosts. Hopefully I have found it in the deleted directory...

Artiom-M avatar Oct 08 '20 19:10 Artiom-M

Sounds really bad. Can you give the usual background so I can investigate ?

deajan avatar Oct 19 '20 19:10 deajan

So two hosts with ssh based replication. Master has osync 1.3.0-rc1 run as a systemd service:

/usr/local/bin/osync.sh /etc/osync/fcd_sync.conf --on-changes --errors-only

One directory (it was that with ( in filenames) is synced but with error. So I add it to ignore list, expecting it to remain on both servers as is. But it was deleted on target. I am going to retry the same steps again and capture the log.

Artiom-M avatar Oct 25 '20 00:10 Artiom-M

After changing the setting I have restarted the service so it starts replication. Nothing special in the logs:

TIME: 0 - Sat Oct 24 20:22:18 EDT 2020 - osync 1.3.0-rc1 script begin.
TIME: 633 - No are no conflicatual files.
TIME: 634 - osync finished.
2020-10-24 20:57:02 - osync finished.
2020-10-24 20:57:02 - osync finished.
2020-10-24 20:57:02 - Sat Oct 24 20:57:02 EDT 2020 - osync 1.3.0-rc1 script begin.
TIME: 0 - Sat Oct 24 20:57:02 EDT 2020 - osync 1.3.0-rc1 script begin.
TIME: 649 - No are no conflicatual files.
TIME: 650 - osync finished.

And my testing directory is in deleted files now! On both servers.

Artiom-M avatar Oct 25 '20 01:10 Artiom-M

I can confirm this one. Problem is osync is stateful, so once you add stuff to the ignore list after osync has "seen" it in the previous run, it suggests that the folder shouldn't be there to osync, hence the deletion. Indeed this behavior is not acceptable, I'll see how I can get the delete function to honor the ignore list, since it's rsync format, and the delete function isn't.

deajan avatar Nov 03 '20 14:11 deajan