Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abort Sync If It's Unneeded #84

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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