Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-40424

Remove content_facet.uuid usage in favor of subscription_facet.uuid

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • 6.19.0
    • None
    • Hosts
    • None
    • False
    • Proton Refinement Backlog
    • sat-proton
    • None
    • None
    • None
    • None

      Problem
      -------
      The codebase currently stores the Candlepin consumer UUID in TWO places:

      • content_facet.uuid
      • subscription_facet.uuid

      This duplication causes several issues:

      1. Data inconsistency: content_facet.uuid can be nil while subscription_facet.uuid is present (see commit b187e48)
      2. Code confusion: Developers must choose which UUID to use
      3. Bugs: Container gateway sync failed due to nil content_facet.uuid (issue #38862)
      4. Architectural violation: UUID is a subscription/consumer concept (from Candlepin), not a content concept

      Historical Context
      ------------------
      This duplication originated in the 2015 "Host Unification" migration (PR #5528, issue #11500) when the old System model was split into content_facet and subscription_facet. Both facets received the same UUID during migration, but this was never cleaned up.

      Current Usage
      -------------
      subscription_facet.uuid (17+ locations):

      • All Candlepin API calls
      • Subscription management
      • Remote execution
      • Container registry

      content_facet.uuid (4 locations - should be migrated):
      1. app/models/katello/host_collection.rb:54 - Getting consumer IDs
      2. app/services/katello/host/package_profile_uploader.rb:28 - Validation check
      3. app/services/katello/host/profiles_uploader.rb:14 - Validation check
      4. app/controllers/katello/api/registry/registry_proxies_controller.rb:55, 82 - Client cert auth

      Proposed Solution
      -----------------
      1. Migrate all 4 remaining content_facet.uuid usages to subscription_facet.uuid
      2. Add database migration to copy any remaining content_facet.uuid values to ensure no data loss
      3. Remove uuid column from katello_content_facets table
      4. Add delegation method if needed for compatibility: content_facet.uuid → subscription_facet.uuid

      Related Issues/Commits
      ----------------------

      • Commit b187e48: "Fixes #38862 - Switch to subscription facet for uuids"
      • Original migration: commit ccc3dc7c (2015) - PR #5528, issue #11500

              Unassigned Unassigned
              iballou@redhat.com Ian Ballou
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: