Skip to content

Commit

Permalink
consolidate: inherit spool_data flag
Browse files Browse the repository at this point in the history
make virtualfull jobs spawned by consolidate job inherit spool_data flag
  • Loading branch information
SamuelBoerlin authored and arogge committed Oct 19, 2023
1 parent 330acc5 commit 6713989
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
5 changes: 3 additions & 2 deletions core/src/dird/consolidate.cc
Expand Up @@ -68,9 +68,10 @@ static inline void StartNewConsolidationJob(JobControlRecord* jcr,
ua->batch = true;
Mmsg(ua->cmd,
"run job=\"%s\" jobid=%s level=VirtualFull priority=%d accurate=%s "
"allowmixedpriority=%s",
"spooldata=%s allowmixedpriority=%s",
jobname, jcr->dir_impl->vf_jobids, jcr->JobPriority,
jcr->accurate ? "yes" : "no", jcr->allow_mixed_priority ? "yes" : "no");
jcr->accurate ? "yes" : "no", jcr->dir_impl->spool_data ? "yes" : "no",
jcr->allow_mixed_priority ? "yes" : "no");

Dmsg1(debuglevel, "=============== consolidate cmd=%s\n", ua->cmd);
ParseUaArgs(ua); /* parse command */
Expand Down
4 changes: 2 additions & 2 deletions core/src/dird/ua_run.cc
Expand Up @@ -992,8 +992,8 @@ static bool ResetRestoreContext(UaContext* ua,
jcr->dir_impl->IgnoreDuplicateJobChecking = rc.ignoreduplicatecheck;
}

// Used by consolidate jobs to make spawned virtualfulls inherit the
// AllowMixedPriority flag
/* Used by consolidate jobs to make spawned virtualfulls inherit the
* AllowMixedPriority flag */
if (rc.allow_mixed_priority_set) {
jcr->allow_mixed_priority = rc.allow_mixed_priority;
}
Expand Down
Expand Up @@ -9,4 +9,5 @@ Job {
Cancel Running Duplicates = no
Allow Mixed Priority = yes
Priority = 20
Spool Data = no
}
Expand Up @@ -10,6 +10,7 @@ Job {
AlwaysIncrementalMaxFullAge = 1 seconds
Allow Mixed Priority = no
Priority = 10
Spool Data = yes # Enabling spooling to test consolidate Spool Data = no override
Run Script {
Command = "sleep 5"
Runs When = Before
Expand Down
6 changes: 5 additions & 1 deletion systemtests/tests/always-incremental-consolidate/testrunner
Expand Up @@ -182,7 +182,7 @@ wait job=$JobNameLowPriority
messages
@$out $tmp/priorities1.out
list jobs
@$out /dev/null
@$out $tmp/spooling.out
wait
messages
@$out $tmp/priorities2.out
Expand Down Expand Up @@ -234,4 +234,8 @@ expect_grep "|.*26.*|.*${JobNameHighPriority}.*|.*T.*|" \
"$tmp"/priorities2.out \
"spawned low priority consolidate job was not successful."

expect_not_grep "Spooling data" \
"$tmp"/spooling.out \
"spawned low priority consolidate job is spooling unexpectedly."

end_test

0 comments on commit 6713989

Please sign in to comment.