Skip to content

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

Closed
PVince81 wants to merge 1 commit into
stable9.1from
stable9.1-repair-ocmounts-shared
Closed

PVince81 wants to merge 1 commit into
stable9.1from
stable9.1-repair-ocmounts-shared

Conversation

@PVince81

Copy link
Copy Markdown
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
Copy Markdown

@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
Copy Markdown
Contributor Author
  • use the opportunity to also delete the matching oc_storages entries ? (only if they start with "shared::")

@PVince81

Copy link
Copy Markdown
Contributor Author

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

@jvillafanez

Copy link
Copy Markdown
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.
@DeepDiver1975
DeepDiver1975 force-pushed the stable9.1-repair-ocmounts-shared branch from ba231b0 to 856d391 Compare September 29, 2016 08:20
@PVince81 PVince81 modified the milestones: 9.1.3, 9.1.2 Oct 19, 2016
@PVince81

PVince81 commented Nov 9, 2016

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

no time for time, also not really critical

@PVince81 PVince81 modified the milestones: backlog, 9.1.5 Apr 13, 2017
@PVince81

PVince81 commented Jul 4, 2017 •

Copy link
Copy Markdown
Contributor Author

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

lock Bot commented Aug 2, 2019

Copy link
Copy Markdown

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