For I/O preserving reasons that aren't really relevant to the list, I've
temporarily had my backup server on MaxBackups = 1 for a couple of weeks.
 I also have a backup client that is on a tightly restricted BlackoutPeriod
of 8.0 through 23.9 (allowing backups from 23:59 through 08:00).

The combination of these two things has resulted in the blackout server
never receiving an automatically queued backup for two straight weeks.
We're back to regular MaxBackups now, and the other server will return to
unrestricted hours soon, but I thought I'd bring this up in case there's a
design problem with the scheduler that can be addressed.

This is my guess about what's going on ... I assume someone in here knows
more than I do about the scheduler and can correct or confirm my
assumptions.

When BackupPC does a wakeup it adds every host to the queue, and doesn't
appear to apply any kind of sorting (is it explicitly random order?).  When
the server gets under MaxBackups and decides to start a new backup, it
appears to iterate over the current queue in the order listed, discarding
hosts that are not due for backups at all as it finds them.  The first host
it finds that is due for a backup of any kind, it starts the backup and
removes that host from the queue.  If it encounters a host that is due for
backup but in blackout, it discards/removes that host as if it were not due
for backup.

The end result is that a server that has a blackout period might never get
a backup, because the server will only execute a backup for it if, outside
of its blackout period, there are no servers ahead of it in the queue that
are due for backup.  The problem does not require that there be too many
backups to complete in a single BackupNightlyPeriod.  All it needs is for
there to be enough servers for there to be a low probability of a server
with a blackout period randomly appearing near the top of the queue outside
its blackout hours.

Assuming I'm right about the mechanisms in play, there are two fixes I can
think of (one can be changed in two places):
1a. hosts are added to the queue in reverse order of their "Last Backup
(days)" value from the Host Summary (larger numbers first).
1b. backuppc processes the queue in Last Backup order, larger numbers first.
2. when picking from the queue, hosts that are due for backup but in
blackout are skipped without being removed, leaving them in their queue
position

Thoughts?  Am I completely off base?
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/

Reply via email to