knobify replace contents bytes

This commit is contained in:
Evan Tschannen 2018-05-01 19:43:35 -07:00
parent 656a817e74
commit 12ef63b698
5 changed files with 11 additions and 5 deletions

View File

@ -23,6 +23,7 @@
#pragma once
#include "fdbclient/FDBTypes.h"
#include "Knobs.h"
class IClosable {
public:

View File

@ -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();
}

View File

@ -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 );

View File

@ -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;

View File

@ -1216,7 +1216,7 @@ ACTOR Future<Void> tLogCommit(
return Void();
}
ACTOR Future<Void> initPersistentState( TLogData* self, Reference<LogData> logData, std::vector<Tag> recoveredTags ) {
ACTOR Future<Void> initPersistentState( TLogData* self, Reference<LogData> logData, std::vector<Tag> 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<Void> initPersistentState( TLogData* self, Reference<LogData> 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) );
}