Skip to content

Commit

Permalink
wait until restore task queue is idle before shutting down (arangodb#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jsteemann authored Aug 3, 2020
1 parent 141a000 commit 295bfae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
devel
-----

* Wait until restore task queue is idle before shutting down.

* Fix a race problem in the unit tests w.r.t. PlanSyncer.

* Always fetch data for /_api/cluster/agency-dump from leader of the agency.
Expand Down
15 changes: 8 additions & 7 deletions arangosh/Restore/RestoreFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -650,25 +650,24 @@ arangodb::Result restoreIndexes(arangodb::httpclient::SimpleHttpClient& httpClie
using arangodb::Logger;

arangodb::Result result{};
VPackSlice const parameters = jobData.collection.get("parameters");
VPackSlice const indexes = jobData.collection.get("indexes");
// re-create indexes
if (indexes.length() > 0) {
// we actually have indexes
if (jobData.options.progress) {
std::string const cname =
arangodb::basics::VelocyPackHelper::getStringValue(parameters, "name",

VPackSlice const parameters = jobData.collection.get("parameters");

std::string const cname =
arangodb::basics::VelocyPackHelper::getStringValue(parameters, "name",
"");
if (jobData.options.progress) {
LOG_TOPIC("d88c6", INFO, Logger::RESTORE)
<< "# Creating indexes for collection '" << cname << "'...";
}

result = ::sendRestoreIndexes(httpClient, jobData.options, jobData.collection);

if (result.fail()) {
std::string const cname =
arangodb::basics::VelocyPackHelper::getStringValue(parameters, "name",
"");
if (jobData.options.force) {
LOG_TOPIC("db937", WARN, Logger::RESTORE)
<< "Error while creating indexes for collection '" << cname
Expand Down Expand Up @@ -1779,6 +1778,8 @@ void RestoreFeature::start() {
result = {TRI_ERROR_INTERNAL};
}

_clientTaskQueue.waitForIdle();

if (result.fail()) {
break;
}
Expand Down

0 comments on commit 295bfae

Please sign in to comment.