Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix publisher to be better at metadata consistency #312

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/WTSI/NPG/iRODS/Publisher.pm
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@ sub _publish_file_overwrite {
$self->info("Skipping publication of '$local_path' to '$remote_path': ",
"(checksum unchanged): local MD5 is '$local_md5', ",
"remote is MD5: '$pre_remote_md5'");
# Ensure the metadata are up-to-date, for consistency
$self->_supersede($obj,
$self->make_md5_metadata($pre_remote_md5),
$self->make_type_metadata($remote_path));
}
else {
$self->info("Re-publishing '$local_path' to '$remote_path' ",
Expand All @@ -378,8 +382,9 @@ sub _publish_file_overwrite {
# Add modification metadata only if successful
$num_meta_errors +=
$self->_supersede($obj,
$self->make_modification_metadata($timestamp),
$self->make_md5_metadata($post_remote_md5),
$self->make_modification_metadata($timestamp));
$self->make_type_metadata($remote_path));
} catch {
$num_write_errors++;
$self->error(q[Failed to overwrite existing data object at '],
Expand Down
Loading