bareos icon indicating copy to clipboard operation
bareos copied to clipboard

Consolidation job ignores Next/Full Backup Pool

Open EBCEEB opened this issue 1 year ago • 6 comments

Bareos component version

23.0.3

Steps to reproduce

I have two storages for copy jobs, and two pools on each storage for consolidation jobs.

Storage {
  Name = storage-1
  Address = 10.x.x.11
  Password = ***
  Device = FileStorage1
  Device = FileStorage2
  Device = FileStorage3
  Device = FileStorage4
  Media Type = storage-1
  Maximum Concurrent Jobs = 4
}

Pool {
  Name = pool-1-1
  Next Pool = pool-2-1
  Storage = storage-1
}

Pool {
  Name = pool-1-2
  Next Pool = pool-2-2
  Storage = storage-1
Storage {
  Name = storage-2
  Address = 10.x.x.21
  Password = ***
  Device = FileStorage1
  Device = FileStorage2
  Device = FileStorage3
  Device = FileStorage4
  Media Type = storage-2
  Maximum Concurrent Jobs = 4
}

Pool {
  Name = pool-2-1
  Next Pool = pool-1-1
  Storage = storage-2
}

Pool {
  Name = pool-2-2
  Next Pool = pool-1-2
  Storage = storage-2

Next pools are defined as shown above for copy jobs, so I'm trying to define pools for consolidation job explicitly:

Job {
  Name = "Artifactory Backup"
  Type = Backup
  Client = atrifactory
  File Set = Artifactory

  Pool = pool-1-1
  Next Pool = pool-1-2
  Full Backup Pool =  pool-1-2

  Schedule = Daily
  Always Incremental = yes
  Accurate = yes
  Messages = Standard
}
Job {
  Name = "Artifactory-Consolidate"
  Type = "Consolidate"
  Client = atrifactory
  File Set = Artifactory

  Pool = pool-1-1
  Next Pool = pool-1-2
  Full Backup Pool = pool-1-2

  Schedule = Daily
  Priority = 100
  Accurate = yes
  Messages = Standard
}

Expected results

Successful consolidation + virtual full jobs reading from pool-1-1 and writing to pool-1-2

Actual results

Vitrual full job fails with error:

Director JobId 999: Fatal error:
Storage daemon didn't accept Device "FileStorage4" because:
3924 Device "FileStorage4" not in SD Device resources or no matching Media Type.

Job summary has line

Pool: "pool-2-1" (From Job Pool's NextPool resource)

Looks like Next Pool and Full Backup Pool defined in jobs are ignored.

Environment

- OS: `linux`
- component: Bareos dir, sd, fd = 23.0.3

Relevant log output

No response

Relevant traces output

No response

Anything else?

Manually configured virtual full job having

  Pool = pool-1-1
  Next Pool = pool-1-2

works fine

EBCEEB avatar Aug 13 '24 09:08 EBCEEB

Consolidation jobs are just administration jobs. The pool related configuration is taken from the job that is run as a virtualfull job.

You need to set the VirtualFullBackupPool configuration option in Artifactory Backup to achieve what you want to achieve.

If this does not work for you, feel free to reopen this issue.

sebsura avatar Aug 13 '24 09:08 sebsura

I've added Virtual Full Backup Pool = pool-1-2 to job Artifactory Backup, and got the same error.

I didn't new full/incremental backups (just updated job Artifactory Backup, reloaded config, and ran Artifactory-Consolidate) - is it matters?

EBCEEB avatar Aug 13 '24 10:08 EBCEEB

Tried one more time only having Next Pool = pool-1-2 in Artifactory Backup and it works.

I think you may close the issue. Looks like I missed something.

Sorry.

EBCEEB avatar Aug 13 '24 11:08 EBCEEB

ill leave this open as we actually found a bug: Currently it seems that the VirtuafFullBackupPool option of the Job resources aer getting ignored. Ill push a pr later today that will fix this and then this issue will get auto closed once the pr is merged

sebsura avatar Aug 13 '24 11:08 sebsura

Looks like Next Pool should work always:

https://github.com/bareos/bareos/blob/bdb86e83b4736033956f9d6ef1d1498cf43c0a40/core/src/dird/vbackup.cc#L171

EBCEEB avatar Aug 13 '24 11:08 EBCEEB

BTW it works even if Pool and Next Pool are the same. So there is no need to define an additional pool for consolidation jobs.

EBCEEB avatar Aug 13 '24 11:08 EBCEEB