-
Bug
-
Resolution: Timed out
-
Medium
-
8
-
Severity 2 - Major
-
NOTE: This bug report is for Confluence Cloud. Using Confluence Server? See the corresponding bug report.
Issue Summary
In some cases, it's possible for two labels to be created with the same name (even though we do checks for this). It can occur when there are two parallel requests (via the web or XML-RPC), which try to add the same (non-existent) label. Since they're in separate transactions, it's not possible to see that another session is trying to create the label, so both end up in the DB.
For example, new labels can be created via API using the add labels to content API endpoint. If users use this API endpoint multiple times and fast enough, and no label exists at the start of the execution of their script, then multiple labels will be created with the same name.
Steps to Reproduce
- Have a script that calls the above end point very quickly or in parallel for multiple pieces of content and using the same label name.
- Run the script
Expected Results
One label is created and is associated with all content
Actual Results
Multiple labels are created with the same name. It seems to be random which content gets which duplicate, but typically one label will have the most associations.
This can be confirmed by using the Label List macro and noting that multiple labels are listed with the same name.
Workaround
If duplicate labels have been created:
- Remove these labels from all content either manually or by utilizing the remove label from content API endpoint.
- Add the labels back either manually or by utilizing the add labels to content API endpoint. Since the label exists by the time these requests are received, only one label will be used this time, regardless of the speed of the API calls.
The above process will ensure that all labels have one and only one label, rather than any duplicate label.
To prevent this issue from happening in the future, for each new label to be created, make sure that the label exists first (either via UI or one API call), then subsequent calls will use the already created label regardless of the speed at which those calls are created.
Possible solutions to this
Write a periodic task that merges any duplicate labels (and the affected content)
Isolate the sections of the current transaction in the save process, to narrow the window in which this can occur
Add some sort of read/write filtering to the transaction so the changes can be seen before the transaction ends
- causes
-
CONFCLOUD-47861 "There is more than one label named 'global_watch' in the 'questions' namespace." log message shows when viewing or editing action.
- Closed
- is detailed by
-
CONFCLOUD-73005 Fast enough label creation causes duplicate labels with the same names
- Closed
- is related to
-
CONFSERVER-5254 Duplicate labels can be created by Concurrency Requests
- Closed
- blocks
-
CEXM-388 Loading...
- mentioned in
-
Page Loading...