Skip to content
Snippets Groups Projects
Commit 2bca03c6 authored by Eric Cano's avatar Eric Cano
Browse files

Added missing updating oldest reuest age in retrieve queue.

parent 8cb11574
No related branches found
No related tags found
No related merge requests found
......@@ -459,6 +459,13 @@ void RetrieveQueue::addJobsAndCommit(std::list<JobToAdd> & jobsToAdd, AgentRefer
maxDriveAllowedMap.incCount(j.policy.maxDrivesAllowed);
priorityMap.incCount(j.policy.retrievePriority);
minRetrieveRequestAgeMap.incCount(j.policy.retrieveMinRequestAge);
// oldestjobcreationtime is initialized to 0 when
if (m_payload.oldestjobcreationtime()) {
if ((uint64_t)j.startTime < m_payload.oldestjobcreationtime())
m_payload.set_oldestjobcreationtime(j.startTime);
} else {
m_payload.set_oldestjobcreationtime(j.startTime);
}
}
// ... update the shard pointer
auto shardSummary = rqs.getJobsSummary();
......
......@@ -76,6 +76,8 @@ TEST(ObjectStore, RetrieveQueueShardingAndOrderingTest) {
jta.retrieveRequestAddress = address.str();
jobsToAdd.push_back(jta);
}
// By construction, first job has lowest start time.
auto minStartTime=jobsToAdd.front().startTime;
std::string retrieveQueueAddress = agentRef.nextId("RetrieveQueue");
{
// Try to create the retrieve queue
......@@ -119,6 +121,7 @@ TEST(ObjectStore, RetrieveQueueShardingAndOrderingTest) {
ASSERT_NO_THROW(rq.fetch());
// Pop jobs while we can. They should come out in fseq order as there is
// no interleaved push and pop.
ASSERT_EQ(minStartTime, rq.getJobsSummary().oldestJobStartTime);
uint64_t nextExpectedFseq=0;
while (rq.getJobsSummary().files) {
auto candidateJobs = rq.getCandidateList(std::numeric_limits<uint64_t>::max(), 50, std::set<std::string>());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment