mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/arangodb/arangodb into devel
This commit is contained in:
commit
d5b35baac8
|
@ -1,6 +1,11 @@
|
||||||
devel
|
devel
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
* UI: document/edge editor now remembering their modes (e.g. code or tree)
|
||||||
|
|
||||||
|
* UI: optimized error messages for invalid graph definitions. Also fixed a
|
||||||
|
graph renderer cleanrenderer cleanup error.
|
||||||
|
|
||||||
* UI: added a delay within the graph viewer while changing the colors of the
|
* UI: added a delay within the graph viewer while changing the colors of the
|
||||||
graph. Necessary due different browser behaviour.
|
graph. Necessary due different browser behaviour.
|
||||||
|
|
||||||
|
|
|
@ -287,8 +287,8 @@ AQL supports expressing simple numeric ranges with the *..* operator.
|
||||||
This operator can be used to easily iterate over a sequence of numeric
|
This operator can be used to easily iterate over a sequence of numeric
|
||||||
values.
|
values.
|
||||||
|
|
||||||
The *..* operator will produce an array of values in the defined range, with
|
The *..* operator will produce an array of the integer values in the
|
||||||
both bounding values included.
|
defined range, with both bounding values included.
|
||||||
|
|
||||||
*Examples*
|
*Examples*
|
||||||
|
|
||||||
|
@ -302,6 +302,11 @@ will produce the following result:
|
||||||
[ 2010, 2011, 2012, 2013 ]
|
[ 2010, 2011, 2012, 2013 ]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Using the range operator is equivalent to writing an array with the integer
|
||||||
|
values in the range specified by the bounds of the range. If the bounds of
|
||||||
|
the range operator are non-integers, they will be converted to integer
|
||||||
|
values first.
|
||||||
|
|
||||||
There is also a [RANGE() function](Functions/Numeric.md#range).
|
There is also a [RANGE() function](Functions/Numeric.md#range).
|
||||||
|
|
||||||
#### Array operators
|
#### Array operators
|
||||||
|
|
|
@ -6,5 +6,5 @@ for API developers. As a user or administrator of ArangoDB you should
|
||||||
not need the information provided herein.
|
not need the information provided herein.
|
||||||
|
|
||||||
In general, as a user of ArangoDB you will use one of the language
|
In general, as a user of ArangoDB you will use one of the language
|
||||||
[drivers](https://www.arangodb.com).
|
[drivers](https://www.arangodb.com/drivers/).
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,16 @@ The implementation tries to follow the CommonJS
|
||||||
[Filesystem/A/0](http://wiki.commonjs.org/wiki/Filesystem/A/0)
|
[Filesystem/A/0](http://wiki.commonjs.org/wiki/Filesystem/A/0)
|
||||||
specification where possible.
|
specification where possible.
|
||||||
|
|
||||||
|
Working Directory
|
||||||
|
-----------------
|
||||||
|
The directory functions below shouldn't use the current working directory of the server like `.` or `./test`.
|
||||||
|
You will not be able to tell whether the environment the server is running in will permit directory listing,
|
||||||
|
reading or writing of files.
|
||||||
|
|
||||||
|
You should either base your directories with `getTempPath()`, or as a foxx service use the
|
||||||
|
[module.context.basePath](../..//Foxx/Context.md).
|
||||||
|
|
||||||
|
|
||||||
Single File Directory Manipulation
|
Single File Directory Manipulation
|
||||||
----------------------------------
|
----------------------------------
|
||||||
|
|
||||||
|
|
|
@ -373,11 +373,27 @@ creating the file `/etc/sysctl.d/corepattern.conf` (or add the following lines t
|
||||||
kernel.core_uses_pid = 1
|
kernel.core_uses_pid = 1
|
||||||
kernel.core_pattern = /var/tmp/core-%e-%p-%t
|
kernel.core_pattern = /var/tmp/core-%e-%p-%t
|
||||||
|
|
||||||
Note that the `proc` paths translate sub-directories to dots. The non permanent way of doing this in a running system is:
|
to reload the above settings most systems support:
|
||||||
|
|
||||||
|
sudo sysctl -p
|
||||||
|
|
||||||
|
Note that the `proc` paths translate sub-directories to dots.
|
||||||
|
The non permanent way of doing this in a running system is:
|
||||||
|
|
||||||
echo 1 > /proc/sys/kernel/core_uses_pid
|
echo 1 > /proc/sys/kernel/core_uses_pid
|
||||||
echo '/var/tmp/core-%e-%p-%t' > /proc/sys/kernel/core_pattern
|
echo '/var/tmp/core-%e-%p-%t' > /proc/sys/kernel/core_pattern
|
||||||
|
|
||||||
|
(you may also inspect these files to validate the current settings)
|
||||||
|
|
||||||
|
More modern systems facilitate [`systemd-coredump`](https://www.freedesktop.org/software/systemd/man/systemd-coredump.html) (via a similar named package) to controll coredumps.
|
||||||
|
On most systems it will put compressed coredumps to `/var/lib/systemd/coredump`.
|
||||||
|
|
||||||
|
In order to use automatic coredump analysis with the unittests you need to configure
|
||||||
|
`/etc/systemd/coredump.conf` and set `Compress=no` - so instant analysis may take place.
|
||||||
|
|
||||||
|
Please note that we can't support [Ubuntu Apport](https://wiki.ubuntu.com/Apport).
|
||||||
|
Please use `apport-unpack` to send us the bare coredumps.
|
||||||
|
|
||||||
Solaris Coredumps
|
Solaris Coredumps
|
||||||
=================
|
=================
|
||||||
Solaris configures the system corefile behaviour via the `coreadm` programm.
|
Solaris configures the system corefile behaviour via the `coreadm` programm.
|
||||||
|
|
|
@ -1334,13 +1334,31 @@ void AgencyComm::updateEndpoints(arangodb::velocypack::Slice const& current) {
|
||||||
|
|
||||||
AgencyCommResult AgencyComm::sendWithFailover(
|
AgencyCommResult AgencyComm::sendWithFailover(
|
||||||
arangodb::rest::RequestType method, double const timeout,
|
arangodb::rest::RequestType method, double const timeout,
|
||||||
std::string const& initialUrl, VPackSlice body,
|
std::string const& initialUrl, VPackSlice inBody,
|
||||||
std::string const& clientId) {
|
std::string clientId) {
|
||||||
|
|
||||||
std::string endpoint;
|
std::string endpoint;
|
||||||
std::unique_ptr<GeneralClientConnection> connection =
|
std::unique_ptr<GeneralClientConnection> connection =
|
||||||
AgencyCommManager::MANAGER->acquire(endpoint);
|
AgencyCommManager::MANAGER->acquire(endpoint);
|
||||||
|
|
||||||
|
std::vector<std::string> clientIds;
|
||||||
|
clientId = "";
|
||||||
|
VPackSlice body = inBody.resolveExternals();
|
||||||
|
|
||||||
|
if (body.isArray()) {
|
||||||
|
for (auto const& query : VPackArrayIterator(body)) {
|
||||||
|
if (query.length() == 3 && query[0].isObject() && query[2].isString()) {
|
||||||
|
auto const id = query[2].copyString();
|
||||||
|
if (!id.empty()) {
|
||||||
|
if (!clientIds.empty()) {
|
||||||
|
clientId += " ";
|
||||||
|
}
|
||||||
|
clientIds.push_back(id);
|
||||||
|
clientId +=id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
AgencyCommResult result;
|
AgencyCommResult result;
|
||||||
std::string url;
|
std::string url;
|
||||||
|
|
||||||
|
@ -1430,6 +1448,15 @@ AgencyCommResult AgencyComm::sendWithFailover(
|
||||||
url = initialUrl; // Attention: overwritten by redirect below!
|
url = initialUrl; // Attention: overwritten by redirect below!
|
||||||
result = send(connection.get(), method, conTimeout, url, bodyString,
|
result = send(connection.get(), method, conTimeout, url, bodyString,
|
||||||
clientId);
|
clientId);
|
||||||
|
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||||
|
if (!clientIds.empty()) {
|
||||||
|
if (clientIds[0] == "INTEGRATION_TEST_INQUIRY_ERROR_0") {
|
||||||
|
result._statusCode = 0;
|
||||||
|
} else if (clientIds[0] == "INTEGRATION_TEST_INQUIRY_ERROR_503") {
|
||||||
|
result._statusCode = 503;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
// Rotate to new agent endpoint:
|
// Rotate to new agent endpoint:
|
||||||
AgencyCommManager::MANAGER->failed(std::move(connection), endpoint);
|
AgencyCommManager::MANAGER->failed(std::move(connection), endpoint);
|
||||||
|
@ -1456,7 +1483,7 @@ AgencyCommResult AgencyComm::sendWithFailover(
|
||||||
// the operation. If it actually was done, we are good. If not, we
|
// the operation. If it actually was done, we are good. If not, we
|
||||||
// can retry. If in doubt, we have to retry inquire until the global
|
// can retry. If in doubt, we have to retry inquire until the global
|
||||||
// timeout is reached.
|
// timeout is reached.
|
||||||
if (!clientId.empty() && result._sent &&
|
if (!clientIds.empty() && result._sent &&
|
||||||
(result._statusCode == 0 || result._statusCode == 503)) {
|
(result._statusCode == 0 || result._statusCode == 503)) {
|
||||||
isInquiry = true;
|
isInquiry = true;
|
||||||
}
|
}
|
||||||
|
@ -1468,14 +1495,14 @@ AgencyCommResult AgencyComm::sendWithFailover(
|
||||||
// the transaction lead to isInquiry == true because we got a timeout
|
// the transaction lead to isInquiry == true because we got a timeout
|
||||||
// or a 503.
|
// or a 503.
|
||||||
VPackBuilder b;
|
VPackBuilder b;
|
||||||
{
|
{ VPackArrayBuilder ab(&b);
|
||||||
VPackArrayBuilder ab(&b);
|
for (auto const& i : clientIds) {
|
||||||
b.add(VPackValue(clientId));
|
b.add(VPackValue(i));
|
||||||
}
|
}}
|
||||||
|
|
||||||
LOG_TOPIC(DEBUG, Logger::AGENCYCOMM) <<
|
LOG_TOPIC(DEBUG, Logger::AGENCYCOMM) <<
|
||||||
"Failed agency comm (" << result._statusCode << ")! " <<
|
"Failed agency comm (" << result._statusCode << ")! " <<
|
||||||
"Inquiring about clientId " << clientId << ".";
|
"Inquiring about clientIds " << clientId << ".";
|
||||||
|
|
||||||
url = "/_api/agency/inquire"; // attention: overwritten by redirect!
|
url = "/_api/agency/inquire"; // attention: overwritten by redirect!
|
||||||
result = send(
|
result = send(
|
||||||
|
@ -1499,7 +1526,11 @@ AgencyCommResult AgencyComm::sendWithFailover(
|
||||||
if (outer.isObject() && outer.hasKey("results")) {
|
if (outer.isObject() && outer.hasKey("results")) {
|
||||||
VPackSlice results = outer.get("results");
|
VPackSlice results = outer.get("results");
|
||||||
if (results.length() > 0) {
|
if (results.length() > 0) {
|
||||||
|
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||||
|
LOG_TOPIC(WARN, Logger::AGENCYCOMM)
|
||||||
|
#else
|
||||||
LOG_TOPIC(DEBUG, Logger::AGENCYCOMM)
|
LOG_TOPIC(DEBUG, Logger::AGENCYCOMM)
|
||||||
|
#endif
|
||||||
<< "Inquired " << resultBody->toJson();
|
<< "Inquired " << resultBody->toJson();
|
||||||
AgencyCommManager::MANAGER->release(std::move(connection), endpoint);
|
AgencyCommManager::MANAGER->release(std::move(connection), endpoint);
|
||||||
break;
|
break;
|
||||||
|
@ -1511,7 +1542,7 @@ AgencyCommResult AgencyComm::sendWithFailover(
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// How odd, we are supposed to get at least [[]], let's retry...
|
// How odd, we are supposed to get at least {results=[...]}, let's retry...
|
||||||
isInquiry = false;
|
isInquiry = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -685,7 +685,7 @@ class AgencyComm {
|
||||||
|
|
||||||
AgencyCommResult sendWithFailover(arangodb::rest::RequestType, double,
|
AgencyCommResult sendWithFailover(arangodb::rest::RequestType, double,
|
||||||
std::string const&, VPackSlice,
|
std::string const&, VPackSlice,
|
||||||
std::string const& clientId = std::string());
|
std::string clientId = std::string());
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool lock(std::string const&, double, double,
|
bool lock(std::string const&, double, double,
|
||||||
|
|
|
@ -914,7 +914,6 @@ bool State::loadRemaining() {
|
||||||
// Dummy fill missing entries (Not good at all.)
|
// Dummy fill missing entries (Not good at all.)
|
||||||
index_t index(basics::StringUtils::uint64(
|
index_t index(basics::StringUtils::uint64(
|
||||||
ii.get(StaticStrings::KeyString).copyString()));
|
ii.get(StaticStrings::KeyString).copyString()));
|
||||||
term_t term(ii.get("term").getNumber<uint64_t>());
|
|
||||||
|
|
||||||
// Ignore log entries, which are older than lastIndex:
|
// Ignore log entries, which are older than lastIndex:
|
||||||
if (index >= lastIndex) {
|
if (index >= lastIndex) {
|
||||||
|
@ -925,6 +924,7 @@ bool State::loadRemaining() {
|
||||||
std::make_shared<Buffer<uint8_t>>();
|
std::make_shared<Buffer<uint8_t>>();
|
||||||
VPackSlice value = arangodb::basics::VelocyPackHelper::EmptyObjectValue();
|
VPackSlice value = arangodb::basics::VelocyPackHelper::EmptyObjectValue();
|
||||||
buf->append(value.startAs<char const>(), value.byteSize());
|
buf->append(value.startAs<char const>(), value.byteSize());
|
||||||
|
term_t term(ii.get("term").getNumber<uint64_t>());
|
||||||
for (index_t i = lastIndex+1; i < index; ++i) {
|
for (index_t i = lastIndex+1; i < index; ++i) {
|
||||||
LOG_TOPIC(WARN, Logger::AGENCY) << "Missing index " << i << " in RAFT log.";
|
LOG_TOPIC(WARN, Logger::AGENCY) << "Missing index " << i << " in RAFT log.";
|
||||||
_log.push_back(log_t(i, term, buf, std::string()));
|
_log.push_back(log_t(i, term, buf, std::string()));
|
||||||
|
|
|
@ -57,7 +57,7 @@ struct HealthRecord {
|
||||||
|
|
||||||
HealthRecord(
|
HealthRecord(
|
||||||
std::string const& sn, std::string const& ep, std::string const& ho) :
|
std::string const& sn, std::string const& ep, std::string const& ho) :
|
||||||
shortName(sn), endpoint(ep), hostId(ho) {}
|
shortName(sn), endpoint(ep), hostId(ho), version(0) {}
|
||||||
|
|
||||||
HealthRecord(Node const& node) {
|
HealthRecord(Node const& node) {
|
||||||
*this = node;
|
*this = node;
|
||||||
|
@ -105,6 +105,7 @@ struct HealthRecord {
|
||||||
status = other.status;
|
status = other.status;
|
||||||
endpoint = other.endpoint;
|
endpoint = other.endpoint;
|
||||||
hostId = other.hostId;
|
hostId = other.hostId;
|
||||||
|
version = other.version;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -275,7 +275,7 @@ static void JS_APIAgency(std::string const& envelope,
|
||||||
v8::HandleScope scope(isolate);
|
v8::HandleScope scope(isolate);
|
||||||
|
|
||||||
if (args.Length() < 1) {
|
if (args.Length() < 1) {
|
||||||
TRI_V8_THROW_EXCEPTION_USAGE("read([[...]])");
|
TRI_V8_THROW_EXCEPTION_USAGE(std::string(envelope) + "([[...]])");
|
||||||
}
|
}
|
||||||
|
|
||||||
VPackBuilder builder;
|
VPackBuilder builder;
|
||||||
|
|
|
@ -126,7 +126,7 @@ void RocksDBEdgeIndexIterator::reset() {
|
||||||
|
|
||||||
bool RocksDBEdgeIndexIterator::next(LocalDocumentIdCallback const& cb, size_t limit) {
|
bool RocksDBEdgeIndexIterator::next(LocalDocumentIdCallback const& cb, size_t limit) {
|
||||||
TRI_ASSERT(_trx->state()->isRunning());
|
TRI_ASSERT(_trx->state()->isRunning());
|
||||||
#ifdef USE_MAINTAINER_MODE
|
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||||
TRI_ASSERT(limit > 0); // Someone called with limit == 0. Api broken
|
TRI_ASSERT(limit > 0); // Someone called with limit == 0. Api broken
|
||||||
#else
|
#else
|
||||||
// Gracefully return in production code
|
// Gracefully return in production code
|
||||||
|
@ -229,7 +229,7 @@ bool RocksDBEdgeIndexIterator::next(LocalDocumentIdCallback const& cb, size_t li
|
||||||
bool RocksDBEdgeIndexIterator::nextExtra(ExtraCallback const& cb,
|
bool RocksDBEdgeIndexIterator::nextExtra(ExtraCallback const& cb,
|
||||||
size_t limit) {
|
size_t limit) {
|
||||||
TRI_ASSERT(_trx->state()->isRunning());
|
TRI_ASSERT(_trx->state()->isRunning());
|
||||||
#ifdef USE_MAINTAINER_MODE
|
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||||
TRI_ASSERT(limit > 0); // Someone called with limit == 0. Api broken
|
TRI_ASSERT(limit > 0); // Someone called with limit == 0. Api broken
|
||||||
#else
|
#else
|
||||||
// Gracefully return in production code
|
// Gracefully return in production code
|
||||||
|
@ -843,7 +843,7 @@ void RocksDBEdgeIndex::warmupInternal(transaction::Methods* trx,
|
||||||
: transaction::helpers::extractFromFromDocument(doc);
|
: transaction::helpers::extractFromFromDocument(doc);
|
||||||
TRI_ASSERT(toFrom.isString());
|
TRI_ASSERT(toFrom.isString());
|
||||||
builder.add(toFrom);
|
builder.add(toFrom);
|
||||||
#ifdef USE_MAINTAINER_MODE
|
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||||
} else {
|
} else {
|
||||||
// Data Inconsistency.
|
// Data Inconsistency.
|
||||||
// We have a revision id without a document...
|
// We have a revision id without a document...
|
||||||
|
|
|
@ -348,7 +348,12 @@ authRouter.get('/graph/:name', function (req, res) {
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
var graph = gm._graph(name);
|
var graph;
|
||||||
|
try {
|
||||||
|
graph = gm._graph(name);
|
||||||
|
} catch (e) {
|
||||||
|
res.throw('bad request', e.errorMessage);
|
||||||
|
}
|
||||||
|
|
||||||
var verticesCollections = graph._vertexCollections();
|
var verticesCollections = graph._vertexCollections();
|
||||||
if (!verticesCollections || verticesCollections.length === 0) {
|
if (!verticesCollections || verticesCollections.length === 0) {
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
'click #document-to': 'navigateToDocument',
|
'click #document-to': 'navigateToDocument',
|
||||||
'keydown #documentEditor .ace_editor': 'keyPress',
|
'keydown #documentEditor .ace_editor': 'keyPress',
|
||||||
'keyup .jsoneditor .search input': 'checkSearchBox',
|
'keyup .jsoneditor .search input': 'checkSearchBox',
|
||||||
'click .jsoneditor .modes': 'storeMode',
|
|
||||||
'click #addDocument': 'addDocument'
|
'click #addDocument': 'addDocument'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -63,14 +62,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
storeMode: function () {
|
storeMode: function (mode) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
localStorage.setItem('JSONEditorMode', mode);
|
||||||
$('.type-modes').on('click', function (elem) {
|
self.defaultMode = mode;
|
||||||
var mode = $(elem.currentTarget).text().toLowerCase();
|
self.editor.setMode(this.defaultMode);
|
||||||
localStorage.setItem('JSONEditorMode', mode);
|
|
||||||
self.defaultMode = mode;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
keyPress: function (e) {
|
keyPress: function (e) {
|
||||||
|
@ -222,6 +218,9 @@
|
||||||
onChange: function () {
|
onChange: function () {
|
||||||
self.jsonContentChanged();
|
self.jsonContentChanged();
|
||||||
},
|
},
|
||||||
|
onModeChange: function (newMode) {
|
||||||
|
self.storeMode(newMode);
|
||||||
|
},
|
||||||
search: true,
|
search: true,
|
||||||
mode: 'tree',
|
mode: 'tree',
|
||||||
modes: ['tree', 'code'],
|
modes: ['tree', 'code'],
|
||||||
|
@ -230,6 +229,10 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
this.editor = new JSONEditor(container, options);
|
this.editor = new JSONEditor(container, options);
|
||||||
|
var testMode = localStorage.getItem('JSONEditorMode');
|
||||||
|
if (testMode === 'code' || testMode === 'tree') {
|
||||||
|
this.defaultMode = testMode;
|
||||||
|
}
|
||||||
if (this.defaultMode) {
|
if (this.defaultMode) {
|
||||||
this.editor.setMode(this.defaultMode);
|
this.editor.setMode(this.defaultMode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -276,12 +276,14 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
killCurrentGraph: function () {
|
killCurrentGraph: function () {
|
||||||
for (var i in this.currentGraph.renderers) {
|
if (this.currentGraph && this.currentGraph.renderers) {
|
||||||
try {
|
for (var i in this.currentGraph.renderers) {
|
||||||
this.currentGraph.renderers[i].clear();
|
try {
|
||||||
this.currentGraph.kill(i);
|
this.currentGraph.renderers[i].clear();
|
||||||
} catch (ignore) {
|
this.currentGraph.kill(i);
|
||||||
// no need to cleanup
|
} catch (ignore) {
|
||||||
|
// no need to cleanup
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue