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

Duplicate IDs in a Content Type Despite Unique Field Constraint #29459

Open
7 tasks done
Neehakethi opened this issue Aug 6, 2024 · 6 comments
Open
7 tasks done

Duplicate IDs in a Content Type Despite Unique Field Constraint #29459

Neehakethi opened this issue Aug 6, 2024 · 6 comments

Comments

@Neehakethi
Copy link
Contributor

Neehakethi commented Aug 6, 2024

Parent Issue

No response

Problem Statement

We are experiencing duplicate IDs for a content type in dotCMS, even though the field is marked as unique. Simultaneous double inserts from different pods do not explain this issue, and it occurs even with the indexPolicy=WAIT_FOR setting.

An example scenario :

Occurrence:
A contentlet with ID XXXX has existed since YYYY.
In June, two new contentlets were created with the same ID.
In July, another contentlet with the same ID was created.

Suspected initial cause:
Index policy timing issues.
findings: The issue persists even with the WAIT_FOR policy.
Ideas proposed: Use database-level constraints or a custom script for unique values.

We need to identify why the unique constraint is not working as expected and how we can address this issue. Potential solutions include:

Adding a unique key constraint at the database level.
Implementing a custom script to generate unique values based on configurable fields.

Steps to Reproduce

https://dotcms.zendesk.com/agent/tickets/117183

This was happening specifically with a customer

Acceptance Criteria

We should avoid creating duplicate id's for unique fields in every possible scenario

dotCMS Version

23.10.24 LTS

Proposed Objective

Core Features

Proposed Priority

Priority 2 - Important

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

https://dotcms.zendesk.com/agent/tickets/117183

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

Tasks

Preview Give feedback
  1. QA : Approved QA : Passed Internal Release : 24.10.16 Team : Falcon
    dsilvam
  2. QA : Approved QA : Passed Internal Release : 24.11.11 Team : Falcon
  3. QA : Approved QA : Passed Internal Release : 24.11.11 Team : Falcon Type : Defect
  4. OKR : Customer Success OKR : Customer Support QA : Approved QA : Passed Internal Release : 24.11.29 Team : Falcon dotCMS : Content Management
  5. OKR : Core Features OKR : Customer Support QA : Passed Internal Team : Falcon Type : Defect
    freddyDOTCMS
  6. Merged Release : 24.12.05 Team : Falcon
  7. QA : Approved QA : Passed Internal Release : 24.12.10 Team : Falcon dotCMS : Content Management
@Neehakethi
Copy link
Contributor Author

Customer now reporting seeing more duplicates: earlier were 2 or 3 which have increased to 27 now

@john-thomas-dotcms
Copy link
Contributor

The proposed "full" solution to this still hasn't been fully agreed on, since proposed solutions may not address all use cases.

So, for a first pass, we're going to just change the existing Elasticsearch query to a DB query.

We will need to verify that this change doesn't cause a performance hit or bottlenecks waiting for the DB query to return. To verify this, we may need to make a copy of the customer system that we can test against.

@john-thomas-dotcms
Copy link
Contributor

Good poin from J. Sanchez: We should enable/disable the DB/ES query functionality via a config param.

@dsilvam dsilvam moved this from Current Sprint Backlog to Next 1-3 Sprints in dotCMS - Product Planning Sep 17, 2024
@freddyDOTCMS freddyDOTCMS self-assigned this Sep 19, 2024
@freddyDOTCMS
Copy link
Contributor

Here the POC done to detect what is the best solution #29707

@crak-mess
Copy link

Hello, is there any ETA on this fix ?
Thank you very much.

@freddyDOTCMS freddyDOTCMS moved this from In Progress to Internal QA in dotCMS - Product Planning Dec 9, 2024
@m27iu4
Copy link

m27iu4 commented Dec 17, 2024

@freddyDOTCMS freddyDOTCMS moved this from In Progress to Done in dotCMS - Product Planning Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

8 participants