Skip to content

Commit

Permalink
cadc-storage-adapter-fs: storage iterator warn and skip
Browse files Browse the repository at this point in the history
if stored files are missing required xattrs
  • Loading branch information
pdowler committed Aug 23, 2024
1 parent 548d573 commit 23f82d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cadc-storage-adapter-fs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ apply from: '../opencadc.gradle'

group = 'org.opencadc'

version = '0.9.4'
version = '0.9.5'

description = 'OpenCADC Storage Inventory FileSystem StorageAdapter implementation'
def git_url = 'https://github.com/opencadc/storage-inventory'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,16 @@ static StorageMetadata createStorageMetadata(Path base, Path p, boolean includeR
try {
String csAttr = getFileAttribute(p, OpaqueFileSystemStorageAdapter.CHECKSUM_ATTR);
String aidAttr = getFileAttribute(p, OpaqueFileSystemStorageAdapter.ARTIFACTID_ATTR);
if (csAttr == null || aidAttr == null) {
// this could happen if some were to copy files or the whole filesystem to
// a new storage area and not preserve xattrs (eg rsync without -X/--xattrs)

// for now, just warn and skip so the operator has a chance to correct
log.warn("SKIP invalid: " + sloc + " : missing required attribute(s)"
+ " " + OpaqueFileSystemStorageAdapter.CHECKSUM_ATTR + "=" + csAttr
+ " " + OpaqueFileSystemStorageAdapter.ARTIFACTID_ATTR + "=" + aidAttr);
return null;
}
URI contentChecksum = new URI(csAttr);
long contentLength = Files.size(p);
URI artifactURI = new URI(aidAttr);
Expand Down

0 comments on commit 23f82d2

Please sign in to comment.