bareos icon indicating copy to clipboard operation
bareos copied to clipboard

NextPool in Job Resource does not work

Open AlexanderS opened this issue 1 year ago • 5 comments
trafficstars

Bareos component version

23.0.3~pre121.285f8d75b

Steps to reproduce

I have a Job that is overwriting the NextPool from the Pool resource. But if the job is run from bconsole the NextPool from the Pool is used. If I overwrite the NextPool in the run command, it is working as expected:

Job {
  Name = Offsite1
  JobDefs = Defaults

  Type = Copy
  Level = Full

  Pool = Longterm
  Next Pool = Offsite1
}

Pool {
  Name = Longterm
  Pool Type = Backup
 
  Storage = Longterm
  NextPool = Tape-Longterm
  [...]
}
*run job=Offsite1
Automatically selected Catalog: Catalog
Using Catalog "Catalog"
Run Copy job
JobName:       Offsite1
Bootstrap:     *None*
Read Storage:  Longterm (From Pool resource)
Pool:          Longterm (From Job resource)
Write Storage: LTO-3 (From Storage from Run NextPool override)
NextPool:      Tape-Longterm (From unknown source)
JobId:         *None*
When:          2024-05-27 13:51:08
Catalog:       Catalog
*run job=Offsite1 nextpool=Offsite1
Run Copy job
JobName:       Offsite1
Bootstrap:     *None*
Read Storage:  Longterm (From Pool resource)
Pool:          Longterm (From Job resource)
Write Storage: Offsite1 (From Storage from Run NextPool override)
NextPool:      Offsite1 (From command line)
JobId:         *None*
When:          2024-05-27 13:51:47
Catalog:       Catalog

I suspect that the error is here: https://github.com/bareos/bareos/blob/master/core/src/dird/ua_run.cc#L845 because it is only checking if the next pool is different from the value of the pool.

Expected results

NextPool from the job should be used.

Actual results

NextPool from the job is ignored.

Environment

No response

Relevant log output

No response

Relevant traces output

No response

Anything else?

No response

AlexanderS avatar May 27 '24 11:05 AlexanderS

The view is wrong, do you tried to run the job ? It should normally respect the nextpool definition even if not shown. We also welcome PR with fixing code :-)

bruno-at-bareos avatar May 28 '24 10:05 bruno-at-bareos

Already reported in Internal OP#5577

As a user of Bareos I would want to see the "next pool override" in the summary of the job I want to start. XX report that they define a new next pool parameter in a virtual full job, but when doing the run job command the override is not shown in the job summary.

While it is a deceptive experience for the end user, the job finally will use the defined option. Here's an example where the storage is correctly determined but not the pool which should be similar

*run job=vf_archives_month
Using Catalog "mycatalog"
Run Backup job
JobName:  vf_archives_month
Level:    VirtualFull
Client:   yoda-fd
Format:   Native
FileSet:  _empty
Pool:     ai_consolidated (From Job resource)
NextPool: vf_archives (From unknown source)
Storage:  vf_archives (From Storage from Run NextPool override)
When:     2023-11-20 11:25:12
Priority: 12
OK to run? (yes/mod/no): no
Job not run.
*run job=vf_ioda_month
Run Backup job
JobName:  vf_ioda_month
Level:    VirtualFull
Client:   yoda-fd
Format:   Native
FileSet:  ioda
Pool:     ai_consolidated (From Job resource)
NextPool: vf_archives (From unknown source)
Storage:  vf_archives (From Storage from Run NextPool override)
When:     2023-11-20 11:25:28
Priority: 12
OK to run? (yes/mod/no): .
Job not run.
*show job=vf_ioda_month
Job {
  Name = "vf_ioda_month"
  Type = Backup
  Level = VirtualFull
  Messages = "standard"
  Pool = "ai_consolidated"
  VirtualFullBackupPool = "vf_archives"
  Client = "yoda-fd"
  FileSet = "ioda"
  Schedule = "vf_archives_month"
  JobDefs = "default_jobdef"
  Priority = 12
  RunScript {
    Console = "update jobid=%i jobtype=A"
    RunsWhen = "after"
  }
  Accurate = Yes
  AllowDuplicateJobs = No
  CancelLowerLevelDuplicates = Yes
  CancelQueuedDuplicates = Yes
}

*show pool=ai_consolidated
Pool {
  Name = "ai_consolidated"
  Description = "AI consolidated"
  LabelFormat = "ai_cons-"
  MaximumVolumes = 500
  MaximumVolumeJobs = 12
  VolumeRetention = 3 years
  VolumeUseDuration = 23 hours
  NextPool = "vf_archives"
  Storage = "ai_storage"
  FileRetention = 3 years
  JobRetention = 3 years
}

*show pool=vf_archives
Pool {
  Name = "vf_archives"
  Description = "VF Archives Virtual Fulls"
  LabelFormat = "vf_archives-"
  MaximumVolumes = 16
  MaximumVolumeBytes = 1 t 776 g
  VolumeRetention = 3 months 2 weeks 1 days
  VolumeUseDuration = 1 days
  Storage = "vf_archives"
  FileRetention = 4 months
  JobRetention = 4 months
}

bruno-at-bareos avatar May 28 '24 13:05 bruno-at-bareos

@AlexanderS would you check if this is indeed just a display problem in the job summary? Thank you!

arogge avatar Jun 06 '24 09:06 arogge

@AlexanderS any updates ?

sebsura avatar Jun 17 '24 11:06 sebsura

Yes it seems to be only a problem of the preview. But nonetheless I will prepare a PR to fix this issue in the following days.

AlexanderS avatar Jun 21 '24 19:06 AlexanderS

@AlexanderS don't forget to mention this issue in your PR.

bruno-at-bareos avatar Jul 01 '24 12:07 bruno-at-bareos

closing not answering nor proposing a PR

bruno-at-bareos avatar Jul 18 '24 09:07 bruno-at-bareos