Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
8b4da39d
Commit
8b4da39d
authored
Jun 21, 2017
by
Eric Cano
Browse files
Fixed failure to requeue archive request on failure when no archive queue is present.
This was implemented using the previously created Helpers.
parent
721c5a54
Changes
1
Hide whitespace changes
Inline
Side-by-side
scheduler/OStoreDB/OStoreDB.cpp
View file @
8b4da39d
...
...
@@ -25,6 +25,7 @@
#include
"objectstore/DriveRegister.hpp"
#include
"objectstore/ArchiveRequest.hpp"
#include
"objectstore/RetrieveRequest.hpp"
#include
"objectstore/Helpers.hpp"
#include
"common/exception/Exception.hpp"
#include
"common/admin/AdminHost.hpp"
#include
"common/admin/AdminUser.hpp"
...
...
@@ -2144,38 +2145,28 @@ void OStoreDB::ArchiveJob::fail() {
return
;
}
// The job still has a chance, return it to its original tape pool's queue
objectstore
::
RootEntry
re
(
m_objectStore
);
objectstore
::
ScopedSharedLock
rel
(
re
);
re
.
fetch
();
auto
aql
=
re
.
dumpArchiveQueues
();
rel
.
release
();
for
(
auto
&
aqp
:
aql
)
{
if
(
aqp
.
tapePool
==
m_tapePool
)
{
objectstore
::
ArchiveQueue
aq
(
aqp
.
address
,
m_objectStore
);
objectstore
::
ScopedExclusiveLock
aqlock
(
aq
);
aq
.
fetch
();
// Find the right job
auto
jl
=
m_archiveRequest
.
dumpJobs
();
for
(
auto
&
j
:
jl
)
{
if
(
j
.
copyNb
==
tapeFile
.
copyNb
)
{
aq
.
addJobIfNecessary
(
j
,
m_archiveRequest
.
getAddressIfSet
(),
m_archiveRequest
.
getArchiveFile
().
archiveFileID
,
m_archiveRequest
.
getArchiveFile
().
fileSize
,
m_archiveRequest
.
getMountPolicy
(),
m_archiveRequest
.
getEntryLog
().
time
);
aq
.
commit
();
aqlock
.
release
();
// We have a pointer to the job, we can change the job ownership
m_archiveRequest
.
setJobOwner
(
tapeFile
.
copyNb
,
aqp
.
address
);
m_archiveRequest
.
commit
();
arl
.
release
();
// We just have to remove the ownership from the agent and we're done.
m_agentReference
.
removeFromOwnership
(
m_archiveRequest
.
getAddressIfSet
(),
m_objectStore
);
m_jobOwned
=
false
;
return
;
}
}
throw
NoSuchJob
(
"In OStoreDB::ArchiveJob::fail(): could not find the job in the request object"
);
objectstore
::
ArchiveQueue
aq
(
m_objectStore
);
objectstore
::
ScopedExclusiveLock
aqlock
;
objectstore
::
Helpers
::
getLockedAndFetchedArchiveQueue
(
aq
,
aqlock
,
m_agentReference
,
m_tapePool
);
// Find the right job
auto
jl
=
m_archiveRequest
.
dumpJobs
();
for
(
auto
&
j
:
jl
)
{
if
(
j
.
copyNb
==
tapeFile
.
copyNb
)
{
aq
.
addJobIfNecessary
(
j
,
m_archiveRequest
.
getAddressIfSet
(),
m_archiveRequest
.
getArchiveFile
().
archiveFileID
,
m_archiveRequest
.
getArchiveFile
().
fileSize
,
m_archiveRequest
.
getMountPolicy
(),
m_archiveRequest
.
getEntryLog
().
time
);
aq
.
commit
();
aqlock
.
release
();
// We have a pointer to the job, we can change the job ownership
m_archiveRequest
.
setJobOwner
(
tapeFile
.
copyNb
,
aq
.
getAddressIfSet
());
m_archiveRequest
.
commit
();
arl
.
release
();
// We just have to remove the ownership from the agent and we're done.
m_agentReference
.
removeFromOwnership
(
m_archiveRequest
.
getAddressIfSet
(),
m_objectStore
);
m_jobOwned
=
false
;
return
;
}
}
throw
NoSuch
ArchiveQueue
(
"In OStoreDB::ArchiveJob::fail(): could not find the
tape pool
"
);
throw
NoSuch
Job
(
"In OStoreDB::ArchiveJob::fail(): could not find the
job in the request object
"
);
}
//------------------------------------------------------------------------------
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment