mirror of https://gitee.com/bigwinds/arangodb
remove log garbage
This commit is contained in:
parent
9d6277689c
commit
862ec7bae3
|
@ -77,9 +77,6 @@ RocksDBCollection::RocksDBCollection(LogicalCollection* collection,
|
||||||
_objectId(basics::VelocyPackHelper::stringUInt64(info, "objectId")),
|
_objectId(basics::VelocyPackHelper::stringUInt64(info, "objectId")),
|
||||||
_numberDocuments(0),
|
_numberDocuments(0),
|
||||||
_revisionId(0) {
|
_revisionId(0) {
|
||||||
LOG_TOPIC(ERR, Logger::DEVEL)
|
|
||||||
<< "CREATE ROCKS COLLECTION: " << _logicalCollection->name() << " ("
|
|
||||||
<< this->objectId() << ")";
|
|
||||||
addCollectionMapping(_objectId, _logicalCollection->vocbase()->id(),
|
addCollectionMapping(_objectId, _logicalCollection->vocbase()->id(),
|
||||||
_logicalCollection->cid());
|
_logicalCollection->cid());
|
||||||
}
|
}
|
||||||
|
@ -90,9 +87,6 @@ RocksDBCollection::RocksDBCollection(LogicalCollection* collection,
|
||||||
_objectId(static_cast<RocksDBCollection*>(physical)->_objectId),
|
_objectId(static_cast<RocksDBCollection*>(physical)->_objectId),
|
||||||
_numberDocuments(0),
|
_numberDocuments(0),
|
||||||
_revisionId(0) {
|
_revisionId(0) {
|
||||||
LOG_TOPIC(ERR, Logger::DEVEL)
|
|
||||||
<< "CREATE ROCKS COLLECTION: " << _logicalCollection->name() << " ("
|
|
||||||
<< this->objectId() << ")";
|
|
||||||
addCollectionMapping(_objectId, _logicalCollection->vocbase()->id(),
|
addCollectionMapping(_objectId, _logicalCollection->vocbase()->id(),
|
||||||
_logicalCollection->cid());
|
_logicalCollection->cid());
|
||||||
}
|
}
|
||||||
|
@ -124,9 +118,6 @@ arangodb::Result RocksDBCollection::persistProperties() {
|
||||||
RocksDBValue value(RocksDBValue::Document(infoBuilder.slice()));
|
RocksDBValue value(RocksDBValue::Document(infoBuilder.slice()));
|
||||||
res = globalRocksDBPut(key.string(), value.string());
|
res = globalRocksDBPut(key.string(), value.string());
|
||||||
|
|
||||||
LOG_TOPIC(ERR, Logger::DEVEL)
|
|
||||||
<< "PERSISTING ROCKS COLLECTION: " << _logicalCollection->name() << " ("
|
|
||||||
<< infoBuilder.slice().toJson() << ")";
|
|
||||||
} catch (arangodb::basics::Exception const& ex) {
|
} catch (arangodb::basics::Exception const& ex) {
|
||||||
res.reset(ex.code());
|
res.reset(ex.code());
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
|
@ -197,9 +188,6 @@ size_t RocksDBCollection::memory() const { return 0; }
|
||||||
void RocksDBCollection::open(bool ignoreErrors) {
|
void RocksDBCollection::open(bool ignoreErrors) {
|
||||||
TRI_ASSERT(_objectId != 0);
|
TRI_ASSERT(_objectId != 0);
|
||||||
|
|
||||||
LOG_TOPIC(ERR, Logger::DEVEL)
|
|
||||||
<< "OPEN ROCKS COLLECTION: " << _logicalCollection->name() << " ("
|
|
||||||
<< this->objectId() << ")";
|
|
||||||
// set the initial number of documents
|
// set the initial number of documents
|
||||||
RocksDBEngine* engine =
|
RocksDBEngine* engine =
|
||||||
static_cast<RocksDBEngine*>(EngineSelectorFeature::ENGINE);
|
static_cast<RocksDBEngine*>(EngineSelectorFeature::ENGINE);
|
||||||
|
@ -514,11 +502,7 @@ int RocksDBCollection::read(transaction::Methods* trx,
|
||||||
arangodb::velocypack::Slice const key,
|
arangodb::velocypack::Slice const key,
|
||||||
ManagedDocumentResult& result, bool) {
|
ManagedDocumentResult& result, bool) {
|
||||||
TRI_ASSERT(key.isString());
|
TRI_ASSERT(key.isString());
|
||||||
// LOG_TOPIC(ERR, Logger::FIXME) << "############### Key Slice: " <<
|
|
||||||
// key.toString();
|
|
||||||
RocksDBToken token = primaryIndex()->lookupKey(trx, StringRef(key));
|
RocksDBToken token = primaryIndex()->lookupKey(trx, StringRef(key));
|
||||||
// LOG_TOPIC(ERR, Logger::FIXME) << "############### TOKEN ID: " <<
|
|
||||||
// token.revisionId();
|
|
||||||
|
|
||||||
if (token.revisionId()) {
|
if (token.revisionId()) {
|
||||||
if (readDocument(trx, token, result)) {
|
if (readDocument(trx, token, result)) {
|
||||||
|
@ -1059,9 +1043,6 @@ RocksDBOperationResult RocksDBCollection::insertDocument(
|
||||||
VPackSlice const& doc, bool& waitForSync) const {
|
VPackSlice const& doc, bool& waitForSync) const {
|
||||||
RocksDBOperationResult res;
|
RocksDBOperationResult res;
|
||||||
// Coordinator doesn't know index internals
|
// Coordinator doesn't know index internals
|
||||||
LOG_TOPIC(ERR, Logger::DEVEL)
|
|
||||||
<< std::boolalpha
|
|
||||||
<< "insert enter waitForSync during insert: " << waitForSync;
|
|
||||||
TRI_ASSERT(!ServerState::instance()->isCoordinator());
|
TRI_ASSERT(!ServerState::instance()->isCoordinator());
|
||||||
TRI_ASSERT(trx->state()->isRunning());
|
TRI_ASSERT(trx->state()->isRunning());
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,7 @@ void RocksDBCounterManager::removeCounter(uint64_t objectId) {
|
||||||
rocksdb::WriteOptions options;
|
rocksdb::WriteOptions options;
|
||||||
rocksdb::Status s = _db->Delete(options, key.string());
|
rocksdb::Status s = _db->Delete(options, key.string());
|
||||||
if (!s.ok()) {
|
if (!s.ok()) {
|
||||||
LOG_TOPIC(ERR, Logger::ENGINES) << "Delete counter failed";
|
LOG_TOPIC(ERR, Logger::ENGINES) << "deleting counter failed";
|
||||||
}
|
}
|
||||||
_counters.erase(it);
|
_counters.erase(it);
|
||||||
}
|
}
|
||||||
|
@ -140,7 +140,6 @@ void RocksDBCounterManager::removeCounter(uint64_t objectId) {
|
||||||
|
|
||||||
/// Thread-Safe force sync
|
/// Thread-Safe force sync
|
||||||
Result RocksDBCounterManager::sync() {
|
Result RocksDBCounterManager::sync() {
|
||||||
LOG_TOPIC(ERR, Logger::DEVEL) << "ENTER SYNC";
|
|
||||||
if (_syncing) {
|
if (_syncing) {
|
||||||
return Result();
|
return Result();
|
||||||
}
|
}
|
||||||
|
@ -170,8 +169,6 @@ Result RocksDBCounterManager::sync() {
|
||||||
|
|
||||||
b.clear();
|
b.clear();
|
||||||
pair.second.serialize(b);
|
pair.second.serialize(b);
|
||||||
LOG_TOPIC(ERR, Logger::DEVEL) << "Writing counter " << b.toJson() << " for "
|
|
||||||
<< pair.first;
|
|
||||||
|
|
||||||
RocksDBKey key = RocksDBKey::CounterValue(pair.first);
|
RocksDBKey key = RocksDBKey::CounterValue(pair.first);
|
||||||
rocksdb::Slice value((char*)b.start(), b.size());
|
rocksdb::Slice value((char*)b.start(), b.size());
|
||||||
|
@ -312,8 +309,7 @@ bool RocksDBCounterManager::parseRocksWAL() {
|
||||||
s = batch.writeBatchPtr->Iterate(handler.get());
|
s = batch.writeBatchPtr->Iterate(handler.get());
|
||||||
}
|
}
|
||||||
if (!s.ok()) {
|
if (!s.ok()) {
|
||||||
LOG_TOPIC(ERR, Logger::ENGINES) << "Error during WAL scan";
|
LOG_TOPIC(ERR, Logger::ENGINES) << "error during WAL scan";
|
||||||
LOG_TOPIC(ERR, Logger::ENGINES) << iterator->status().getState();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -207,7 +207,7 @@ void RocksDBEngine::start() {
|
||||||
_backgroundThread.reset(new RocksDBBackgroundThread(this, counter_sync_seconds));
|
_backgroundThread.reset(new RocksDBBackgroundThread(this, counter_sync_seconds));
|
||||||
if (!_backgroundThread->start()) {
|
if (!_backgroundThread->start()) {
|
||||||
LOG_TOPIC(ERR, Logger::ENGINES)
|
LOG_TOPIC(ERR, Logger::ENGINES)
|
||||||
<< "Could not start rocksdb counter manager";
|
<< "could not start rocksdb counter manager";
|
||||||
TRI_ASSERT(false);
|
TRI_ASSERT(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -379,9 +379,6 @@ int RocksDBEngine::getCollectionsAndIndexes(
|
||||||
|
|
||||||
auto slice = VPackSlice(iter->value().data());
|
auto slice = VPackSlice(iter->value().data());
|
||||||
|
|
||||||
LOG_TOPIC(ERR, Logger::DEVEL) << "FOUND ROCKS COLLECTION: "
|
|
||||||
<< slice.toJson();
|
|
||||||
|
|
||||||
if (arangodb::basics::VelocyPackHelper::readBooleanValue(slice, "deleted",
|
if (arangodb::basics::VelocyPackHelper::readBooleanValue(slice, "deleted",
|
||||||
false)) {
|
false)) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -502,10 +499,6 @@ int RocksDBEngine::writeCreateCollectionMarker(TRI_voc_tick_t databaseId,
|
||||||
auto value = RocksDBValue::Collection(slice);
|
auto value = RocksDBValue::Collection(slice);
|
||||||
rocksdb::WriteOptions options; // TODO: check which options would make sense
|
rocksdb::WriteOptions options; // TODO: check which options would make sense
|
||||||
|
|
||||||
LOG_TOPIC(ERR, Logger::DEVEL)
|
|
||||||
<< "PERSISTING ROCKS COLLECTION: " << slice.get("name").copyString()
|
|
||||||
<< " (" << slice.toJson() << ")";
|
|
||||||
|
|
||||||
rocksdb::Status res = _db->Put(options, key.string(), value.string());
|
rocksdb::Status res = _db->Put(options, key.string(), value.string());
|
||||||
auto result = rocksutils::convertStatus(res);
|
auto result = rocksutils::convertStatus(res);
|
||||||
return result.errorNumber();
|
return result.errorNumber();
|
||||||
|
|
|
@ -142,13 +142,6 @@ bool RocksDBAllIndexIterator::next(TokenCallback const& cb, size_t limit) {
|
||||||
|
|
||||||
while (limit > 0) {
|
while (limit > 0) {
|
||||||
RocksDBToken token(RocksDBValue::revisionId(_iterator->value()));
|
RocksDBToken token(RocksDBValue::revisionId(_iterator->value()));
|
||||||
/*LOG_TOPIC(ERR, Logger::FIXME)
|
|
||||||
<< "AllIndexIterator '" << _collection->name() << "' ("
|
|
||||||
<< static_cast<RocksDBCollection*>(_collection->getPhysical())
|
|
||||||
->objectId()
|
|
||||||
<< ", " << _index->objectId()
|
|
||||||
<< "): " << RocksDBKey::primaryKey(_iterator->key()) << " (" << limit
|
|
||||||
<< "); " << token.revisionId();*/
|
|
||||||
cb(token);
|
cb(token);
|
||||||
|
|
||||||
--limit;
|
--limit;
|
||||||
|
@ -217,7 +210,6 @@ RocksDBAnyIndexIterator::RocksDBAnyIndexIterator(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!_iterator->Valid()) {
|
if (!_iterator->Valid()) {
|
||||||
// LOG_TOPIC(ERR, Logger::FIXME) << "invalid iterator!!! offset " << goal;
|
|
||||||
_iterator->Seek(_bounds.start());
|
_iterator->Seek(_bounds.start());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -269,9 +261,6 @@ RocksDBPrimaryIndex::RocksDBPrimaryIndex(
|
||||||
_useCache = true;
|
_useCache = true;
|
||||||
createCache();
|
createCache();
|
||||||
}
|
}
|
||||||
LOG_TOPIC(ERR, Logger::DEVEL)
|
|
||||||
<< "OPEN ROCKS PRIMARY INDEX: " << collection->name() << " ("
|
|
||||||
<< this->objectId() << ")";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RocksDBPrimaryIndex::~RocksDBPrimaryIndex() {}
|
RocksDBPrimaryIndex::~RocksDBPrimaryIndex() {}
|
||||||
|
@ -316,9 +305,6 @@ RocksDBToken RocksDBPrimaryIndex::lookupKey(transaction::Methods* trx,
|
||||||
if (f.found()) {
|
if (f.found()) {
|
||||||
value.buffer()->append(reinterpret_cast<char const*>(f.value()->value()),
|
value.buffer()->append(reinterpret_cast<char const*>(f.value()->value()),
|
||||||
static_cast<size_t>(f.value()->valueSize));
|
static_cast<size_t>(f.value()->valueSize));
|
||||||
/*LOG_TOPIC(ERR, Logger::FIXME) << "#" << trx->state()->id()
|
|
||||||
<< " found cache entry for "
|
|
||||||
<< keyRef.toString();*/
|
|
||||||
return RocksDBToken(RocksDBValue::revisionId(value));
|
return RocksDBToken(RocksDBValue::revisionId(value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -331,8 +317,6 @@ RocksDBToken RocksDBPrimaryIndex::lookupKey(transaction::Methods* trx,
|
||||||
|
|
||||||
auto status = rtrx->Get(options, key.string(), value.buffer());
|
auto status = rtrx->Get(options, key.string(), value.buffer());
|
||||||
if (!status.ok()) {
|
if (!status.ok()) {
|
||||||
/*LOG_TOPIC(ERR, Logger::FIXME) << "#" << trx->state()->id()
|
|
||||||
<< " no record for " << keyRef.toString();*/
|
|
||||||
return RocksDBToken();
|
return RocksDBToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,10 +326,6 @@ RocksDBToken RocksDBPrimaryIndex::lookupKey(transaction::Methods* trx,
|
||||||
key.string().data(), static_cast<uint32_t>(key.string().size()),
|
key.string().data(), static_cast<uint32_t>(key.string().size()),
|
||||||
value.buffer()->data(), static_cast<uint64_t>(value.buffer()->size()));
|
value.buffer()->data(), static_cast<uint64_t>(value.buffer()->size()));
|
||||||
bool cached = _cache->insert(entry);
|
bool cached = _cache->insert(entry);
|
||||||
/*if (cached) {
|
|
||||||
LOG_TOPIC(ERR, Logger::FIXME) << "#" << trx->state()->id() << " cached "
|
|
||||||
<< keyRef.toString();
|
|
||||||
}*/
|
|
||||||
if (!cached) {
|
if (!cached) {
|
||||||
delete entry;
|
delete entry;
|
||||||
}
|
}
|
||||||
|
@ -387,11 +367,6 @@ int RocksDBPrimaryIndex::insert(transaction::Methods* trx,
|
||||||
while (!blacklisted) {
|
while (!blacklisted) {
|
||||||
blacklisted = _cache->blacklist(
|
blacklisted = _cache->blacklist(
|
||||||
key.string().data(), static_cast<uint32_t>(key.string().size()));
|
key.string().data(), static_cast<uint32_t>(key.string().size()));
|
||||||
/*if (blacklisted) {
|
|
||||||
LOG_TOPIC(ERR, Logger::FIXME)
|
|
||||||
<< "#" << trx->state()->id() << " blacklisted "
|
|
||||||
<< StringRef(slice.get(StaticStrings::KeyString)).toString();
|
|
||||||
}*/
|
|
||||||
attempts++;
|
attempts++;
|
||||||
if (attempts > 10) {
|
if (attempts > 10) {
|
||||||
if (_cache->isShutdown()) {
|
if (_cache->isShutdown()) {
|
||||||
|
@ -403,10 +378,6 @@ int RocksDBPrimaryIndex::insert(transaction::Methods* trx,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*LOG_TOPIC(ERR, Logger::FIXME)
|
|
||||||
<< "#" << trx->state()->id() << "'" << _collection->name() << "' ("
|
|
||||||
<< static_cast<RocksDBCollection*>(_collection->getPhysical())->objectId()
|
|
||||||
<< ", " << _objectId << ") primary insert " << revisionId;*/
|
|
||||||
auto status = rtrx->Put(key.string(), value.string());
|
auto status = rtrx->Put(key.string(), value.string());
|
||||||
if (!status.ok()) {
|
if (!status.ok()) {
|
||||||
auto converted =
|
auto converted =
|
||||||
|
@ -431,11 +402,6 @@ int RocksDBPrimaryIndex::remove(transaction::Methods* trx,
|
||||||
while (!blacklisted) {
|
while (!blacklisted) {
|
||||||
blacklisted = _cache->blacklist(
|
blacklisted = _cache->blacklist(
|
||||||
key.string().data(), static_cast<uint32_t>(key.string().size()));
|
key.string().data(), static_cast<uint32_t>(key.string().size()));
|
||||||
/*if (blacklisted) {
|
|
||||||
LOG_TOPIC(ERR, Logger::FIXME)
|
|
||||||
<< "#" << trx->state()->id() << " blacklisted "
|
|
||||||
<< StringRef(slice.get(StaticStrings::KeyString)).toString();
|
|
||||||
}*/
|
|
||||||
attempts++;
|
attempts++;
|
||||||
if (attempts > 10) {
|
if (attempts > 10) {
|
||||||
if (_cache->isShutdown()) {
|
if (_cache->isShutdown()) {
|
||||||
|
@ -454,11 +420,6 @@ int RocksDBPrimaryIndex::remove(transaction::Methods* trx,
|
||||||
auto status = rtrx->Delete(key.string());
|
auto status = rtrx->Delete(key.string());
|
||||||
auto converted =
|
auto converted =
|
||||||
rocksutils::convertStatus(status, rocksutils::StatusHint::index);
|
rocksutils::convertStatus(status, rocksutils::StatusHint::index);
|
||||||
/*if (!status.ok()) {
|
|
||||||
LOG_TOPIC(ERR, Logger::FIXME)
|
|
||||||
<< "#" << trx->state()->id() << " failed to remove "
|
|
||||||
<< StringRef(slice.get(StaticStrings::KeyString)).toString();
|
|
||||||
}*/
|
|
||||||
|
|
||||||
return converted.errorNumber();
|
return converted.errorNumber();
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,8 +204,7 @@ RocksDBReplicationResult rocksutils::tailWal(TRI_vocbase_t* vocbase,
|
||||||
s = batch.writeBatchPtr->Iterate(handler.get());
|
s = batch.writeBatchPtr->Iterate(handler.get());
|
||||||
}
|
}
|
||||||
if (!s.ok()) {
|
if (!s.ok()) {
|
||||||
LOG_TOPIC(ERR, Logger::ENGINES) << "Error during WAL scan";
|
LOG_TOPIC(ERR, Logger::ENGINES) << "error during WAL scan";
|
||||||
LOG_TOPIC(ERR, Logger::ENGINES) << iterator->status().getState();
|
|
||||||
auto converted = convertStatus(s);
|
auto converted = convertStatus(s);
|
||||||
auto result = RocksDBReplicationResult(converted.errorNumber(), lastTick);
|
auto result = RocksDBReplicationResult(converted.errorNumber(), lastTick);
|
||||||
if (fromTickIncluded) {
|
if (fromTickIncluded) {
|
||||||
|
|
|
@ -2084,7 +2084,6 @@ int restoreDataParser(char const* ptr, char const* pos,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key.empty()) {
|
if (key.empty()) {
|
||||||
LOG_TOPIC(ERR, arangodb::Logger::FIXME) << "GOT EXCEPTION 5";
|
|
||||||
errorMsg = invalidMsg;
|
errorMsg = invalidMsg;
|
||||||
|
|
||||||
return TRI_ERROR_HTTP_BAD_PARAMETER;
|
return TRI_ERROR_HTTP_BAD_PARAMETER;
|
||||||
|
|
Loading…
Reference in New Issue