Skip to content

cold command: clear_hot is not transactional #175

@psaiz

Description

@psaiz

Take a look a the command:

cernopendata cold clear_hot

It does three things:

  1. It attempts to delete the local file
  2. It creates an objecttag marking the entry as deleted
  3. it reevaluates the metadata of the record, and saves it on _files (or _index_files)

If, for whatever reason, the command is killed after the second step (and before the third), it leaves the repository in an inconsistent situation, where the file has been marked as deleted, the record does not know about it. Attempting to clear_hot again will give a duplicate_tag error.

Two things to do here:

  1. (and most important). Check the logic, and ensure that the commit to the database is only done after 3 (and not after 2)
  2. Make an option, like -force, that will continue even if the objecttag exists

Verify if the same issue applies to other commands like archive and stage.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions