Update the knob name

This commit is contained in:
Chaoguang Lin 2021-02-02 13:31:00 -08:00
parent 593165679a
commit f6342376ab
3 changed files with 9 additions and 10 deletions

View File

@ -1361,13 +1361,12 @@ void SQLiteDB::open(bool writable) {
if (walFile.isError()) throw walFile.getError(); // If we've failed to open the file, throw an exception
// Set Rate control if FLOW_KNOBS are positive
if (SERVER_KNOBS->SQLITE_CACHEDFILE_WRITE_WINDOW_LIMIT > 0 &&
SERVER_KNOBS->SQLITE_CACHEDFILE_WRITE_WINDOW_SECONDS > 0) {
if (SERVER_KNOBS->SQLITE_WRITE_WINDOW_LIMIT > 0 && SERVER_KNOBS->SQLITE_WRITE_WINDOW_SECONDS > 0) {
// The writer thread is created before the readers, so it should initialize the rate controls.
if(writable) {
// Create a new rate control and assign it to both files.
Reference<SpeedLimit> rc(new SpeedLimit(SERVER_KNOBS->SQLITE_CACHEDFILE_WRITE_WINDOW_LIMIT,
SERVER_KNOBS->SQLITE_CACHEDFILE_WRITE_WINDOW_SECONDS));
Reference<SpeedLimit> rc(
new SpeedLimit(SERVER_KNOBS->SQLITE_WRITE_WINDOW_LIMIT, SERVER_KNOBS->SQLITE_WRITE_WINDOW_SECONDS));
dbFile.get()->setRateControl(rc);
walFile.get()->setRateControl(rc);
} else {

View File

@ -251,15 +251,15 @@ ServerKnobs::ServerKnobs(bool randomize, ClientKnobs* clientKnobs, bool isSimula
init( SQLITE_CHUNK_SIZE_PAGES, 25600 ); // 100MB
init( SQLITE_CHUNK_SIZE_PAGES_SIM, 1024 ); // 4MB
init( SQLITE_READER_THREADS, 64 ); // number of read threads
init( SQLITE_CACHEDFILE_WRITE_WINDOW_SECONDS, -1 );
init( SQLITE_CACHEDFILE_WRITE_WINDOW_LIMIT, -1 );
init( SQLITE_WRITE_WINDOW_SECONDS, -1 );
init( SQLITE_WRITE_WINDOW_LIMIT, -1 );
if( randomize && BUGGIFY ) {
// Choose an window between .01 and 1.01 seconds.
SQLITE_CACHEDFILE_WRITE_WINDOW_SECONDS = 0.01 + deterministicRandom()->random01();
SQLITE_WRITE_WINDOW_SECONDS = 0.01 + deterministicRandom()->random01();
// Choose 10k to 50k operations per second
int opsPerSecond = deterministicRandom()->randomInt(1000, 5000);
// Set window limit to opsPerSecond scaled down to window size
SQLITE_CACHEDFILE_WRITE_WINDOW_LIMIT = opsPerSecond * SQLITE_CACHEDFILE_WRITE_WINDOW_SECONDS;
SQLITE_WRITE_WINDOW_LIMIT = opsPerSecond * SQLITE_WRITE_WINDOW_SECONDS;
}
// Maximum and minimum cell payload bytes allowed on primary page as calculated in SQLite.

View File

@ -223,8 +223,8 @@ public:
int SQLITE_CHUNK_SIZE_PAGES;
int SQLITE_CHUNK_SIZE_PAGES_SIM;
int SQLITE_READER_THREADS;
int SQLITE_CACHEDFILE_WRITE_WINDOW_LIMIT;
double SQLITE_CACHEDFILE_WRITE_WINDOW_SECONDS;
int SQLITE_WRITE_WINDOW_LIMIT;
double SQLITE_WRITE_WINDOW_SECONDS;
// KeyValueStoreSqlite spring cleaning
double SPRING_CLEANING_NO_ACTION_INTERVAL;