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

[stable9.1] Repair oc_mounts' shared:: storages that must not be #25804

Closed
wants to merge 1 commit into from

Conversation

PVince81
Copy link
Contributor

For #24106

Delete oc_mounts' shared:: storages entries because they refer to a bogus storage entries. These entries will be recreated with the correct format the next time the user logs in.

This situation is only created in OC 9.0. New entries are created properly since 9.1 so this repair step is only to make the entries properly consistent.

Please review @owncloud/filesystem @owncloud/sharing @VicDeo @jvillafanez @butonic

  • forward port to master

@PVince81 PVince81 added this to the 9.1.1 milestone Aug 15, 2016
@mention-bot
Copy link

@PVince81, thanks for your PR! By analyzing the annotation information on this pull request, we identified @DeepDiver1975, @nickvergessen and @LukasReschke to be potential reviewers

@PVince81
Copy link
Contributor Author

  • use the opportunity to also delete the matching oc_storages entries ? (only if they start with "shared::")

@PVince81
Copy link
Contributor Author

This repair step would also repair cases like #25805 where the storage id doesn't match.

@jvillafanez
Copy link
Member

Code looks good 👍

@PVince81 PVince81 modified the milestones: 9.1.2, 9.1.1 Sep 1, 2016
Delete oc_mounts' shared:: storages entries because they refer to a
bogus storage entries. These entries will be recreated with the correct
format the next time the user logs in.
@PVince81 PVince81 modified the milestones: 9.1.3, 9.1.2 Oct 19, 2016
@PVince81
Copy link
Contributor Author

PVince81 commented Nov 9, 2016

To delete the bogus shared:: storages: delete all oc_storages entries where the storage id starts with "shared::/" (with slash + file target). These entries should never have existed before so should be safe to delete (to double check!).

Unfortunately there might be cases where the whole storage id is a md5 if the file target was too long... deleting these would need iterating over all users and is expensive, but also a rare case, so can maybe be ignored for now...

}

private function repairMountEntries(IOutput $output) {
$pageSize = self::CHUNK_SIZE;
Copy link
Member

Choose a reason for hiding this comment

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

What if the number of results is greater than the chunk size?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Argh, you're right. It seems I forgot adding a setOffset() before reexecuting.

@PVince81 PVince81 modified the milestones: 9.1.4, 9.1.3 Nov 30, 2016
@PVince81 PVince81 modified the milestones: 9.1.5, 9.1.4 Feb 6, 2017
@PVince81
Copy link
Contributor Author

no time for time, also not really critical

@PVince81 PVince81 modified the milestones: backlog, 9.1.5 Apr 13, 2017
@PVince81
Copy link
Contributor Author

PVince81 commented Jul 4, 2017

pffff, not sure if this is really worth it. One can just clear oc_mounts and have the entries recreated anyway

@PVince81 PVince81 closed this Jul 4, 2017
@DeepDiver1975 DeepDiver1975 deleted the stable9.1-repair-ocmounts-shared branch August 11, 2017 22:54
@lock
Copy link

lock bot commented Aug 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants