From 12ef63b698839e06dbecb13e639b3938d847892d Mon Sep 17 00:00:00 2001 From: Evan Tschannen Date: Tue, 1 May 2018 19:43:35 -0700 Subject: [PATCH] knobify replace contents bytes --- fdbserver/IKeyValueStore.h | 1 + fdbserver/KeyValueStoreMemory.actor.cpp | 4 ++-- fdbserver/Knobs.cpp | 3 +++ fdbserver/Knobs.h | 3 +++ fdbserver/TLogServer.actor.cpp | 5 ++--- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/fdbserver/IKeyValueStore.h b/fdbserver/IKeyValueStore.h index 97f2142fa1..c548d891e0 100644 --- a/fdbserver/IKeyValueStore.h +++ b/fdbserver/IKeyValueStore.h @@ -23,6 +23,7 @@ #pragma once #include "fdbclient/FDBTypes.h" +#include "Knobs.h" class IClosable { public: diff --git a/fdbserver/KeyValueStoreMemory.actor.cpp b/fdbserver/KeyValueStoreMemory.actor.cpp index a9707cb010..535d04ee7a 100644 --- a/fdbserver/KeyValueStoreMemory.actor.cpp +++ b/fdbserver/KeyValueStoreMemory.actor.cpp @@ -155,8 +155,8 @@ public: return waitAndCommit(this, sequential); if(!disableSnapshot && replaceContent && !firstCommitWithSnapshot) { - transactionSize += 100000; - committedWriteBytes += 100000; + transactionSize += SERVER_KNOBS->REPLACE_CONTENTS_BYTES; + committedWriteBytes += SERVER_KNOBS->REPLACE_CONTENTS_BYTES; semiCommit(); } diff --git a/fdbserver/Knobs.cpp b/fdbserver/Knobs.cpp index 371112fb35..7fb574af2b 100644 --- a/fdbserver/Knobs.cpp +++ b/fdbserver/Knobs.cpp @@ -201,6 +201,9 @@ ServerKnobs::ServerKnobs(bool randomize, ClientKnobs* clientKnobs) { init( SPRING_CLEANING_MIN_VACUUM_PAGES, 1 ); if( randomize && BUGGIFY ) SPRING_CLEANING_MIN_VACUUM_PAGES = g_random->randomInt(0, 100); init( SPRING_CLEANING_MAX_VACUUM_PAGES, 1e9 ); if( randomize && BUGGIFY ) SPRING_CLEANING_MAX_VACUUM_PAGES = g_random->coinflip() ? 0 : g_random->randomInt(1, 1e4); + // KeyValueStoreMemory + init( REPLACE_CONTENTS_BYTES, 1e5 ); if( randomize && BUGGIFY ) REPLACE_CONTENTS_BYTES = 1e3; + // Leader election bool longLeaderElection = randomize && BUGGIFY; init( CANDIDATE_MIN_DELAY, 0.05 ); diff --git a/fdbserver/Knobs.h b/fdbserver/Knobs.h index 74d95d1596..7f0a16e831 100644 --- a/fdbserver/Knobs.h +++ b/fdbserver/Knobs.h @@ -149,6 +149,9 @@ public: int SPRING_CLEANING_MIN_VACUUM_PAGES; int SPRING_CLEANING_MAX_VACUUM_PAGES; + // KeyValueStoreMemory + int64_t REPLACE_CONTENTS_BYTES; + // Leader election double CANDIDATE_MIN_DELAY; double CANDIDATE_MAX_DELAY; diff --git a/fdbserver/TLogServer.actor.cpp b/fdbserver/TLogServer.actor.cpp index 06d3295017..7b9bb0b521 100644 --- a/fdbserver/TLogServer.actor.cpp +++ b/fdbserver/TLogServer.actor.cpp @@ -1216,7 +1216,7 @@ ACTOR Future tLogCommit( return Void(); } -ACTOR Future initPersistentState( TLogData* self, Reference logData, std::vector recoveredTags ) { +ACTOR Future initPersistentState( TLogData* self, Reference logData, std::vector allTags ) { // PERSIST: Initial setup of persistentData for a brand new tLog for a new database IKeyValueStore *storage = self->persistentData; storage->set( persistFormat ); @@ -1226,9 +1226,8 @@ ACTOR Future initPersistentState( TLogData* self, Reference logDa storage->set( KeyValueRef( BinaryWriter::toValue(logData->logId,Unversioned()).withPrefix(persistLogRouterTagsKeys.begin), BinaryWriter::toValue(logData->logRouterTags, Unversioned()) ) ); storage->set( KeyValueRef( BinaryWriter::toValue(logData->logId,Unversioned()).withPrefix(persistRecoveryCountKeys.begin), BinaryWriter::toValue(logData->recoveryCount, Unversioned()) ) ); - for(auto tag : recoveredTags) { + for(auto tag : allTags) { ASSERT(!logData->getTagData(tag)); - TraceEvent("TLogCreateUnpopped", logData->logId).detail("tags", logData->unpoppedRecoveredTags).detail("tag", tag.toString()); logData->createTagData(tag, 0, true, true, true); updatePersistentPopped( self, logData, logData->getTagData(tag) ); }