diff --git a/arangod/RocksDBEngine/RocksDBCollection.cpp b/arangod/RocksDBEngine/RocksDBCollection.cpp index 14b4bec1b5..a44ca6b596 100644 --- a/arangod/RocksDBEngine/RocksDBCollection.cpp +++ b/arangod/RocksDBEngine/RocksDBCollection.cpp @@ -317,12 +317,15 @@ std::shared_ptr RocksDBCollection::createIndex( { VPackBuilder builder = _logicalCollection->toVelocyPackIgnore( {"path", "statusString"}, true, /*forPersistence*/ false); + + VPackBuilder indexInfo; + idx->toVelocyPack(indexInfo, false, true); int res = static_cast(engine)->writeCreateCollectionMarker( _logicalCollection->vocbase()->id(), _logicalCollection->cid(), builder.slice(), RocksDBLogValue::IndexCreate(_logicalCollection->vocbase()->id(), - _logicalCollection->cid(), info)); + _logicalCollection->cid(), indexInfo.slice())); if (res != TRI_ERROR_NO_ERROR) { // We could not persist the index creation. Better abort // Remove the Index in the local list again. @@ -395,6 +398,9 @@ int RocksDBCollection::restoreIndex(transaction::Methods* trx, { VPackBuilder builder = _logicalCollection->toVelocyPackIgnore( {"path", "statusString"}, true, /*forPersistence*/ false); + VPackBuilder indexInfo; + idx->toVelocyPack(indexInfo, false, true); + RocksDBEngine* engine = static_cast(EngineSelectorFeature::ENGINE); TRI_ASSERT(engine != nullptr); @@ -402,7 +408,7 @@ int RocksDBCollection::restoreIndex(transaction::Methods* trx, _logicalCollection->vocbase()->id(), _logicalCollection->cid(), builder.slice(), RocksDBLogValue::IndexCreate(_logicalCollection->vocbase()->id(), - _logicalCollection->cid(), info)); + _logicalCollection->cid(), indexInfo.slice())); if (res != TRI_ERROR_NO_ERROR) { // We could not persist the index creation. Better abort // Remove the Index in the local list again. diff --git a/arangod/RocksDBEngine/RocksDBReplicationTailing.cpp b/arangod/RocksDBEngine/RocksDBReplicationTailing.cpp index e0af99c5ed..63f2f51200 100644 --- a/arangod/RocksDBEngine/RocksDBReplicationTailing.cpp +++ b/arangod/RocksDBEngine/RocksDBReplicationTailing.cpp @@ -204,11 +204,13 @@ class WALParser : public rocksdb::WriteBatch::Handler { } switch (RocksDBKey::type(key)) { case RocksDBEntryType::Collection: { + if (_lastLogType == RocksDBLogType::IndexCreate || + _lastLogType == RocksDBLogType::IndexDrop) { + return; + } TRI_ASSERT(_lastLogType == RocksDBLogType::CollectionCreate || _lastLogType == RocksDBLogType::CollectionChange || - _lastLogType == RocksDBLogType::CollectionRename || - _lastLogType == RocksDBLogType::IndexCreate || - _lastLogType == RocksDBLogType::IndexDrop); + _lastLogType == RocksDBLogType::CollectionRename); TRI_ASSERT(_currentDbId != 0 && _currentCollectionId != 0); _builder.openObject(); _builder.add("tick", VPackValue(std::to_string(_currentSequence)));