Score:0

How to strictly serialize replication of one folder using Windows DFS replication?

ss flag

I have two locations A+B and need to process one special directory between those branches using Windows DFS replication in the following way: All writes into that directory of A need to be pulled by B. All deletions in that directory of B need to be pushed to A again. In the end, it's simply pulling all contents from A by B with emptying at A and B at some point.

The important thing is that the directory is the file system interface of some special app. That app is by purpose running on host B only, while host A creates the data for that app. DFS is used to transfer that data somewhat reliably from A to B.

Because it's a file system interface, it needs to follow some conventions so that the app at B knows when it can access all the files. That convention is simply that before creating all the data a special lock file is created and when all the data has been created the lock file is removed. Removing the lock file means the app on host B is free to process the data however it wants. Of course, compared to the other data transferred, that lock file is really, really small, while all other data might be hundreds of MiB in size in theory. So, to reliably work with DFS, the order of file system operations would need to be taken into account when replicating.

From what I've read so far about DFS, it may transfer files out of order:

Does DFS Replication replicate files in chronological order?

No. Files may be replicated out of order.

OTOH, it tracks files by IDs already and the ID of the lock file would be lower than those of the other files.

What happens if I rename a file?

DFS Replication renames the file on all other members of the replication group during the next replication. Files are tracked using a unique ID, so renaming a file and moving the file within the replica has no effect on the ability of DFS Replication to replicate a file.

Additionally, there seem to be some settings regarding concurrent downloads, which might be lowered to 1 in the worst case. Though, that for itself of course might not guarantee a strict order of file operations like I need it. The lock file could simply be deleted between transferring two large other files.

How are simultaneous replications handled?

There is one update manager per replicated folder. Update managers work independently of one another.

Would be great to have some mode of operation or alike of DFS using the Windows Change Journal and following the order of that events in the source folder to be replicated. that should guarantee that DFS creates and deletes the lock file as first and last operations, like has been done in the source folder.

So, is there any way to make file operations strictly ordered in DFS, so that it can be used with file system based interfaces?

Thanks!

Score:2
ng flag

No, DFS Replication doesn't support this; it's asynchronous by design and there is no way to make it perform synchronous replication, or to guarantee that the order of operations is followed.


I don't know the inner workings of your application, but it would seem a lot easier and safer to just use a common network share which both servers can access. Or, if server B really wants to find the data on a local disk, just create a share there on which server A can write.

ss flag
The used connection can not be assumed to be stable and the customer wants bandwidth management on the used directory. All of that is easily available with other DFS-R maintained folders already for my customer, so he thought of using that in this case as well.
Massimo avatar
ng flag
Unfortunately, DFSR is definitely not the right tool for this job.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.