Project

Profile

Help

Story #4295

closed

As a user, a repository version has no advisories with the same id

Added by ttereshc almost 6 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Sprint/Milestone:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
Yes
Tags:
Sprint:
Quarter:

Description

Motivation

Currently it is possible to have multiple Advisories(UpdateRecord content units) with the same id in one repo version. Those content units are not full duplicates, they have the same id but different content. That leads to a creation of a bad repository at a publication time (id of an advisory should be unique per yum repo, so Pulp needs to publish only one advisory per id).

Possible cases

At sync time in additive mode:

  1. Repo version 1 contains an updateA, in repo version 2 a newer version of the updateA is being added
  2. Repo version 1 contains an updateA, in repo version 2 an older version of the updateA is being added
  3. Repo version 1 contains an updateA, in repo version 2 an alternative version of the updateA (e.g. for different distribution) is being added

In case of a mirror mode for sync, always the incoming version of the updateA is taken, regardless of any criteria.

Suggested solution

For any addition of content to an RPM repo version ensure that there is no more than one UpdateRecord with the same id.

Decide which UpdateRecord to keep based on the criteria defined below.

Criteria

In case of mirror sync, just pick the incoming UpdateRecord.

In all other cases:

  • updated_dates are the same, pkglist intersection is empty (e.g. base repo merged with debuginfo repo)
    -> new UpdateRecord content unit with combined pkglist is created and added to a repo, old UpdateRecord is removed form a repo.
  • updated_dates differ, pkglist intersection is non-empty (update/re-sync/upload-new case) -> UpdateRecord with newer updated_date should be in a repo.
  • updated_dates differ, pkglist intersection is empty - ERROR CONDITION! (base and -debuginfo buit repos are from different versions, not at same date)
    • tell to go make sure that the merging repos are up-to-date, and then retry
  • update_dates are the same, pkglist intersection is non-empty and not equal to either pkglist - ERROR CONDITION!
    • never-happen case - "something is Terribly Wrong Here"

A relevant functional test which is currently being skipped.


Related issues

Has duplicate RPM Support - Story #5084: As a user, after copy or repo version creation there are no advisories with the same idCLOSED - DUPLICATE

Actions

Also available in: Atom PDF