From 310166d3cfd7495ac399b685f3dc7da2eda8d176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Gra=CC=88tzer?= Date: Thu, 11 May 2017 15:55:06 +0200 Subject: [PATCH] Fixing locking error --- arangod/RocksDBEngine/RocksDBCollection.cpp | 3 +++ arangod/RocksDBEngine/RocksDBEdgeIndex.cpp | 2 +- arangod/RocksDBEngine/RocksDBIndex.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/arangod/RocksDBEngine/RocksDBCollection.cpp b/arangod/RocksDBEngine/RocksDBCollection.cpp index 5e76470241..b243c0d395 100644 --- a/arangod/RocksDBEngine/RocksDBCollection.cpp +++ b/arangod/RocksDBEngine/RocksDBCollection.cpp @@ -544,6 +544,9 @@ bool RocksDBCollection::dropIndex(TRI_idx_iid_t iid) { _indexes.erase(_indexes.begin() + i); events::DropIndex("", std::to_string(iid), TRI_ERROR_NO_ERROR); + // toVelocyPackIgnore will take a read lock and we don't need the + // lock anymore, we will always return + guard.unlock(); VPackBuilder builder = _logicalCollection->toVelocyPackIgnore( {"path", "statusString"}, true); diff --git a/arangod/RocksDBEngine/RocksDBEdgeIndex.cpp b/arangod/RocksDBEngine/RocksDBEdgeIndex.cpp index b387bb8c9b..32f285358a 100644 --- a/arangod/RocksDBEngine/RocksDBEdgeIndex.cpp +++ b/arangod/RocksDBEngine/RocksDBEdgeIndex.cpp @@ -130,7 +130,7 @@ bool RocksDBEdgeIndexIterator::next(TokenCallback const& cb, size_t limit) { foundInCache = true; } else { // try to find cached value - auto f = _cache->find(fromTo.data(),fromTo.size()); + auto f = _cache->find(fromTo.data(), (uint32_t)fromTo.size()); foundInCache = f.found(); if (foundInCache) { VPackSlice cachedPrimaryKeys(f.value()->value()); diff --git a/arangod/RocksDBEngine/RocksDBIndex.cpp b/arangod/RocksDBEngine/RocksDBIndex.cpp index efa2821cc3..fb9e4b9a66 100644 --- a/arangod/RocksDBEngine/RocksDBIndex.cpp +++ b/arangod/RocksDBEngine/RocksDBIndex.cpp @@ -197,7 +197,7 @@ void RocksDBIndex::blackListKey(char const* data, std::size_t len){ bool blacklisted = false; uint64_t attempts = 0; while (!blacklisted) { - blacklisted = _cache->blacklist(data,len); + blacklisted = _cache->blacklist(data, (uint32_t)len); if (attempts++ % 10 == 0) { if (_cache->isShutdown()) { disableCache();