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

Fix UniqueConstraintViolationException while insert into oc_file_locks #12413

Merged
merged 1 commit into from
Nov 12, 2018

Conversation

MorrisJobke
Copy link
Member

I would back port this one to stable13 and stable14 as well because it is a smaller and not that invasive version of #12371 and it also fixes the deadlocks.

* fixes #9305 by not being prone to the race condition in insertIfNotExists
* fixes #6899 by not using a query that can result in a deadlock
* replaces the insertIfNotExists call with an insert which is wrapped into a try-catch block
* followup to #12371

Signed-off-by: Morris Jobke <[email protected]>
Copy link
Member

@blizzz blizzz left a comment

Choose a reason for hiding this comment

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

make sense

@blizzz blizzz added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Nov 12, 2018
@MorrisJobke MorrisJobke merged commit 9e1ec0c into master Nov 12, 2018
@MorrisJobke MorrisJobke deleted the bugfix/9305/oc_file_locks-unique-constraint branch November 12, 2018 16:27
@rcdailey
Copy link
Contributor

Since this will be backported, is there a PR or issue I can follow to track when this makes it into v14?

@kesselb
Copy link
Contributor

kesselb commented Nov 17, 2018

#12433 will be part of https://github.com/nextcloud/server/milestone/57

@wazoox
Copy link

wazoox commented Feb 27, 2019

HI, just upgraded to Nextcloud 15.0.4, the problem persists. The postgresql logs are polluted by these 5 times a second:

2019-02-27 18:15:01 UTC [29519-8] nextcloud@nextcloud DÉTAIL:  La clé « (key)=(files/a2847fe27d8c3fc0b2a6a889de5f4a6c) » existe déjà.
2019-02-27 18:15:01 UTC [29519-9] nextcloud@nextcloud INSTRUCTION :  INSERT INTO "oc_file_locks" ("key", "lock", "ttl") VALUES($1, $2, $3)

Everything seems to work fine, but this is slowing down the system a lot which crawls under postgresql load.

@MorrisJobke
Copy link
Member Author

HI, just upgraded to Nextcloud 15.0.4, the problem persists. The postgresql logs are polluted by these 5 times a second:

Fix for this is in #13721

@AndyXheli
Copy link

Issue is backup again in #6899

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug
Projects
None yet
7 participants