mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/arangodb/arangodb into devel
This commit is contained in:
commit
2e8750fa33
|
@ -4,7 +4,7 @@
|
||||||
"author": "ArangoDB GmbH",
|
"author": "ArangoDB GmbH",
|
||||||
"description": "Official AQL manual for ArangoDB - the multi-model NoSQL database",
|
"description": "Official AQL manual for ArangoDB - the multi-model NoSQL database",
|
||||||
"language": "en",
|
"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": {
|
"pdf": {
|
||||||
"fontSize": 12,
|
"fontSize": 12,
|
||||||
"toc": true,
|
"toc": true,
|
||||||
|
@ -23,10 +23,6 @@
|
||||||
"js": ["styles/header.js"],
|
"js": ["styles/header.js"],
|
||||||
"css": ["styles/header.css"]
|
"css": ["styles/header.css"]
|
||||||
},
|
},
|
||||||
"piwik": {
|
|
||||||
"URL": "www.arangodb.com/piwik/",
|
|
||||||
"siteId": 12
|
|
||||||
},
|
|
||||||
"sitemap-general": {
|
"sitemap-general": {
|
||||||
"prefix": "https://docs.arangodb.com/devel/AQL/"
|
"prefix": "https://docs.arangodb.com/devel/AQL/"
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"author": "ArangoDB GmbH",
|
"author": "ArangoDB GmbH",
|
||||||
"description": "Official HTTP API manual for ArangoDB - the multi-model NoSQL database",
|
"description": "Official HTTP API manual for ArangoDB - the multi-model NoSQL database",
|
||||||
"language": "en",
|
"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": {
|
"pdf": {
|
||||||
"fontSize": 12,
|
"fontSize": 12,
|
||||||
"toc": true,
|
"toc": true,
|
||||||
|
@ -23,10 +23,6 @@
|
||||||
"js": ["styles/header.js"],
|
"js": ["styles/header.js"],
|
||||||
"css": ["styles/header.css"]
|
"css": ["styles/header.css"]
|
||||||
},
|
},
|
||||||
"piwik": {
|
|
||||||
"URL": "www.arangodb.com/piwik/",
|
|
||||||
"siteId": 12
|
|
||||||
},
|
|
||||||
"sitemap-general": {
|
"sitemap-general": {
|
||||||
"prefix": "https://docs.arangodb.com/devel/HTTP/"
|
"prefix": "https://docs.arangodb.com/devel/HTTP/"
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"author": "ArangoDB GmbH",
|
"author": "ArangoDB GmbH",
|
||||||
"description": "Official manual for ArangoDB - the multi-model NoSQL database",
|
"description": "Official manual for ArangoDB - the multi-model NoSQL database",
|
||||||
"language": "en",
|
"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": {
|
"pdf": {
|
||||||
"fontSize": 12,
|
"fontSize": 12,
|
||||||
"toc": true,
|
"toc": true,
|
||||||
|
@ -23,10 +23,6 @@
|
||||||
"js": ["styles/header.js"],
|
"js": ["styles/header.js"],
|
||||||
"css": ["styles/header.css"]
|
"css": ["styles/header.css"]
|
||||||
},
|
},
|
||||||
"piwik": {
|
|
||||||
"URL": "www.arangodb.com/piwik/",
|
|
||||||
"siteId": 12
|
|
||||||
},
|
|
||||||
"sitemap-general": {
|
"sitemap-general": {
|
||||||
"prefix": "https://docs.arangodb.com/devel/Manual/"
|
"prefix": "https://docs.arangodb.com/devel/Manual/"
|
||||||
},
|
},
|
||||||
|
|
|
@ -103,14 +103,19 @@ int GatherBlock::shutdown(int errorCode) {
|
||||||
DEBUG_BEGIN_BLOCK();
|
DEBUG_BEGIN_BLOCK();
|
||||||
// don't call default shutdown method since it does the wrong thing to
|
// don't call default shutdown method since it does the wrong thing to
|
||||||
// _gatherBlockBuffer
|
// _gatherBlockBuffer
|
||||||
|
int ret = TRI_ERROR_NO_ERROR;
|
||||||
for (auto it = _dependencies.begin(); it != _dependencies.end(); ++it) {
|
for (auto it = _dependencies.begin(); it != _dependencies.end(); ++it) {
|
||||||
int res = (*it)->shutdown(errorCode);
|
int res = (*it)->shutdown(errorCode);
|
||||||
|
|
||||||
if (res != TRI_ERROR_NO_ERROR) {
|
if (res != TRI_ERROR_NO_ERROR) {
|
||||||
return res;
|
ret = res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ret != TRI_ERROR_NO_ERROR) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
if (!_isSimple) {
|
if (!_isSimple) {
|
||||||
for (std::deque<AqlItemBlock*>& x : _gatherBlockBuffer) {
|
for (std::deque<AqlItemBlock*>& x : _gatherBlockBuffer) {
|
||||||
for (AqlItemBlock* y : x) {
|
for (AqlItemBlock* y : x) {
|
||||||
|
@ -506,7 +511,7 @@ bool GatherBlock::OurLessThan::operator()(std::pair<size_t, size_t> const& a,
|
||||||
BlockWithClients::BlockWithClients(ExecutionEngine* engine,
|
BlockWithClients::BlockWithClients(ExecutionEngine* engine,
|
||||||
ExecutionNode const* ep,
|
ExecutionNode const* ep,
|
||||||
std::vector<std::string> const& shardIds)
|
std::vector<std::string> const& shardIds)
|
||||||
: ExecutionBlock(engine, ep), _nrClients(shardIds.size()) {
|
: ExecutionBlock(engine, ep), _nrClients(shardIds.size()), _wasShutdown(false) {
|
||||||
_shardIdMap.reserve(_nrClients);
|
_shardIdMap.reserve(_nrClients);
|
||||||
for (size_t i = 0; i < _nrClients; i++) {
|
for (size_t i = 0; i < _nrClients; i++) {
|
||||||
_shardIdMap.emplace(std::make_pair(shardIds[i], i));
|
_shardIdMap.emplace(std::make_pair(shardIds[i], i));
|
||||||
|
@ -542,7 +547,12 @@ int BlockWithClients::shutdown(int errorCode) {
|
||||||
|
|
||||||
_doneForClient.clear();
|
_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
|
// cppcheck-suppress style
|
||||||
DEBUG_END_BLOCK();
|
DEBUG_END_BLOCK();
|
||||||
|
@ -1371,20 +1381,22 @@ int RemoteBlock::initializeCursor(AqlItemBlock* items, size_t pos) {
|
||||||
int RemoteBlock::shutdown(int errorCode) {
|
int RemoteBlock::shutdown(int errorCode) {
|
||||||
DEBUG_BEGIN_BLOCK();
|
DEBUG_BEGIN_BLOCK();
|
||||||
|
|
||||||
if (!_isResponsibleForInitializeCursor) {
|
|
||||||
// do nothing...
|
|
||||||
return TRI_ERROR_NO_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
// For every call we simply forward via HTTP
|
// For every call we simply forward via HTTP
|
||||||
|
|
||||||
std::unique_ptr<ClusterCommResult> res =
|
std::unique_ptr<ClusterCommResult> res =
|
||||||
sendRequest(rest::RequestType::PUT, "/_api/aql/shutdown/",
|
sendRequest(rest::RequestType::PUT, "/_api/aql/shutdown/",
|
||||||
std::string("{\"code\":" + std::to_string(errorCode) + "}"));
|
std::string("{\"code\":" + std::to_string(errorCode) + "}"));
|
||||||
|
try {
|
||||||
if (throwExceptionAfterBadSyncRequest(res.get(), true)) {
|
if (throwExceptionAfterBadSyncRequest(res.get(), true)) {
|
||||||
// artificially ignore error in case query was not found during shutdown
|
// artificially ignore error in case query was not found during shutdown
|
||||||
return TRI_ERROR_NO_ERROR;
|
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());
|
StringBuffer const& responseBodyBuf(res->result->getBody());
|
||||||
std::shared_ptr<VPackBuilder> builder =
|
std::shared_ptr<VPackBuilder> builder =
|
||||||
|
|
|
@ -194,6 +194,9 @@ class BlockWithClients : public ExecutionBlock {
|
||||||
/// @brief _doneForClient: the analogue of _done: _doneForClient.at(i) = true
|
/// @brief _doneForClient: the analogue of _done: _doneForClient.at(i) = true
|
||||||
/// if we are done for the shard with clientId = i
|
/// if we are done for the shard with clientId = i
|
||||||
std::vector<bool> _doneForClient;
|
std::vector<bool> _doneForClient;
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool _wasShutdown;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ScatterBlock : public BlockWithClients {
|
class ScatterBlock : public BlockWithClients {
|
||||||
|
|
|
@ -1187,25 +1187,26 @@ struct CoordinatorInstanciator : public WalkerWorker<ExecutionNode> {
|
||||||
|
|
||||||
/// @brief shutdown, will be called exactly once for the whole query
|
/// @brief shutdown, will be called exactly once for the whole query
|
||||||
int ExecutionEngine::shutdown(int errorCode) {
|
int ExecutionEngine::shutdown(int errorCode) {
|
||||||
|
int res = TRI_ERROR_NO_ERROR;
|
||||||
if (_root != nullptr && !_wasShutdown) {
|
if (_root != nullptr && !_wasShutdown) {
|
||||||
// Take care of locking prevention measures in the cluster:
|
// Take care of locking prevention measures in the cluster:
|
||||||
if (_lockedShards != nullptr) {
|
if (_lockedShards != nullptr) {
|
||||||
if (CollectionLockState::_noLockHeaders == _lockedShards) {
|
if (CollectionLockState::_noLockHeaders == _lockedShards) {
|
||||||
CollectionLockState::_noLockHeaders = _previouslyLockedShards;
|
CollectionLockState::_noLockHeaders = _previouslyLockedShards;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete _lockedShards;
|
delete _lockedShards;
|
||||||
_lockedShards = nullptr;
|
_lockedShards = nullptr;
|
||||||
_previouslyLockedShards = nullptr;
|
_previouslyLockedShards = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// prevent a duplicate shutdown
|
res = _root->shutdown(errorCode);
|
||||||
int res = _root->shutdown(errorCode);
|
|
||||||
_wasShutdown = true;
|
|
||||||
|
|
||||||
return res;
|
// prevent a duplicate shutdown
|
||||||
|
_wasShutdown = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRI_ERROR_NO_ERROR;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief create an execution engine from a plan
|
/// @brief create an execution engine from a plan
|
||||||
|
|
|
@ -884,6 +884,9 @@ QueryResultV8 Query::executeV8(v8::Isolate* isolate, QueryRegistry* registry) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
|
LOG_TOPIC(DEBUG, Logger::QUERIES) << TRI_microtime() - _startTime << " "
|
||||||
|
<< "got an exception executing "
|
||||||
|
<< " this: " << (uintptr_t) this;
|
||||||
delete value;
|
delete value;
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
|
@ -562,11 +562,12 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var self = this;
|
var self = this;
|
||||||
if (!this.collectionsView) {
|
if (this.collectionsView) {
|
||||||
|
this.collectionsView.remove();
|
||||||
|
}
|
||||||
this.collectionsView = new window.CollectionsView({
|
this.collectionsView = new window.CollectionsView({
|
||||||
collection: this.arangoCollectionsStore
|
collection: this.arangoCollectionsStore
|
||||||
});
|
});
|
||||||
}
|
|
||||||
this.arangoCollectionsStore.fetch({
|
this.arangoCollectionsStore.fetch({
|
||||||
cache: false,
|
cache: false,
|
||||||
success: function () {
|
success: function () {
|
||||||
|
|
|
@ -106,7 +106,7 @@
|
||||||
<div id="collectionsThumbnailsIn" class="tileList pure-g">
|
<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="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">
|
<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>
|
</span> Add Collection</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
<div id="userManagementThumbnailsIn" class="tileList pure-u">
|
<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="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">
|
<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>
|
<span id="newUser" class="pull-left add-Icon"><i class="fa fa-plus-circle"></i></span>
|
||||||
Add User
|
Add User
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -13,6 +13,14 @@
|
||||||
|
|
||||||
template: templateEngine.createTemplate('collectionsView.ejs'),
|
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 () {
|
refetchCollections: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
this.collection.fetch({
|
this.collection.fetch({
|
||||||
|
|
|
@ -992,6 +992,9 @@ function updateCurrentForCollections(localErrors, currentCollections) {
|
||||||
Object.assign(agencyIndex, index);
|
Object.assign(agencyIndex, index);
|
||||||
// Fix up the IDs of the indexes:
|
// Fix up the IDs of the indexes:
|
||||||
let pos = index.id.indexOf("/");
|
let pos = index.id.indexOf("/");
|
||||||
|
if (agencyIndex.hasOwnProperty("selectivityEstimate")) {
|
||||||
|
delete agencyIndex.selectivityEstimate;
|
||||||
|
}
|
||||||
if (pos >= 0) {
|
if (pos >= 0) {
|
||||||
agencyIndex.id = index.id.slice(pos+1);
|
agencyIndex.id = index.id.slice(pos+1);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -525,7 +525,10 @@ static std::string GetEndpointFromUrl(std::string const& url) {
|
||||||
size_t slashes = 0;
|
size_t slashes = 0;
|
||||||
|
|
||||||
while (p < e) {
|
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) {
|
if (++slashes == 3) {
|
||||||
return url.substr(0, p - url.c_str());
|
return url.substr(0, p - url.c_str());
|
||||||
}
|
}
|
||||||
|
@ -777,33 +780,25 @@ void JS_Download(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
||||||
std::string relative;
|
std::string relative;
|
||||||
|
|
||||||
if (url.substr(0, 7) == "http://") {
|
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 (relative.empty() || relative[0] != '/') {
|
||||||
if (found != std::string::npos) {
|
relative = "/" + relative;
|
||||||
relative.append(url.substr(found + 1));
|
|
||||||
endpoint = url.substr(7, found - 7);
|
|
||||||
} else {
|
|
||||||
endpoint = url.substr(7);
|
|
||||||
}
|
}
|
||||||
found = endpoint.find(":");
|
if (endpoint.find(':') == std::string::npos) {
|
||||||
if (found == std::string::npos) {
|
endpoint.append(":80");
|
||||||
endpoint = endpoint + ":80";
|
|
||||||
}
|
}
|
||||||
endpoint = "tcp://" + endpoint;
|
endpoint = "tcp://" + endpoint;
|
||||||
} else if (url.substr(0, 8) == "https://") {
|
} 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 (relative.empty() || relative[0] != '/') {
|
||||||
if (found != std::string::npos) {
|
relative = "/" + relative;
|
||||||
relative.append(url.substr(found + 1));
|
|
||||||
endpoint = url.substr(8, found - 8);
|
|
||||||
} else {
|
|
||||||
endpoint = url.substr(8);
|
|
||||||
}
|
}
|
||||||
found = endpoint.find(":");
|
if (endpoint.find(':') == std::string::npos) {
|
||||||
if (found == std::string::npos) {
|
endpoint.append(":443");
|
||||||
endpoint = endpoint + ":443";
|
|
||||||
}
|
}
|
||||||
endpoint = "ssl://" + endpoint;
|
endpoint = "ssl://" + endpoint;
|
||||||
} else if (url.substr(0, 6) == "srv://") {
|
} else if (url.substr(0, 6) == "srv://") {
|
||||||
|
|
Loading…
Reference in New Issue