Project

General

Profile

Actions

Bug #21766

closed

Duplicate entries in taxable_taxonomies table

Added by Tomer Brisker over 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Organizations and Locations
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1494688

Description of problem:

It is possible for duplicate entries to be placed in taxable_taxonomies table.

Example:

id   | taxonomy_id | taxable_id | taxable_type |         created_at         |         updated_at         
-------+-------------+------------+--------------+----------------------------+----------------------------
17766 | 15 | 76 | Subnet | 2017-08-10 09:05:41.651359 | 2017-08-10 09:05:41.651359
17767 | 15 | 76 | Subnet | 2017-08-10 09:05:41.687729 | 2017-08-10 09:05:41.687729

Notice the consecutive ids and virtually identical created_at timestamps

Version-Release number of selected component (if applicable): Satellite 6.2.11

How reproducible: No known reproducer - but seems like the point in time which the row is created is a good starting point. Possible that a unique constraint could be placed around (taxonomy_id, taxable_id).

Steps to Reproduce:
1.
2.
3.

Actual results: Duplicate entries as shown in the example

Expected results:

select taxable_type, taxable_id, taxonomy_id, COUNT() as Duplicates from taxable_taxonomies GROUP BY taxable_type, taxable_id,taxonomy_id HAVING COUNT() > 1;

This query should not ever return results.

Additional info: This manifests via APIs which deal with taxonomies such as Locations

curl -X GET -k -u admin https://localhost/api/v2/subnets/:subnet_id/locations"


Related issues 1 (0 open1 closed)

Blocks Foreman - Refactor #21639: unique constraints should be enforced in the DB as wellResolvedActions
Actions #1

Updated by Tomer Brisker over 6 years ago

  • Blocks Refactor #21639: unique constraints should be enforced in the DB as well added
Actions #2

Updated by The Foreman Bot over 6 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Tomer Brisker
  • Pull request https://github.com/theforeman/foreman/pull/5028 added
Actions #3

Updated by Anonymous over 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #4

Updated by Marek Hulán over 6 years ago

  • translation missing: en.field_release set to 296
Actions

Also available in: Atom PDF