Skip to content

Commit

Permalink
F #6333: Parse INCREMENT_MODE in backup jobs
Browse files Browse the repository at this point in the history
Attribute was not copied to backup config nor parsed
  • Loading branch information
rsmontero committed Nov 22, 2023
1 parent af6591e commit 20fcf95
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/vm/BackupJob.cc
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,10 @@ void BackupJob::get_backup_config(Template &tmpl)
/* - BACKUP_VOLATILE */
/* - FS_FREEZE */
/* - MODE */
/* - INCREMENT_MODE */
/* ---------------------------------------------------------------------- */
static vector<string> CONFIG_ATTRIBUTES = { "KEEP_LAST", "BACKUP_VOLATILE",
"FS_FREEZE", "MODE"};
"FS_FREEZE", "MODE", "INCREMENT_MODE"};

string tmp_str;
VectorAttribute* va = new VectorAttribute("BACKUP_CONFIG");
Expand Down Expand Up @@ -579,6 +580,25 @@ int BackupJob::parse(string& error)

add_template_attribute("MODE", sattr);

if ( sattr == "INCREMENT" )
{
if ( erase_template_attribute("INCREMENT_MODE", sattr) == 0 || sattr.empty() )
{
sattr = "CBT";
}
else
{
one_util::toupper(sattr);

if ((sattr != "CBT") && (sattr != "SNAPSHOT"))
{
sattr = "CBT";
}
}

add_template_attribute("INCREMENT_MODE", sattr);
}

erase_template_attribute("EXECUTION", sattr);

Execution exec = str_to_execution(sattr);
Expand Down

0 comments on commit 20fcf95

Please sign in to comment.