Commit b17b4f41 authored by Leigh Stoller's avatar Leigh Stoller

Bug fix; when doing a replay the datastore checkout comes from the

instance being replayed, not the template itself.
parent 654ddbe5
......@@ -2692,9 +2692,9 @@ sub ArchiveTag($$)
#
# Copy the datastore from the template down to the instance. Temporary ...
#
sub CopyDataStore($$$)
sub CopyDataStore($$$;$)
{
my ($self, $archive_tag, $to_path) = @_;
my ($self, $archive_tag, $to_path, $replay_instance) = @_;
# Must be a real reference.
return -1
......@@ -2702,8 +2702,10 @@ sub CopyDataStore($$$)
# From the template itself.
my $exptidx;
TBExptIDX($self->template()->pid(), $self->template()->eid(), \$exptidx)
my $instance = (defined($replay_instance) ? $replay_instance : $self);
TBExptIDX($instance->template()->pid(),
$instance->template()->eid(), \$exptidx)
or return -1;
if (! -e $to_path) {
......@@ -2711,6 +2713,8 @@ sub CopyDataStore($$$)
or return -1;
}
libArchive::setdebug(2);
libArchive::TBCheckoutExperimentArchivebyExptIDX($exptidx,
$to_path,
$archive_tag,
......
......@@ -539,7 +539,7 @@ if (defined($replay_instance)) {
print "Checking out a copy of the template datastore ($datastore_tag)\n";
$instance->CopyDataStore($datastore_tag,
"$instance_path/datastore") == 0
"$instance_path/datastore", $replay_instance) == 0
or fatal(-1, "Could not copy datastore to instance");
# Ditto for dynamic events.
......
......@@ -539,7 +539,7 @@ if (defined($replay_instance)) {
print "Checking out a copy of the template datastore ($datastore_tag)\n";
$instance->CopyDataStore($datastore_tag,
"$instance_path/datastore") == 0
"$instance_path/datastore", $replay_instance) == 0
or fatal(-1, "Could not copy datastore to instance");
# Ditto for dynamic events.
......
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