mirror of https://gitee.com/bigwinds/arangodb
fix assertion (#8860)
This commit is contained in:
parent
eef492721a
commit
6381659a53
|
@ -244,11 +244,6 @@ size_t RocksDBCollection::memory() const { return 0; }
|
|||
|
||||
void RocksDBCollection::open(bool /*ignoreErrors*/) {
|
||||
TRI_ASSERT(_objectId != 0);
|
||||
RocksDBEngine* engine = static_cast<RocksDBEngine*>(EngineSelectorFeature::ENGINE);
|
||||
TRI_ASSERT(engine != nullptr);
|
||||
if (!engine->inRecovery()) {
|
||||
loadInitialNumberDocuments();
|
||||
}
|
||||
}
|
||||
|
||||
void RocksDBCollection::prepareIndexes(arangodb::velocypack::Slice indexesSlice) {
|
||||
|
|
|
@ -172,10 +172,6 @@ rocksdb::SequenceNumber RocksDBCollectionMeta::applyAdjustments(rocksdb::Sequenc
|
|||
|
||||
/// @brief get the current count
|
||||
RocksDBCollectionMeta::DocCount RocksDBCollectionMeta::loadCount() {
|
||||
auto maxxSeq = std::numeric_limits<rocksdb::SequenceNumber>::max();
|
||||
bool didWork = false;
|
||||
const rocksdb::SequenceNumber commitSeq = committableSeq(maxxSeq);
|
||||
applyAdjustments(commitSeq, didWork);
|
||||
return _count;
|
||||
}
|
||||
|
||||
|
|
|
@ -2052,6 +2052,7 @@ std::unique_ptr<TRI_vocbase_t> RocksDBEngine::openExistingDatabase(
|
|||
auto phy = static_cast<RocksDBCollection*>(collection->getPhysical());
|
||||
TRI_ASSERT(phy != nullptr);
|
||||
phy->meta().deserializeMeta(_db, *collection);
|
||||
phy->loadInitialNumberDocuments();
|
||||
|
||||
StorageEngine::registerCollection(*vocbase, uniqCol);
|
||||
LOG_TOPIC("39404", DEBUG, arangodb::Logger::ENGINES)
|
||||
|
|
|
@ -303,6 +303,7 @@ class WBReader final : public rocksdb::WriteBatch::Handler {
|
|||
cc._added++;
|
||||
cc._revisionId =
|
||||
transaction::helpers::extractRevFromDocument(RocksDBValue::data(value));
|
||||
coll->loadInitialNumberDocuments();
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -351,6 +352,7 @@ class WBReader final : public rocksdb::WriteBatch::Handler {
|
|||
if (_lastRemovedDocRid != 0) {
|
||||
cc._revisionId = _lastRemovedDocRid;
|
||||
}
|
||||
coll->loadInitialNumberDocuments();
|
||||
}
|
||||
_lastRemovedDocRid = 0; // reset in any case
|
||||
|
||||
|
@ -427,6 +429,7 @@ class WBReader final : public rocksdb::WriteBatch::Handler {
|
|||
cc._committedSeq = _currentSequence;
|
||||
cc._added = 0;
|
||||
cc._removed = 0;
|
||||
coll->loadInitialNumberDocuments();
|
||||
|
||||
for (std::shared_ptr<arangodb::Index> const& idx : coll->getIndexes()) {
|
||||
RocksDBIndex* ridx = static_cast<RocksDBIndex*>(idx.get());
|
||||
|
|
Loading…
Reference in New Issue