Skip to content

Add repair step to reset stray locks - #25064

Closed
PVince81 wants to merge 1 commit into
masterfrom
repair-straylocks
Closed

PVince81 wants to merge 1 commit into
masterfrom
repair-straylocks

Conversation

@PVince81

Copy link
Copy Markdown
Contributor

Fixes #24494

Note: I decided to just reset the "lock" value to 0 instead of deleting all entries to prevent bigger database operations (does a DBMS defragment or restructure the data when deleting entries ?).

@owncloud/filesystem @butonic @nickvergessen

@PVince81 PVince81 added this to the 9.1-current milestone Jun 10, 2016
@mention-bot

Copy link
Copy Markdown

By analyzing the blame information on this pull request, we identified @DeepDiver1975, @nickvergessen and @icewind1991 to be potential reviewers

@PVince81

Copy link
Copy Markdown
Contributor Author

Something to be backported to 9.0 and maybe even 8.2.

CC @dragotin @DeepDiver1975

@icewind1991

Copy link
Copy Markdown
Contributor

Shouldn't this has some ttl logic

@PVince81

Copy link
Copy Markdown
Contributor Author

@icewind1991 hmmm... but I still see reports of people with stray locks, even after waiting for three days. (not sure what OC version though).

The repair step would mostly be useful for the pre-TTL OC versions.

@rullzer

rullzer commented Jun 13, 2016

Copy link
Copy Markdown
Contributor

Mmmm could it be those people don't have their cron configured properly.

@rullzer

rullzer commented Jun 13, 2016

Copy link
Copy Markdown
Contributor

Note: I decided to just reset the "lock" value to 0 instead of deleting all entries to prevent bigger database operations (does a DBMS defragment or restructure the data when deleting entries ?).

That depends on to many factors to properly awnser.
Having said that. Deleting should be fine as well. I mean nobody is having an installation with 9M stray locks.

@PVince81

Copy link
Copy Markdown
Contributor Author

I'm ok with retracting this PR. Actually when I wrote it I completely forgot about the TTL.

$qb = $this->connection->getQueryBuilder();
$qb->update('file_locks')
->set('lock', $qb->expr()->literal(0))
->where($qb->expr()->neq('lock', $qb->expr()->literal(0)));

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.

When this repair step is run with occ maintenance:repair while an upload/action is in progress, it will cause problems?

@nickvergessen

Copy link
Copy Markdown
Contributor

I'm ok with retracting this PR. Actually when I wrote it I completely forgot about the TTL.

additional to that with the problem I pointed out above, I'd say that's best to do.

@PVince81 PVince81 closed this Jun 13, 2016
@PVince81
PVince81 deleted the repair-straylocks branch June 13, 2016 10:23
@lock

lock Bot commented Aug 5, 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 5, 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.

occ command to clear all locks

6 participants