Skip to content

Commit

Permalink
ua_run: remove allowmixedpriority override flag
Browse files Browse the repository at this point in the history
The AllowMixedPriority setting is now instead taken from the parent
consolidate job resource.
  • Loading branch information
SamuelBoerlin authored and arogge committed Oct 19, 2023
1 parent f990be9 commit 953582c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 26 deletions.
3 changes: 1 addition & 2 deletions core/src/dird/consolidate.cc
Expand Up @@ -69,10 +69,9 @@ static inline void StartNewConsolidationJob(const JobResource* consolidate_job,
ua->batch = true;
Mmsg(ua->cmd,
"run job=\"%s\" jobid=%s level=VirtualFull priority=%d accurate=%s "
"spooldata=%s allowmixedpriority=%s consolidatejob=%s",
"spooldata=%s consolidatejob=%s",
jobname, jcr->dir_impl->vf_jobids, jcr->JobPriority,
jcr->accurate ? "yes" : "no", jcr->dir_impl->spool_data ? "yes" : "no",
jcr->allow_mixed_priority ? "yes" : "no",
consolidate_job->resource_name_);

Dmsg1(debuglevel, "=============== consolidate cmd=%s\n", ua->cmd);
Expand Down
2 changes: 0 additions & 2 deletions core/src/dird/ua.h
Expand Up @@ -282,8 +282,6 @@ class RunContext {
bool nextpool_set = false;
bool accurate_set = false;
bool ignoreduplicatecheck_set = false;
bool allow_mixed_priority = false;
bool allow_mixed_priority_set = false;

RunContext();
~RunContext();
Expand Down
27 changes: 5 additions & 22 deletions core/src/dird/ua_run.cc
Expand Up @@ -992,15 +992,10 @@ static bool ResetRestoreContext(UaContext* ua,
jcr->dir_impl->IgnoreDuplicateJobChecking = rc.ignoreduplicatecheck;
}

/* 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;
}

/* If this is a virtualfull spawned by a consolidate job
* then the same rjs is used so that max concurrent jobs
* of the consolidate job applies.
* of the consolidate job applies. AllowMixedPriority is
* also inherited from consolidate job.
*/
if (rc.consolidate_job) {
if (!jcr->is_JobLevel(L_VIRTUAL_FULL)) {
Expand All @@ -1010,6 +1005,7 @@ static bool ResetRestoreContext(UaContext* ua,
}
jcr->dir_impl->res.rjs = rc.consolidate_job->rjs;
jcr->dir_impl->max_concurrent_jobs = rc.consolidate_job->MaxConcurrentJobs;
jcr->allow_mixed_priority = rc.consolidate_job->allow_mixed_priority;
}

return true;
Expand Down Expand Up @@ -1771,8 +1767,7 @@ static bool ScanCommandLineArguments(UaContext* ua, RunContext& rc)
"ignoreduplicatecheck", /* 29 */
"accurate", /* 30 */
"backupformat", /* 31 */
"allowmixedpriority", /* 32 */
"consolidatejob", /* 33 */
"consolidatejob", /* 32 - parent consolidate job */
NULL};

#define YES_POS 14
Expand Down Expand Up @@ -2060,19 +2055,7 @@ static bool ScanCommandLineArguments(UaContext* ua, RunContext& rc)
rc.backup_format = ua->argv[i];
kw_ok = true;
break;
case 32: /* allowmixedpriority */
if (rc.allow_mixed_priority_set) {
ua->SendMsg(_("AllowMixedPriority flag specified twice.\n"));
return false;
}
if (IsYesno(ua->argv[i], &rc.allow_mixed_priority)) {
rc.allow_mixed_priority_set = true;
kw_ok = true;
} else {
ua->SendMsg(_("Invalid AllowMixedPriority flag.\n"));
}
break;
case 33: /* consolidatejob */
case 32: /* consolidatejob */
if (rc.consolidate_job_name) {
ua->SendMsg(_("Consolidate Job specified twice.\n"));
return false;
Expand Down

0 comments on commit 953582c

Please sign in to comment.