Commit 20512afd authored by Leigh B. Stoller's avatar Leigh B. Stoller

Attempt to fix the problem with commit and the datastore directory. I

think the problem is that the archive is forked for a template
instance, but not committed before the first savepoint. This screws up
the archive cause the datastore directory has not been copied in yet,
and subversion pukes.
parent 1c7f1563
......@@ -692,20 +692,23 @@ libArchive::TBExperimentArchiveAddUserFiles($pid, $eid) == 0
or fatal("Failed to add user archive files to the archive!");
#
# Do a SavePoint on the experiment files.
# Do a SavePoint on the experiment files. In template mode, let the wrapper
# deal with this. Avoids duplication of work.
#
print "Doing a savepoint on the experiment archive ...\n";
if (libArchive::TBExperimentArchiveSavePoint($pid, $eid, "startexp") < 0) {
fatal({type => 'secondary', severity => SEV_SECONDARY,
error => ['archive_op_failed', 'savepoint', undef, undef]},
"Failed to do a savepoint on the experiment archive!");
if (! $template_mode) {
print "Doing a savepoint on the experiment archive ...\n";
if (libArchive::TBExperimentArchiveSavePoint($pid, $eid, "startexp") < 0) {
fatal({type => 'secondary', severity => SEV_SECONDARY,
error => ['archive_op_failed', 'savepoint', undef, undef]},
"Failed to do a savepoint on the experiment archive!");
}
}
#
# If this is a branch, then do a commit. Otherwise, the archive looks
# wrong cause its a branch from the original and shows all those files.
#
if ($copybranch) {
if ($copybranch && !$template_mode) {
print "Doing a commit on the experiment archive ...\n";
libArchive::TBCommitExperimentArchive($pid, $eid, "branch_merge") == 0 or
fatal({type => 'secondary', severity => SEV_SECONDARY,
......
......@@ -1197,17 +1197,21 @@ if ($inout eq "modify") {
}
#
# Do a SavePoint on the experiment files.
# Do a SavePoint on the experiment files. For both of these archive
# operations, skip if in template mode; we have too many tags building
# up from too many operations. Leave it to the wrapper script.
#
print "Doing a savepoint on the experiment archive ...\n";
if (libArchive::TBExperimentArchiveSavePoint($pid, $eid, $tag) < 0) {
fatal({type => 'secondary', severity => SEV_SECONDARY,
error => ['archive_op_failed', 'savepoint', undef, undef]},
"Failed to do a savepoint on the experiment archive!");
if (! $template_mode) {
print "Doing a savepoint on the experiment archive ...\n";
if (libArchive::TBExperimentArchiveSavePoint($pid, $eid, $tag) < 0) {
fatal({type => 'secondary', severity => SEV_SECONDARY,
error => ['archive_op_failed', 'savepoint', undef, undef]},
"Failed to do a savepoint on the experiment archive!");
}
}
# Commit the archive after swapout
if ($inout eq "out") {
if ($inout eq "out" && !$template_mode) {
print "Doing a commit on the experiment archive ...\n";
libArchive::TBCommitExperimentArchive($pid, $eid, $tag) == 0 or
fatal({type => 'secondary', severity => SEV_SECONDARY,
......
......@@ -102,6 +102,7 @@ my $batchexp = "$TB/bin/batchexp";
my $swapexp = "$TB/bin/swapexp";
my $endexp = "$TB/bin/endexp";
my $dbcontrol = "$TB/sbin/opsdb_control";
my $archcontrol = "$TB/bin/archive_control";
# Protos
sub ParseArgs();
......@@ -614,6 +615,15 @@ if ($batchmode) {
done:
}
#
# Lets commit the experiment archive now that it is active. The experiment is
# already running, but thats not a big deal.
#
system("$archcontrol -t instantiate commit $pid $eid");
if ($?) {
fatal(-1, "Could not commit archive!");
}
#
# All instances currently start with a default run.
#
......
......@@ -102,6 +102,7 @@ my $batchexp = "$TB/bin/batchexp";
my $swapexp = "$TB/bin/swapexp";
my $endexp = "$TB/bin/endexp";
my $dbcontrol = "$TB/sbin/opsdb_control";
my $archcontrol = "$TB/bin/archive_control";
# Protos
sub ParseArgs();
......@@ -614,6 +615,15 @@ if ($batchmode) {
done:
}
#
# Lets commit the experiment archive now that it is active. The experiment is
# already running, but thats not a big deal.
#
system("$archcontrol -t instantiate commit $pid $eid");
if ($?) {
fatal(-1, "Could not commit archive!");
}
#
# All instances currently start with a default run.
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment