Commit 91d58e2f authored by Leigh B Stoller's avatar Leigh B Stoller

If the snapshot fails when creating a new imdataset, be sure to clean

up at the remote cluster.
parent c13c4c14
...@@ -354,8 +354,17 @@ sub DoCreate() ...@@ -354,8 +354,17 @@ sub DoCreate()
if ($type eq "imdataset" && if ($type eq "imdataset" &&
DoSnapShotInternal($dataset, $aggregate, DoSnapShotInternal($dataset, $aggregate,
$bsname, $nodeid, \$errmsg)) { $bsname, $nodeid, \$errmsg)) {
$response = $dataset->DeleteDataset();
if ($response->code() == GENIRESPONSE_SUCCESS ||
$response->code() == GENIRESPONSE_SEARCHFAILED) {
$instance->Unlock();
goto failed;
}
# We want to keep the local dataset record around since we could
# not delete it remotely.
$instance->Unlock(); $instance->Unlock();
goto failed; # This will set the webtask, see below.
fatal($errmsg);
} }
if (PollDatasetStatus($dataset, \$errmsg)) { if (PollDatasetStatus($dataset, \$errmsg)) {
# Exit and let child poll # Exit and let child poll
......
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