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
1 of 6 tasks
Neehakethi opened this issue Aug 6, 2024 · 4 comments
Open
1 of 6 tasks

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

Neehakethi opened this issue Aug 6, 2024 · 4 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

No response

Tasks

No tasks being tracked yet.

Tasks

  1. QA : Approved QA : Passed Internal Release : 24.10.16 Team : Falcon
    dsilvam
  2. Team : Falcon
    freddyDOTCMS
  3. Team : Falcon Type : Defect
    freddyDOTCMS
  4. Team : Falcon
  5. Team : Falcon
  6. Team : Falcon
@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.

@freddyDOTCMS freddyDOTCMS self-assigned this Sep 19, 2024
@freddyDOTCMS
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

5 participants