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

Address duplicate timestamps in metadata mirror files #328

Merged
merged 4 commits into from
Apr 24, 2020

Conversation

ericzolf
Copy link
Member

FIX: fail with meaningful error message on metadata mirror files with duplicate timestamps, closes #322
NEW: option --allow-duplicate-timestamps to only warn about duplicate timestamps in metadata mirror files, use this option with care and only to clean an impacted backup repository.

I still need to add a test for this and document the new option in the manpage and in the completion files.

FIX: fail with meaningful error message on metadata mirror files with duplicate timestamps, closes #322
NEW: option --allow-duplicate-timestamps to only warn about duplicate timestamps in metadata mirror files, use this option with care and only to clean an impacted backup repository.
@ikus060
Copy link
Contributor

ikus060 commented Apr 21, 2020

Look good.
I recommend creating a ticket to document this options in man page

@ericzolf
Copy link
Member Author

I'll do all necessary changes in this one PR (that's why it's still WIP).

@ericzolf ericzolf changed the title WIP: Address duplicate timestamps in metadata mirror files Address duplicate timestamps in metadata mirror files Apr 23, 2020
@ericzolf
Copy link
Member Author

Not any more WIP: test case has been written and works for me. Please review and merge.

Copy link
Contributor

@ikus060 ikus060 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect for me. But the "Squash and merge" is disable and there was an ongoing discussion between you and Otto about how to merge and I'm not sure we are align. So I will leave the merge to one of you.

@ericzolf ericzolf merged commit 5c37d2a into master Apr 24, 2020
@ericzolf ericzolf deleted the ericzolf-fix-duplicate-date-322 branch April 24, 2020 10:40
@ericzolf
Copy link
Member Author

You just need top press the button next to the note that it's not up to date.

# Normally there shouldn't be any case of duplicate timestamp but it seems
# we had the issue at some point in time, hence we need the flag to allow
# users to clean up their repository. The default is to abort on such cases.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, users don't need this flag to clean up their repository with '--remove-older-than'. The code path for 'remove-older-than' never calls sorted_prefix_inclist(). I therefore suggest that this option flag be removed because it serves no other useful purpose, and because its existence may be confusing to users, and because users may use it inappropriately which may cause additional problems for them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well spotted, I'm impressed, and I was almost ready to remove the option, when I realized that the --check-destination-dir does fail in such cases, which raises new "philosophical" questions. Let us continue this discussion in the new PR, once I've created it (I will definitely change the man pages).

src/rdiff_backup/metadata.py Show resolved Hide resolved
extra_options=b"--allow-duplicate-timestamps")
# now we can clean-up
rdiff_backup(1, 1, target_rp.get_path(), None,
extra_options=b"--allow-duplicate-timestamps --remove-older-than 5B --force")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As said before, the --allow-duplicate-timestamps option is not needed here.

testing/errorsrecovertest.py Show resolved Hide resolved
@ericzolf
Copy link
Member Author

I can't re-open a merged PR, but you're feedback is correct and I'll address it in a new PR. Thanks.

ericzolf pushed a commit that referenced this pull request Apr 26, 2020
- re-write the tests to take into consideration that --remove-older-than doesn't need --allow-duplicate-timestamps
- improve the error message and the man-page also accordingly
- make the tests also slightly more robust, sorting entry and using date instead of number of backups
ericzolf added a commit that referenced this pull request May 3, 2020
- re-write the tests to take into consideration that --remove-older-than doesn't need --allow-duplicate-timestamps
- improve the error message and the man-page also accordingly
- make the tests also slightly more robust, sorting entry and using date instead of number of backups
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.

Exception ''<' not supported between instances of 'RPath' and 'RPath'' at backup
3 participants