Possibility of {comment}.thread duplication in the same node

Created on 14 July 2012, over 12 years ago
Updated 8 July 2024, 5 months ago

While analyzing issues on drupal.org, I detected that it is possible for multiple comments on a node to have the same {comment}.thread value.

To ensure data integrity, we should have a unique index on (nid, thread).

Drupal.org had 34 instances where duplication had happened. Most of this apparently happened at times where things were especially flaky. (I manually repaired the damage already.)

Detecting duplicate thread values:
(d6 naming, use 'comment' for a d7+ db)
select distinct l.nid from comments l, comments r WHERE l.nid = r.nid and l.thread = r.thread and l.cid < r.cid;

This takes 5 minutes to run on drupal.org slave.

πŸ› Bug report
Status

Needs work

Version

7.0 ⚰️

Component
CommentΒ  β†’

Last updated 2 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States bdragon

Live updates comments and jobs are added and updated live.
  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡©πŸ‡ͺGermany slowflyer

    Just had this issue today on a 10.2.6 website. The related comments have been saved in the same second and resulted in same thread value.

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    @slowflyer, thanks for reporting the problem. It is good to know that this can still happen.

    Since, It is better to open a new issue than re-open and old one. Also, 10,2,x is only receiving security fixes now. have made a new issue πŸ› Duplicate thread on the same node Active .

    Therefor, I have made a new issue from comment #28 and referenced this issue.

    I am restoring the Meta data on this issue.

Production build 0.71.5 2024