mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of github.com:arangodb/arangodb into devel
This commit is contained in:
commit
69afcc0501
|
@ -1238,6 +1238,10 @@ static void JS_PropertiesVocbaseCol(
|
|||
collection->cid(),
|
||||
isModification ? TRI_TRANSACTION_WRITE : TRI_TRANSACTION_READ);
|
||||
|
||||
if (!isModification) {
|
||||
trx.addHint(TRI_TRANSACTION_HINT_NO_USAGE_LOCK, false);
|
||||
}
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
if (res != TRI_ERROR_NO_ERROR) {
|
||||
|
|
|
@ -248,7 +248,6 @@ static void JS_SynchronizeReplication(
|
|||
database = vocbase->name();
|
||||
}
|
||||
|
||||
|
||||
std::unordered_map<std::string, bool> restrictCollections;
|
||||
if (object->Has(TRI_V8_ASCII_STRING("restrictCollections")) &&
|
||||
object->Get(TRI_V8_ASCII_STRING("restrictCollections"))->IsArray()) {
|
||||
|
@ -371,7 +370,21 @@ static void JS_SynchronizeReplication(
|
|||
}
|
||||
|
||||
result->Set(TRI_V8_ASCII_STRING("collections"), collections);
|
||||
} catch (arangodb::basics::Exception const& ex) {
|
||||
res = ex.code();
|
||||
if (errorMsg.empty()) {
|
||||
errorMsg = std::string("caught exception: ") + ex.what();
|
||||
}
|
||||
} catch (std::exception const& ex) {
|
||||
res = TRI_ERROR_INTERNAL;
|
||||
if (errorMsg.empty()) {
|
||||
errorMsg = std::string("caught exception: ") + ex.what();
|
||||
}
|
||||
} catch (...) {
|
||||
res = TRI_ERROR_INTERNAL;
|
||||
if (errorMsg.empty()) {
|
||||
errorMsg = "caught unknown exception";
|
||||
}
|
||||
}
|
||||
|
||||
if (res != TRI_ERROR_NO_ERROR) {
|
||||
|
|
|
@ -932,6 +932,8 @@ static void JS_GetIndexesVocbaseCol(
|
|||
SingleCollectionTransaction trx(
|
||||
V8TransactionContext::Create(collection->vocbase(), true),
|
||||
collection->cid(), TRI_TRANSACTION_READ);
|
||||
|
||||
trx.addHint(TRI_TRANSACTION_HINT_NO_USAGE_LOCK, false);
|
||||
|
||||
int res = trx.begin();
|
||||
|
||||
|
@ -942,12 +944,11 @@ static void JS_GetIndexesVocbaseCol(
|
|||
// READ-LOCK start
|
||||
trx.lockRead();
|
||||
|
||||
arangodb::LogicalCollection* col = trx.documentCollection();
|
||||
std::string const collectionName(col->name());
|
||||
std::string const collectionName(collection->name());
|
||||
|
||||
// get list of indexes
|
||||
TransactionBuilderLeaser builder(&trx);
|
||||
auto indexes = col->getIndexes();
|
||||
auto indexes = collection->getIndexes();
|
||||
|
||||
trx.finish(res);
|
||||
// READ-LOCK end
|
||||
|
|
|
@ -133,14 +133,20 @@ ChunkProtector ReadCache::insertAndLease(TRI_voc_rid_t revisionId, uint8_t const
|
|||
TRI_ASSERT(p.version() != 0);
|
||||
memcpy(p.vpack(), vpack, size);
|
||||
|
||||
RevisionCacheChunk* chunk = p.chunk();
|
||||
chunk->unqueueWriter();
|
||||
TRI_ASSERT(VPackSlice(p.vpack()).isObject());
|
||||
if (result.hasSeenChunk(chunk)) {
|
||||
result.addExisting(p, revisionId);
|
||||
} else {
|
||||
result.add(p, revisionId);
|
||||
RevisionCacheChunk* chunk = p.chunk();
|
||||
try {
|
||||
if (result.hasSeenChunk(chunk)) {
|
||||
result.addExisting(p, revisionId);
|
||||
} else {
|
||||
result.add(p, revisionId);
|
||||
}
|
||||
chunk->unqueueWriter();
|
||||
} catch (...) {
|
||||
chunk->unqueueWriter();
|
||||
throw;
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
|
|
|
@ -400,11 +400,21 @@ static int UseCollections(TRI_transaction_t* trx, int nestingLevel) {
|
|||
} else {
|
||||
// use without usage-lock (lock already set externally)
|
||||
trxCollection->_collection = trx->_vocbase->lookupCollection(trxCollection->_cid);
|
||||
|
||||
if (trxCollection->_collection == nullptr) {
|
||||
return TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
|
||||
if (trxCollection->_collection == nullptr) {
|
||||
// something went wrong
|
||||
return TRI_errno();
|
||||
int res = TRI_errno();
|
||||
|
||||
if (res == TRI_ERROR_NO_ERROR) {
|
||||
// must return an error
|
||||
res = TRI_ERROR_INTERNAL;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
if (trxCollection->_accessType == TRI_TRANSACTION_WRITE &&
|
||||
|
|
|
@ -130,6 +130,9 @@ function cancelReadLockOnLeader (endpoint, database, lockJobId) {
|
|||
// //////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function cancelBarrier (endpoint, database, barrierId) {
|
||||
if (barrierId <= 0) {
|
||||
return true;
|
||||
}
|
||||
var url = endpointToURL(endpoint) + '/_db/' + database +
|
||||
'/_api/replication/barrier/' + barrierId;
|
||||
var r = request({url, method: 'DELETE' });
|
||||
|
|
Loading…
Reference in New Issue