1
0
Fork 0

Fixing test timeouts

This commit is contained in:
Simon Grätzer 2017-05-03 19:42:27 +02:00
parent 7a366b5823
commit a73df1aff3
2 changed files with 4 additions and 11 deletions

View File

@ -1109,14 +1109,6 @@ arangodb::Result RocksDBCollection::fillIndexes(
transaction::Methods* trx, std::shared_ptr<arangodb::Index> added) {
ManagedDocumentResult mmdr;
usleep(1000000);
usleep(1000000);
usleep(1000000);
usleep(1000000);
usleep(1000000);
RocksDBIndex* ridx = static_cast<RocksDBIndex*>(added.get());
RocksDBTransactionState* state = rocksutils::toRocksTransactionState(trx);
std::unique_ptr<IndexIterator> iter(primaryIndex()->allIterator(trx, &mmdr, false));
@ -1124,7 +1116,7 @@ arangodb::Result RocksDBCollection::fillIndexes(
uint64_t numDocsWritten = 0;
// write batch will be reset each 5000 documents
rocksdb::WriteBatchWithIndex batch(db->GetOptions().comparator,
rocksdb::WriteBatchWithIndex batch(db->DefaultColumnFamily()->GetComparator(),
32 * 1024 * 1024);
rocksdb::ReadOptions readOptions;

View File

@ -553,12 +553,13 @@ int RocksDBVPackIndex::insertRaw(rocksdb::WriteBatchWithIndex* writeBatch,
RocksDBValue value = _unique ? RocksDBValue::UniqueIndexValue(docKey)
: RocksDBValue::IndexValue();
rocksdb::TransactionDB *db = rocksutils::globalRocksDB();
for (RocksDBKey const& key : elements) {
if (_unique) {
rocksdb::ReadOptions readOpts;
std::string v;
auto status = writeBatch->GetFromBatchAndDB(rocksutils::globalRocksDB(),
readOpts, key.string(), &v);
auto status = writeBatch->GetFromBatchAndDB(db, readOpts,
key.string(), &v);
if (!status.IsNotFound()) {
res = TRI_ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED;
}