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

Created on 14 July 2012, almost 12 years ago
Updated 11 June 2024, 17 days 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

10.2 ✨

Component
CommentΒ  β†’

Last updated about 4 hours 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.

Production build 0.69.0 2024