Add Geo replication DB schema for Packages::Debian::ProjectComponentFile

What does this MR do and why?

Create database tables for Geo replication and verification of Debian project component files (Packages::Debian::ProjectComponentFile):

  • State table (packages_debian_project_component_file_states) — tracks verification state on the primary site
  • Registry table (packages_debian_project_component_file_registry) — tracks sync/verification state on secondary Geo sites
  • Database dictionary YAML files for both tables

This follows the established Geo SSF blob replicator pattern used for Packages::Nuget::Symbol and other replicable types.

References

Migration SQL

State table (db/migrate)

CREATE TABLE packages_debian_project_component_file_states (
    id bigint NOT NULL,
    verification_started_at timestamp with time zone,
    verification_retry_at timestamp with time zone,
    verified_at timestamp with time zone,
    packages_debian_project_component_file_id bigint NOT NULL,
    project_id bigint NOT NULL,
    verification_state smallint DEFAULT 0 NOT NULL,
    verification_retry_count smallint DEFAULT 0 NOT NULL,
    verification_checksum bytea,
    verification_failure text,
    CONSTRAINT check_c4ce9c5ee5 CHECK ((char_length(verification_failure) <= 255))
);

Registry table (ee/db/geo/migrate)

CREATE TABLE packages_debian_project_component_file_registry (
    id bigserial NOT NULL,
    packages_debian_project_component_file_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    last_synced_at timestamp with time zone,
    retry_at timestamp with time zone,
    verified_at timestamp with time zone,
    verification_started_at timestamp with time zone,
    verification_retry_at timestamp with time zone,
    state smallint DEFAULT 0 NOT NULL,
    verification_state smallint DEFAULT 0 NOT NULL,
    retry_count smallint DEFAULT 0 NOT NULL,
    verification_retry_count smallint DEFAULT 0 NOT NULL,
    checksum_mismatch boolean DEFAULT false NOT NULL,
    verification_checksum bytea,
    verification_checksum_mismatched bytea,
    verification_failure text,
    last_sync_failure text
);

Screenshots or screen recordings

Not applicable — database-only changes.

How to set up and validate locally

  1. Run bin/rake db:migrate — state table is created
  2. Run bin/rake db:migrate:geo — registry table is created
  3. Verify tables exist:
    \d packages_debian_project_component_file_states
    \d packages_debian_project_component_file_registry

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading