Skip to content

[command] delete orphaned file cache entries - #15437

Merged
DeepDiver1975 merged 1 commit into
masterfrom
deleteorphanedfiles
Apr 9, 2015
Merged

DeepDiver1975 merged 1 commit into
masterfrom
deleteorphanedfiles

Conversation

@MorrisJobke

Copy link
Copy Markdown
Contributor
  • ./occ files:cleanup
  • delete file cache entries without an existing storage

For manual cleanup, because of a somehow broken database.

cc @icewind1991 @PVince81

I've seen this on multiple instances and this would help to clean up somehow screwed up filecache entries.

@MorrisJobke

Copy link
Copy Markdown
Contributor Author

cc @butonic You also noticed this on some instances

@PVince81

PVince81 commented Apr 7, 2015

Copy link
Copy Markdown
Contributor

I guess you'll also add #14676 once it's merged ?

@PVince81

PVince81 commented Apr 7, 2015

Copy link
Copy Markdown
Contributor

Or should this (orphaned file cache entries) be run as a background job too ? I can't think of any real-life situation where such entries would be produced, so it might be fine to have it only as an explicit command.

@nickvergessen

Copy link
Copy Markdown
Contributor
Testergebnis (1 fehlgeschlagener Test / +1)

OCA\Files\Tests\Command\DeleteOrphanedFilesTest.testClearFiles

@MorrisJobke

Copy link
Copy Markdown
Contributor Author

Or should this (orphaned file cache entries) be run as a background job too ? I can't think of any real-life situation where such entries would be produced, so it might be fine to have it only as an explicit command.

That's why I created a command ;) There are instances that are somehow broken ...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Move the kong fu into the database adapter please

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not really possible as this is specific to this situation.

Another similar case here: https://github.com/owncloud/core/pull/14676/files#diff-e4aa006eb720e90531b21006170392f9R50

I'm not sure we can make this properly generic.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

well you see the problem? the code you linked does not work on postgres, as per this code + comment here

@MorrisJobke
MorrisJobke force-pushed the deleteorphanedfiles branch from 00d1324 to e2243e1 Compare April 7, 2015 15:12
@MorrisJobke

Copy link
Copy Markdown
Contributor Author

from #14676 (comment)

After discussing with @MorrisJobke we decided to go the sub-query approach which works for all DBs (note that the current approach also fails on PostgreSQL).

@MorrisJobke MorrisJobke added this to the 8.1-current milestone Apr 7, 2015
@MorrisJobke
MorrisJobke force-pushed the deleteorphanedfiles branch from e2243e1 to 1c1e040 Compare April 7, 2015 16:04

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please change the message to "$deletedEntries orphaned file cache entrie(s) deleted".
Because currently it sounds like it deleted real actual files (and sounds a bit scary too)

@PVince81

PVince81 commented Apr 7, 2015

Copy link
Copy Markdown
Contributor

Tested, works. 👍
Please fix the message and this is good to go.

@butonic

butonic commented Apr 8, 2015

Copy link
Copy Markdown
Contributor

If we delete file cache entries we should also delete shares referencing these entries or create a separate DeleteOrphanedSharesJob.

@PVince81

PVince81 commented Apr 8, 2015

Copy link
Copy Markdown
Contributor

DeleteOrphanedSharesJob is here #14676 but is run every 15 mins. But we could automatically call it from inside this command instead, if needed.

* ./occ files:cleanup
* delete file cache entries without an existing storage
@MorrisJobke
MorrisJobke force-pushed the deleteorphanedfiles branch from 1c1e040 to cefdcea Compare April 8, 2015 08:24
@MorrisJobke

Copy link
Copy Markdown
Contributor Author

@PVince81 Done :)

@butonic @nickvergessen @LukasReschke Ready for review :)

@ghost

ghost commented Apr 8, 2015

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/11299/
🚀 Test PASSed.🚀
chuck

@scrutinizer-notifier

Copy link
Copy Markdown

The inspection completed: 1 new issues, 10 updated code elements

@MorrisJobke

Copy link
Copy Markdown
Contributor Author

@nickvergessen @LukasReschke One review left :)

@DeepDiver1975

Copy link
Copy Markdown
Contributor

👍

DeepDiver1975 added a commit that referenced this pull request Apr 9, 2015
[command] delete orphaned file cache entries
@DeepDiver1975
DeepDiver1975 merged commit 02614d2 into master Apr 9, 2015
@DeepDiver1975
DeepDiver1975 deleted the deleteorphanedfiles branch April 9, 2015 22:09
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 13, 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.

6 participants