Page MenuHomeSoftware Heritage

storage: metadata_provider: Ensure idempotency when creating provider
ClosedPublic

Authored by ardumont on May 18 2020, 1:40 PM.

Details

Summary

Currently, in production, we have duplicated entries in origin_metadata and
metadata_provider.

This is due to a bad primary key on metadata_provider. This commit ensures
uniqueness when adding new metadata_provider by adding a unique primary key on
(provider_type, provider_url).

This is preparatory work to allow a smooth transition for D2988 (which will
need to be rebased).

Related to T2075

Test Plan

tox

Diff Detail

Repository
rDSTO Storage manager
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D3159 (id=11220)

Rebasing onto 87f7bee693...

Current branch diff-target is up to date.
Changes applied before test
commit 7b543c646ec64d00073a0a14c8c356997e4cbd1f
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon May 18 13:34:45 2020 +0200

    storage: metadata_provider: Ensure idempotency when creating provider
    
    Currently, in production, we have duplicated entries in origin_metadata and
    metadata_provider.
    
    This is due to a bad primary key on metadata_provider. This commit ensures
    uniqueness when adding new metadata_provider.
    
    This is preparatory work to allow a smoothless transition for D2988 (which will
    need to be rebased).
    
    Related to T2075

See https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/173/ for more details.

Build is green

Patch application report for D3159 (id=11221)

Rebasing onto 87f7bee693...

Current branch diff-target is up to date.
Changes applied before test
commit 6d24ed721a1eeedce76ecf7669b3cdadcc2d6f92
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon May 18 13:34:45 2020 +0200

    storage: metadata_provider: Ensure idempotency when creating provider
    
    Currently, in production, we have duplicated entries in origin_metadata and
    metadata_provider.
    
    This is due to a bad primary key on metadata_provider. This commit ensures
    uniqueness when adding new metadata_provider by adding a new unique primary key
    on (provider_type, provider_url).
    
    This is preparatory work to allow a smooth transition for D2988 (which will
    need to be rebased).
    
    Related to T2075

See https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/174/ for more details.

This revision is now accepted and ready to land.May 18 2020, 1:57 PM