1
0
Fork 0

Merge branch 'devel' of https://github.com/arangodb/arangodb into devel

This commit is contained in:
mpv1989 2017-04-11 15:58:59 +02:00
commit 2e8750fa33
13 changed files with 71 additions and 57 deletions

View File

@ -4,7 +4,7 @@
"author": "ArangoDB GmbH",
"description": "Official AQL manual for ArangoDB - the multi-model NoSQL database",
"language": "en",
"plugins":["-search", "-lunr", "-sharing", "toggle-chapters", "addcssjs", "anchorjs", "piwik", "sitemap-general", "ga"],
"plugins":["-search", "-lunr", "-sharing", "toggle-chapters", "addcssjs", "anchorjs", "sitemap-general", "ga"],
"pdf": {
"fontSize": 12,
"toc": true,
@ -23,10 +23,6 @@
"js": ["styles/header.js"],
"css": ["styles/header.css"]
},
"piwik": {
"URL": "www.arangodb.com/piwik/",
"siteId": 12
},
"sitemap-general": {
"prefix": "https://docs.arangodb.com/devel/AQL/"
},

View File

@ -4,7 +4,7 @@
"author": "ArangoDB GmbH",
"description": "Official HTTP API manual for ArangoDB - the multi-model NoSQL database",
"language": "en",
"plugins":["-search", "-lunr", "-sharing", "toggle-chapters", "addcssjs", "anchorjs", "piwik", "sitemap-general", "ga"],
"plugins":["-search", "-lunr", "-sharing", "toggle-chapters", "addcssjs", "anchorjs", "sitemap-general", "ga"],
"pdf": {
"fontSize": 12,
"toc": true,
@ -23,10 +23,6 @@
"js": ["styles/header.js"],
"css": ["styles/header.css"]
},
"piwik": {
"URL": "www.arangodb.com/piwik/",
"siteId": 12
},
"sitemap-general": {
"prefix": "https://docs.arangodb.com/devel/HTTP/"
},

View File

@ -4,7 +4,7 @@
"author": "ArangoDB GmbH",
"description": "Official manual for ArangoDB - the multi-model NoSQL database",
"language": "en",
"plugins":["-search", "-lunr", "-sharing", "toggle-chapters", "addcssjs", "anchorjs", "piwik", "sitemap-general", "ga", "callouts@git+https://github.com/Simran-B/gitbook-plugin-callouts.git"],
"plugins":["-search", "-lunr", "-sharing", "toggle-chapters", "addcssjs", "anchorjs", "sitemap-general", "ga", "callouts@git+https://github.com/Simran-B/gitbook-plugin-callouts.git"],
"pdf": {
"fontSize": 12,
"toc": true,
@ -23,10 +23,6 @@
"js": ["styles/header.js"],
"css": ["styles/header.css"]
},
"piwik": {
"URL": "www.arangodb.com/piwik/",
"siteId": 12
},
"sitemap-general": {
"prefix": "https://docs.arangodb.com/devel/Manual/"
},

View File

