doc
Functions
csync_reconcile.h File Reference

Go to the source code of this file.

Functions

int csync_reconcile_updates (CSYNC *ctx)
 

Detailed Description

Propagation.

Reconciliation.

It uses the calculated records to apply them on the current replica. The propagator uses a two-phase-commit mechanism to simulate an atomic filesystem operation.

In the first phase we copy the file to a temporary file on the opposite replica. This has the advantage that we can check if file which has been copied to the opposite replica has been transfered successfully. If the connection gets interrupted during the transfer we still have the original states of the file. This means no data will be lost.

In the second phase the file on the opposite replica will be overwritten by the temporary file.

After a successful propagation we have to merge the trees to reflect the current state of the filesystem tree. This updated tree will be written as a journal into the state database. It will be used during the update detection of the next synchronization. See above for a description of the state database during synchronization.

The most important component is the update detector, because the reconciler depends on it. The correctness of reconciler is mandatory because it can damage a filesystem. It decides which file:

  - stays untouched
  - has a conflict
  - gets synchronized
  - or is deleted.

Definition in file csync_reconcile.h.