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

Only add replicas if parent block has been properly added/attached into Rucio #10024

Merged
merged 1 commit into from
Oct 28, 2020
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions src/python/WMComponent/RucioInjector/RucioInjectorPoller.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ def insertReplicas(self, uninjectedData):
rseName = "%s_Test" % location if self.testRSEs else location
for container in uninjectedData[location]:
for block in uninjectedData[location][container]:
if block not in self.blocksCache:
logging.warning("Skipping %d file injection for block that failed to be added into Rucio: %s",
len(uninjectedData[location][container][block]['files']), block)
continue
injectData = []
listLfns = []
for fileInfo in uninjectedData[location][container][block]['files']:
Expand Down
13 changes: 11 additions & 2 deletions src/python/WMCore/Services/Rucio/Rucio.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,17 @@ def createReplicas(self, rse, files, block, scope='cms', ignoreAvailability=True
try:
# add_replicas(rse, files, ignore_availability=True)
response = self.cli.add_replicas(rse, files, ignoreAvailability)
except Exception as ex:
self.logger.error("Failed to add replicas for: %s and block: %s. Error: %s", files, block, str(ex))
except DataIdentifierAlreadyExists as exc:
if len(files) == 1:
self.logger.debug("File replica already exists in Rucio: %s", files[0]['name'])
response = True
else:
# FIXME: I think we would have to iterate over every single file and add then one by one
errorMsg = "Failed to insert replicas for: {} and block: {}".format(files, block)
errorMsg += " Some/all DIDs already exist in Rucio. Error: {}".format(str(exc))
self.logger.error(errorMsg)
except Exception as exc:
self.logger.error("Failed to add replicas for: %s and block: %s. Error: %s", files, block, str(exc))

if response:
files = [item['name'] for item in files]
Expand Down