@ -103,14 +103,19 @@ int GatherBlock::shutdown(int errorCode) {
DEBUG_BEGIN_BLOCK();
// don't call default shutdown method since it does the wrong thing to
// _gatherBlockBuffer
int ret = TRI_ERROR_NO_ERROR;
for (auto it = _dependencies.begin(); it != _dependencies.end(); ++it) {
int res = (*it)->shutdown(errorCode);
if (res != TRI_ERROR_NO_ERROR) {
return res;
ret = res;
}
}
if (ret != TRI_ERROR_NO_ERROR) {
return ret;
}
if (!_isSimple) {
for (std::deque<AqlItemBlock*>& x : _gatherBlockBuffer) {
for (AqlItemBlock* y : x) {
@ -506,7 +511,7 @@ bool GatherBlock::OurLessThan::operator()(std::pair<size_t, size_t> const& a,
BlockWithClients::BlockWithClients(ExecutionEngine* engine,
ExecutionNode const* ep,
std::vector<std::string> const& shardIds)
: ExecutionBlock(engine, ep), _nrClients(shardIds.size()) {
: ExecutionBlock(engine, ep), _nrClients(shardIds.size()), _wasShutdown(false) {
_shardIdMap.reserve(_nrClients);
for (size_t i = 0; i < _nrClients; i++) {
_shardIdMap.emplace(std::make_pair(shardIds[i], i));
@ -542,7 +547,12 @@ int BlockWithClients::shutdown(int errorCode) {
_doneForClient.clear();
return ExecutionBlock::shutdown(errorCode);
if (_wasShutdown) {
return TRI_ERROR_NO_ERROR;
}
int res = ExecutionBlock::shutdown(errorCode);
_wasShutdown = true;
return res;
// cppcheck-suppress style
DEBUG_END_BLOCK();
@ -1371,20 +1381,22 @@ int RemoteBlock::initializeCursor(AqlItemBlock* items, size_t pos) {
int RemoteBlock::shutdown(int errorCode) {
DEBUG_BEGIN_BLOCK();
if (!_isResponsibleForInitializeCursor) {
// do nothing...
return TRI_ERROR_NO_ERROR;
}
// For every call we simply forward via HTTP
std::unique_ptr<ClusterCommResult> res =
sendRequest(rest::RequestType::PUT, "/_api/aql/shutdown/",
std::string("{\"code\":" + std::to_string(errorCode) + "}"));
try {
if (throwExceptionAfterBadSyncRequest(res.get(), true)) {
// artificially ignore error in case query was not found during shutdown
return TRI_ERROR_NO_ERROR;
}
} catch (arangodb::basics::Exception &ex) {
if (ex.code() == TRI_ERROR_CLUSTER_BACKEND_UNAVAILABLE) {
return TRI_ERROR_CLUSTER_BACKEND_UNAVAILABLE;
}
throw;
}
StringBuffer const& responseBodyBuf(res->result->getBody());
std::shared_ptr<VPackBuilder> builder =

View File

@ -194,6 +194,9 @@ class BlockWithClients : public ExecutionBlock {
/// @brief _doneForClient: the analogue of _done: _doneForClient.at(i) = true
/// if we are done for the shard with clientId = i
std::vector<bool> _doneForClient;
private:
bool _wasShutdown;
};
class ScatterBlock : public BlockWithClients {

View File

@ -1187,25 +1187,26 @@ struct CoordinatorInstanciator : public WalkerWorker<ExecutionNode> {
/// @brief shutdown, will be called exactly once for the whole query
int ExecutionEngine::shutdown(int errorCode) {
int res = TRI_ERROR_NO_ERROR;
if (_root != nullptr && !_wasShutdown) {
// Take care of locking prevention measures in the cluster:
if (_lockedShards != nullptr) {
if (CollectionLockState::_noLockHeaders == _lockedShards) {
CollectionLockState::_noLockHeaders = _previouslyLockedShards;
}
delete _lockedShards;
_lockedShards = nullptr;
_previouslyLockedShards = nullptr;
}
// prevent a duplicate shutdown
int res = _root->shutdown(errorCode);
_wasShutdown = true;
res = _root->shutdown(errorCode);
return res;
// prevent a duplicate shutdown
_wasShutdown = true;
}
return TRI_ERROR_NO_ERROR;
return res;
}
/// @brief create an execution engine from a plan

View File

@ -884,6 +884,9 @@ QueryResultV8 Query::executeV8(v8::Isolate* isolate, QueryRegistry* registry) {
}
}
} catch (...) {
LOG_TOPIC(DEBUG, Logger::QUERIES) << TRI_microtime() - _startTime << " "
<< "got an exception executing "
<< " this: " << (uintptr_t) this;
delete value;
throw;
}

View File

@ -562,11 +562,12 @@
return;
}
var self = this;
if (!this.collectionsView) {
if (this.collectionsView) {
this.collectionsView.remove();
}
this.collectionsView = new window.CollectionsView({
collection: this.arangoCollectionsStore
});
}
this.arangoCollectionsStore.fetch({
cache: false,
success: function () {

View File

@ -106,7 +106,7 @@
<div id="collectionsThumbnailsIn" class="tileList pure-g">
<div class="tile pure-u-1-1 pure-u-sm-1-2 pure-u-md-1-3 pure-u-lg-1-4 pure-u-xl-1-6">
<div class="fullBorderBox">
<a href="#" id="createCollection" class="add"><span id="newCollection" class="pull-left add-Icon"><i class="fa fa-plus-circle"></i>
<a id="createCollection" class="add"><span id="newCollection" class="pull-left add-Icon"><i class="fa fa-plus-circle"></i>
</span> Add Collection</a>
</div>
</div>

View File

@ -54,7 +54,7 @@
<div id="userManagementThumbnailsIn" class="tileList pure-u">
<div class="tile pure-u-1-1 pure-u-sm-1-2 pure-u-md-1-3 pure-u-lg-1-4 pure-u-xl-1-6">
<div class="fullBorderBox">
<a href="#" id="createUser" class="add">
<a id="createUser" class="add">
<span id="newUser" class="pull-left add-Icon"><i class="fa fa-plus-circle"></i></span>
Add User
</a>

View File

@ -13,6 +13,14 @@
template: templateEngine.createTemplate('collectionsView.ejs'),
remove: function () {
this.$el.empty().off(); /* off to unbind the events */
this.stopListening();
this.unbind();
delete this.el;
return this;
},
refetchCollections: function () {
var self = this;
this.collection.fetch({

View File

@ -992,6 +992,9 @@ function updateCurrentForCollections(localErrors, currentCollections) {
Object.assign(agencyIndex, index);
// Fix up the IDs of the indexes:
let pos = index.id.indexOf("/");
if (agencyIndex.hasOwnProperty("selectivityEstimate")) {
delete agencyIndex.selectivityEstimate;
}
if (pos >= 0) {
agencyIndex.id = index.id.slice(pos+1);
} else {

View File

@ -525,7 +525,10 @@ static std::string GetEndpointFromUrl(std::string const& url) {
size_t slashes = 0;
while (p < e) {
if (*p == '/') {
if (*p == '?') {
// http(s)://example.com?foo=bar
return url.substr(0, p - url.c_str());
} else if (*p == '/') {
if (++slashes == 3) {
return url.substr(0, p - url.c_str());
}
@ -777,33 +780,25 @@ void JS_Download(v8::FunctionCallbackInfo<v8::Value> const& args) {
std::string relative;
if (url.substr(0, 7) == "http://") {
size_t found = url.find('/', 7);
endpoint = GetEndpointFromUrl(url).substr(7);
relative = url.substr(7 + endpoint.length());
relative = "/";
if (found != std::string::npos) {
relative.append(url.substr(found + 1));
endpoint = url.substr(7, found - 7);
} else {
endpoint = url.substr(7);
if (relative.empty() || relative[0] != '/') {
relative = "/" + relative;
}
found = endpoint.find(":");
if (found == std::string::npos) {
endpoint = endpoint + ":80";
if (endpoint.find(':') == std::string::npos) {
endpoint.append(":80");
}
endpoint = "tcp://" + endpoint;
} else if (url.substr(0, 8) == "https://") {
size_t found = url.find('/', 8);
endpoint = GetEndpointFromUrl(url).substr(8);
relative = url.substr(8 + endpoint.length());
relative = "/";
if (found != std::string::npos) {
relative.append(url.substr(found + 1));
endpoint = url.substr(8, found - 8);
} else {
endpoint = url.substr(8);
if (relative.empty() || relative[0] != '/') {
relative = "/" + relative;
}
found = endpoint.find(":");
if (found == std::string::npos) {
endpoint = endpoint + ":443";
if (endpoint.find(':') == std::string::npos) {
endpoint.append(":443");
}
endpoint = "ssl://" + endpoint;
} else if (url.substr(0, 6) == "srv://") {