Repository navigation
bisync: bug fixes and new features including --create-empty-src-dirs and equality check - #6971
Conversation
|
Would it be possible to break this down into a commit per fix/feature? If the commit messages can link to either the forum or an rclone issue as well that would be perfect. Reviewing a lot of changes all at once is very difficult :-( I don't mind receiving this all as one pull request with lots of commits, but I'd suggest you start with a PR with one or a few of the simple fixes so we can get into the swing of things. |
|
Sure thing, sorry about that 😃 Btw, it looks like a lot more than it is, because the vast majority is docs and test file changes. Also the tests all pass locally...looks like they are failing on GH because the test.log files got gitignored out of the golden directory. Will fix and resubmit. 😃 |
|
Ok I broke this down into a commit per fix/feature and confirmed the GitHub tests are passing now. Note that I left all the test changes together in one commit: e1e5593 I don't think it's really possible to separate them due to the way the Bisync test suite is designed (it diffs an actual log with a golden log, so just about any unrelated change you make will cause false positives. I could make them each pass separately, but then they might not all pass together.) If you want to start with just a few, I think these are the most important: But these are the simplest: |
|
Sorry for the delay looking at this! I'd like to merge this for the v1.63 release if possible (in about 2 weeks). I'll review the code tomorrow and we can start the merge process - thank you. |
ncw
left a comment
There was a problem hiding this comment.
I ignored the first two commits - the commit and the revert and I've written inline comments.
In an ideal world in each commit we'd have
- the code change
- the commit message telling us why we changed it with before and after
- So you'd edit what you wrote in the forum and put it as a commit message
- Then describe how your changes fix that problem
- doc changes relevant to the commit
- test changes relevant to the commit
That then gives us nice easy units to review, apply and revert if necessary, so if we find a bug in one of the commits we can revert it and the docs and the tests. The code should compile and pass its tests for every commit - if it doesn't this makes using git bisect much harder.
Currently the docs and tests are all in a different commit which would make reverting one of the commits very hard.
Would it be possible to re-arrange the commits like that? I realize that re-arranging the tests will be quite annoying
I think the itself code looks OK but I have some efficiency worries about use of NewObject which I've made inline comments about.
I think the "create-empty-dirs and equality check" commit probably needs re-working.
Thank you for taking this on - much appreciated.
There was a problem hiding this comment.
Can you render the html bold/italic in markdown please? The markdown converter is set to ignore HTML in markdown so these won't render properly on the website.
This is so we can easily turn the markdown into other things like man pages.
There are a few of them in this doc which I haven't marked individually.
Note this section in the Makefile
Lines 157 to 160 in fcf47a8
There was a problem hiding this comment.
Note that NewObject can be quite expensive on some backends.
For example running NewObject on every file in a directory might list the directory once for each object, whereas if you run List on a directory you can create all the objects at once.
I think here it will only happen occasionally won't it so it is probably OK?
There was a problem hiding this comment.
This debug should have the error message in "...: %v", direrr)
There was a problem hiding this comment.
Is there a better way of working out which paths are directories here? This is a very expensive way of doing it and NewObject doesn't always return fs.ErrorIsDir (eg on the bucket based backends such as S3).
There was a problem hiding this comment.
Duplicate code block - factor out into createDirs function?
|
Thanks so much for the excellent feedback! I'm happy to hear that you're considering this for the next release. The Regarding the tests -- I can do what you're requesting and I don't mind the extra work, but I do fear that the result you're looking for is not truly possible due to the unique way the bisync test suite is designed. I'll explain what I mean below, and if you're ok with this caveat I am happy to do it. (And apologies in advance if this is all stuff you already know -- just making sure we're on the same page.) The bisync tests compare not only the resulting files but also the debug log to the respective golden versions. (This is why I had to remove As an example, my "equality check" commit adds a line that prints So, I can give you a sequence of commits that each pass all their tests, but they will be dependent on their sequence, and therefore not necessarily cherry-pickable. If you were to later revert a commit from the middle of the pack, as you describe, you'd likely have to also revert every commit that came after it (or alternatively push a new commit to re-goldenize.) Does that make sense, and are you ok with that? Assuming yes, what's your preferred way of receiving these revisions? Should I revert these commits and add new ones, or is it cleanest to just create a new branch? All of your other comments made total sense and shouldn't be a problem. Thanks! |
|
Wonder if these extended changes might have an effect on #6572 too... |
|
Sorry have been rather busy! Will answer questions inline.
I think we might have to push until next release - sorry!
Ideally you'd keep a the objects from the directory listing so you don't have to re-instantate them. This may not be possible of course, but in general
These are really what I'd call regression tests then...
Yes that makes sense. I think the intellectual exercise of checking the diffs match what we expect after each change is probably worth doing. We can hopefully spot any problems with that commit. Noted that it effectively makes the commits un cherry-pickable.
I'm happy for you to force push this branch with new commits. That is what I'd normally do. But it doesn't matter much to me so if you want to create a new branch which probably means a new PR that is fine. What I'd probably do is clone the branch as
:-) |
|
Very helpful, thank you! I think I've found a good solution that eliminates the need to use |
02b3922 to
557dc46
Compare
|
@ncw Ok, I think this is ready for you to take a look, whenever you have a chance. I think it addresses all of your comments. Each commit should now include all relevant documentation and testing changes, and each commit should compile and pass all tests. The equality check and Since this branch has gotten quite noisy with all the reversions, I also made a new "clean" branch with just the "real" commits cherry-picked. Feel free to use whichever you prefer. Thanks! |
|
(I added a fix for a small bug I found after a few weeks of real-world use.) |
|
Thanks @nielash for your hard work :-) Can you rebase this on master and fix the conflict, please. (Its probably the fact I added a new parameter to the flags, you can just use If you can force push your clean branch over this one (with your new fix integrated into the correct commit + the rebase) - that would be my preferred way of working. I'd like to merge this for v1.64 🤞 |
.DS_Store is an irrelevant file created automatically by macOS. *.log can't be ignored because bisync uses .log files in its test suite.
Fixed an issue causing dry runs to inadvertently commit filter changes https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Dry%20runs%20are%20not%20completely%20dry
--check-access is now enforced during --resync, preventing data loss in certain user error scenarios https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=%2D%2Dcheck%2Daccess%20doesn%27t%20always%20fail%20when%20it%20should
Fixed an issue causing bisync to consider more files than necessary due to overbroad filters during delete operations https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=5.%20Bisync%20reads%20files%20in%20excluded%20directories%20during%20delete%20operations
Improved detection of false positive change conflicts (identical files are now left alone instead of renamed) https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Identical%20files%20should%20be%20left%20alone%2C%20even%20if%20new/newer/changed%20on%20both%20sides
Sync creation and deletion of empty directories. https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=3.%20Bisync%20should%20create/delete%20empty%20directories%20as%20sync%20does%2C%20when%20%2D%2Dcreate%2Dempty%2Dsrc%2Ddirs%20is%20passed Also fixed an issue causing --resync to erroneously delete empty folders and duplicate files unique to Path2 https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=2.%20%2D%2Dresync%20deletes%20data%2C%20contrary%20to%20docs
c00356b to
3ad1ef8
Compare
|
I think it should be all set now 👍 |
ncw
left a comment
There was a problem hiding this comment.
Thank you @nielash that is a very nice set of patches :-)
I will merge them now.
Any chance you'd like to be the maintainer of rclone's bisync code from now on? Drop me an email to [email protected] if you are interested :-)
Thanks! They've certainly improved my workflow and I hope others will find them helpful as well.
I'm definitely interested, depending on the time commitment you're looking for. I'll drop you an email 😃 |
Added rc support for the flags recently introduced in rclone#6971. createEmptySrcDirs ignoreListingChecksum resilient
Added rc support for the flags recently introduced in #6971. createEmptySrcDirs ignoreListingChecksum resilient
Added rc support for the flags recently introduced in rclone#6971. createEmptySrcDirs ignoreListingChecksum resilient
What is the purpose of this change?
Several
bisyncbug fixes and new features including--create-empty-src-dirsand equality check.Described in (excruciating) detail here. And further articulated in the proposed documentation changes.
In summary:
--resyncto erroneously delete empty folders and duplicate files unique to Path2--check-accessis now enforced during--resync, preventing data loss in certain user error scenarios--create-empty-src-dirs--resilientmode to allow recovery from self-correctable errors--ignore-listing-checksumflag to distinguish from--ignore-checksumWas the change discussed in an issue or in the forum before?
Yes, mainly in this forum post:
https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636
It also fixes #6109 and addresses several other open issues: #6841 #5683 #5681 #5676 #5675 #5674
Checklist