Skip to content

Commit

Permalink
If an incremental backup will not save space, force the promotion of …
Browse files Browse the repository at this point in the history
…the backup
  • Loading branch information
opoplawski committed Apr 2, 2019
1 parent b2fd140 commit 79717f2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions server-src/planner.c
Original file line number Diff line number Diff line change
Expand Up @@ -2542,6 +2542,7 @@ static void analyze_estimate(
info_t info;
int have_info = 0;
char *qname = quote_string(dp->name);
one_est_t *l0ep;

g_fprintf(stderr, _("pondering %s:%s... "),
dp->host->hostname, qname);
Expand Down Expand Up @@ -2616,6 +2617,15 @@ static void analyze_estimate(
}
}

/* Make sure that the incremental really is smaller, protmote if not */
if (ep->dump_est->level > 0) {
l0ep = est_for_level(ep, 0);
if ((l0ep->nsize > 0) && ((l0ep->nsize - ep->dump_est->nsize) < (l0ep->nsize/1000))) {
ep->dump_est = l0ep;
g_fprintf(stderr,_(" incremental does not save space, promoting to level 0\n"));
}
}

if (ep->dump_est->level < 0) {
int i;
char *q = quote_string("no estimate");
Expand Down Expand Up @@ -2915,6 +2925,10 @@ static void delay_dumps(void)
delete = 1;
message = _("but no incremental estimate");
}
else if((ep->dump_est->nsize - ep->degr_est->nsize) < ((ep->dump_est->nsize/1000))) {
delete = 1;
message = _("but incremental does not save space");
}
else if (ep->degr_est->csize > tapetype_get_length(tape)) {
delete = 1;
message = _("incremental dump also larger than tape");
Expand Down

0 comments on commit 79717f2

Please sign in to comment.