Skip to content
Permalink
Browse files

stored: do not write duplicate SOS during MAC run

Fixes #1030: bscan does not work for migration and copy jobs

Previously when running a migrate, copy or virtual full backup the
resulting volume contained not one but two SOS records. The newly
generated one and the original one.

This patch now makes sure that only the newly generated SOS record is
written to the destination volume.
This patch also makes sure that the fields job_name, client_name,
fileset_name and fileset_md5 are written in the new SOS.
  • Loading branch information...
arogge committed Apr 10, 2019
1 parent 1ac932c commit 1e9af0fbc6b67c9ea738c62c2792ffd410e87062
Showing with 10 additions and 11 deletions.
  1. +10 −11 core/src/stored/mac.cc
@@ -146,13 +146,16 @@ static bool CloneRecordInternally(DeviceControlRecord* dcr, DeviceRecord* rec)

UnserSessionLabel(label, rec);

/*
* set job info from first SOS label
*/
if (jcr->is_JobType(JT_MIGRATE) || jcr->is_JobType(JT_COPY)) {
bstrncpy(jcr->Job, label->Job, sizeof(jcr->Job));
PmStrcpy(jcr->job_name, label->JobName);
PmStrcpy(jcr->client_name, label->ClientName);
PmStrcpy(jcr->fileset_name, label->FileSetName);
PmStrcpy(jcr->fileset_md5, label->FileSetMD5);
}
jcr->setJobType(label->JobType);
jcr->setJobLevel(label->JobLevel);
Dmsg1(200, "joblevel from SOS_LABEL is now %c\n", label->JobLevel);
bstrncpy(jcr->Job, label->Job, sizeof(jcr->Job));

if (label->VerNum >= 11) {
jcr->sched_time = BtimeToUnix(label->write_btime);
@@ -176,15 +179,11 @@ static bool CloneRecordInternally(DeviceControlRecord* dcr, DeviceRecord* rec)
}
} else {
Dmsg0(200, "Found additional SOS_LABEL, ignoring! \n");
retval = true;
goto bail_out;
}

} else {
/* Other label than SOS -> skip */
retval = true;
goto bail_out;
}
/* Other label than SOS -> skip */
retval = true;
goto bail_out;
}

/*

0 comments on commit 1e9af0f

Please sign in to comment.
You can’t perform that action at this time.