Skip to content

Problem: Disabled replicator locations still create package replicas #1809

Description

@replaceafill

Expected behaviour

When a Replicator location is disabled, Storage Service should not create new package replicas in that location.

Current behaviour

If an AIP Storage location has a configured Replicator location and that Replicator is later disabled, new replicas are still created in the disabled location.

The replication path in Package.create_replicas() currently uses:

replicator_locs = self.current_location.replicators.all()

This returns all related Replicator locations, including disabled ones. Since the Location model has an enabled field and an active manager for enabled locations, this should instead filter the related locations to:

replicator_locs = self.current_location.replicators.filter(enabled=True)

Steps to reproduce

  1. Create or select an AIP Storage location.
  2. Configure a Replicator location for that AIP Storage location.
  3. Store an AIP and confirm a replica is created.
  4. Disable the Replicator location.
  5. Store another AIP, or run replica creation for an existing AIP.
  6. Observe that Storage Service still creates a package replica in the disabled Replicator location.

Your environment (version of Archivematica, operating system, other relevant details)

artefactual/archivematica@988d1ff
artefactual/archivematica-storage-service@6808a7a


For Artefactual use:

Before you close this issue, you must check off the following:

  • All pull requests related to this issue are properly linked
  • All pull requests related to this issue have been merged
  • A testing plan for this issue has been implemented and passed (testing plan information should be included in the issue body or comments)
  • Documentation regarding this issue has been written and merged (if applicable)
  • Details about this issue have been added to the release notes (if applicable)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: reviewThe issue's code has been merged and is ready for testing/review.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions