mirror of https://gitee.com/bigwinds/arangodb
less lock
This commit is contained in:
parent
e8ab1c6b38
commit
a7c1ee0191
|
@ -366,7 +366,7 @@ void RestReplicationHandler::handleCommandInventory () {
|
|||
TRI_voc_tick_t tick = TRI_CurrentTickVocBase();
|
||||
|
||||
// collections
|
||||
TRI_json_t* collections = TRI_ParametersCollectionsVocBase(_vocbase, tick, &filterCollection, NULL);
|
||||
TRI_json_t* collections = TRI_InventoryCollectionsVocBase(_vocbase, tick, &filterCollection, NULL);
|
||||
|
||||
TRI_replication_log_state_t state;
|
||||
|
||||
|
|
|
@ -570,7 +570,7 @@ static bool StringifyDocumentOperation (TRI_string_buffer_t* buffer,
|
|||
TRI_voc_rid_t oldRev;
|
||||
TRI_voc_rid_t rid;
|
||||
|
||||
if (! TRI_ReserveStringBuffer(buffer, 256)) {
|
||||
if (TRI_ReserveStringBuffer(buffer, 256) != TRI_ERROR_NO_ERROR) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -2014,7 +2014,7 @@ int TRI_LogDocumentReplication (TRI_vocbase_t* vocbase,
|
|||
TRI_replication_logger_t* logger;
|
||||
const char* typeName;
|
||||
int res;
|
||||
|
||||
|
||||
logger = vocbase->_replicationLogger;
|
||||
TRI_ReadLockReadWriteLock(&logger->_statusLock);
|
||||
|
||||
|
|
|
@ -1218,16 +1218,8 @@ static int LoadCollectionVocBase (TRI_vocbase_t* vocbase,
|
|||
if (TRI_IS_DOCUMENT_COLLECTION(type)) {
|
||||
TRI_document_collection_t* document;
|
||||
|
||||
#ifdef TRI_ENABLE_REPLICATION
|
||||
TRI_ReadLockReadWriteLock(&vocbase->_objectLock);
|
||||
#endif
|
||||
|
||||
document = TRI_OpenDocumentCollection(vocbase, collection->_path);
|
||||
|
||||
#ifdef TRI_ENABLE_REPLICATION
|
||||
TRI_ReadUnlockReadWriteLock(&vocbase->_objectLock);
|
||||
#endif
|
||||
|
||||
if (document == NULL) {
|
||||
collection->_status = TRI_VOC_COL_STATUS_CORRUPTED;
|
||||
|
||||
|
@ -1878,10 +1870,10 @@ TRI_vector_pointer_t TRI_CollectionsVocBase (TRI_vocbase_t* vocbase) {
|
|||
/// that there will be consistent view of collections & their properties
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TRI_json_t* TRI_ParametersCollectionsVocBase (TRI_vocbase_t* vocbase,
|
||||
TRI_voc_tick_t maxTick,
|
||||
bool (*filter)(TRI_vocbase_col_t*, void*),
|
||||
void* data) {
|
||||
TRI_json_t* TRI_InventoryCollectionsVocBase (TRI_vocbase_t* vocbase,
|
||||
TRI_voc_tick_t maxTick,
|
||||
bool (*filter)(TRI_vocbase_col_t*, void*),
|
||||
void* data) {
|
||||
TRI_vector_pointer_t collections;
|
||||
TRI_json_t* json;
|
||||
size_t i, n;
|
||||
|
|
|
@ -553,10 +553,10 @@ TRI_vector_pointer_t TRI_CollectionsVocBase (TRI_vocbase_t*);
|
|||
/// and optionally indexes
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
struct TRI_json_s* TRI_ParametersCollectionsVocBase (TRI_vocbase_t*,
|
||||
TRI_voc_tick_t,
|
||||
bool (*)(TRI_vocbase_col_t*, void*),
|
||||
void*);
|
||||
struct TRI_json_s* TRI_InventoryCollectionsVocBase (TRI_vocbase_t*,
|
||||
TRI_voc_tick_t,
|
||||
bool (*)(TRI_vocbase_col_t*, void*),
|
||||
void*);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief get a collection name by a collection id
|
||||
|
|
Loading…
Reference in New Issue