Skip to content

Abort Sync If It's Unneeded#84

Open
greezybacon wants to merge 3 commits intoku1ik:masterfrom
greezybacon:feature/compare-states
Open

Abort Sync If It's Unneeded#84
greezybacon wants to merge 3 commits intoku1ik:masterfrom
greezybacon:feature/compare-states

Conversation

@greezybacon
Copy link
Collaborator

This is a different idea to the performance from. With this idea, the stream of the Rsync tree listing is MD5'd in sync with the rest of the analyze processing. If the two trees match according to the MD5 hash, then it is safe to assume that the trees match exactly and the sync can be aborted without further processing or inspection.

Jared Hancock and others added 3 commits February 22, 2021 18:40
This will take an md5sum of the rsync output of both the local and
remote trees as they are output by rsync itself. This includes the mode,
modify time, full file path, and size. If all attributes of all files
match, then the md5 of the rsync listing stream will also match. With
this patch, the sync will exit early if it determines that neither a
pull nor a push is required.
If the inode of a directory changes (ownership or mode) and nothing else
changes in the state of the system, then consider the changes to be
insignificant. When a file is modified locally, then proceed to sync the local
and remote systems.
For the optimization where the hash of the directory listing is
considered and used to decide if it would be safe to skip using `rsync`
to sync an identical listing, support macOS where `md5sum` is not the
name of the utility.
@greezybacon greezybacon force-pushed the feature/compare-states branch from 6b87389 to a3e5c9c Compare February 23, 2021 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant