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

Duplicated entries in the oc_vcategory table cause favourite tags to not be permanently deleted #20952

Closed
MorrisJobke opened this issue Dec 4, 2015 · 19 comments

Comments

@MorrisJobke
Copy link
Contributor

MorrisJobke commented Dec 4, 2015

Steps to reproduce

  1. Select some random files as favourite
  2. Web interface shows a correct removal
  3. Reloading the browser makes the favourite tags to be showed back. Checking the database tables will show duplicated entries for the same user in the oc_vcategory table (see below).
    After manually removing the duplicated entries in the oc_vcategory table and the corresponding ones in oc_vcategory_to_object, favourite tags are permanently deleted.

Expected behaviour

Favourite tags should be permanently deleted and no duplicated entries for the same user in the oc_vcategory table should exist.

Actual behaviour

See above

Server configuration

ownCloud version: 8.1.4

mysql> select * from oc_vcategory; 
+----+----------+-------+------------------+ 
| id | uid | type | category | 
+----+----------+-------+------------------+ 
| 2 | user857 | files | _$!<Favorite>!$_ | 
| 3 | user857 | files | _$!<Favorite>!$_ | 
+----+----------+-------+------------------+ 
2 rows in set (0.00 sec) 

mysql> select * from oc_vcategory_to_object; 
+-------+------------+-------+ 
| objid | categoryid | type | 
+-------+------------+-------+ 
| 4472 | 2 | files | 
| 4484 | 3 | files | 
+-------+------------+-------+ 
2 rows in set (0.00 sec)

cc @pako81

@MorrisJobke
Copy link
Contributor Author

The deletion of tags is covered in #12858

@PVince81 Have you seen the above duplication in the past?

@PVince81
Copy link
Contributor

PVince81 commented Dec 4, 2015

I suspect a concurrency issue: two parallel calls noticing that the tag did not exist so it created it...

We should probably lock the file before working on tags, and maybe also add a unique key.

@PVince81
Copy link
Contributor

PVince81 commented Dec 4, 2015

The ticket #12858 is actually only for the relations, not the tags themselves.

@PVince81 PVince81 added this to the 9.0-current milestone Dec 4, 2015
@PVince81
Copy link
Contributor

PVince81 commented Dec 4, 2015

You should be able to manually delete one of the tags in the database including its relationship as a quickfix.

Is that only a single occurrence of the duplication ?

@pako81
Copy link

pako81 commented Dec 4, 2015

@PVince81 they've only noticed one single occurence of the duplication since now but Customer does not exclude that some other end users are also affected by this as they did have not the chance to check

@bboule
Copy link

bboule commented Jan 7, 2016

Guys next steps on this?

@PVince81
Copy link
Contributor

PVince81 commented Jan 8, 2016

Is that only a single occurrence of the duplication or is it easily reproducible ?

@MorrisJobke ^ for severity

@MorrisJobke
Copy link
Contributor Author

@PVince81 When are those tags added? Isn't it checked to only add it once? And why is there no unique constraint in that table?

@nickvergessen
Copy link
Contributor

And why is there no unique constraint in that table?

fix it ;)

@PVince81
Copy link
Contributor

PVince81 commented Jan 8, 2016

@MorrisJobke I think it should, but if two processes do the check first, then insert at the same time, the check for both will see that the tag wasn't set. Locking might help.

@nickvergessen
Copy link
Contributor

Locking might help.

No, just favorite two different files at the same time.

What might help is unique key and/or insert if not exists

@ghost
Copy link

ghost commented Feb 23, 2016

@bboule @MorrisJobke moving to 9.1 unless there's an objection

@ghost ghost modified the milestones: 9.1-next, 9.0-current Feb 23, 2016
@MorrisJobke
Copy link
Contributor Author

@bboule @MorrisJobke moving to 9.1 unless there's an objection

cc @pako81

00004316

@pako81
Copy link

pako81 commented Feb 25, 2016

yes, ok for 9.1

@MorrisJobke MorrisJobke removed their assignment Apr 15, 2016
@PVince81 PVince81 modified the milestones: 9.1-current, 9.1.1-next-maintenance Jun 30, 2016
@PVince81 PVince81 added this to the 9.1.2 milestone Sep 21, 2016
@PVince81 PVince81 removed this from the 9.1.1 milestone Sep 21, 2016
@PVince81 PVince81 modified the milestones: 9.1.3, 9.1.2 Oct 20, 2016
@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

@pako81 has this happened again recently ?

@pako81
Copy link

pako81 commented Apr 13, 2017

No, no similar issues have been reported to us recently AFAIK

/cc @cdamken

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

moving to backlog for another time

@ownclouders
Copy link
Contributor

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

@stale
Copy link

stale bot commented Sep 20, 2021

This issue has been automatically closed.

@stale stale bot closed this as completed Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants