From 81f5dce4440e33f4be747d2043158886b55c010f Mon Sep 17 00:00:00 2001 From: Tyler Karaszewski Date: Thu, 23 May 2024 12:24:54 -0700 Subject: [PATCH] This command is buggy (particularly, SQLitePool::setMaxDBs) so removing --- BedrockServer.cpp | 15 --------------- sqlitecluster/SQLitePool.cpp | 6 ------ sqlitecluster/SQLitePool.h | 2 -- 3 files changed, 23 deletions(-) diff --git a/BedrockServer.cpp b/BedrockServer.cpp index 07718e82d..9972397f9 100644 --- a/BedrockServer.cpp +++ b/BedrockServer.cpp @@ -1735,7 +1735,6 @@ bool BedrockServer::_isControlCommand(const unique_ptr& command) SIEquals(command->request.methodLine, "UnblockWrites") || SIEquals(command->request.methodLine, "SetMaxPeerFallBehind") || SIEquals(command->request.methodLine, "SetMaxSocketThreads") || - SIEquals(command->request.methodLine, "SetMaxDBHandles") || SIEquals(command->request.methodLine, "CRASH_COMMAND") ) { return true; @@ -1878,20 +1877,6 @@ void BedrockServer::_control(unique_ptr& command) { } else { response.methodLine = "401 Don't Use Zero"; } - } else if (SIEquals(command->request.methodLine, "SetMaxDBHandles")) { - shared_ptr dbPoolHandle = _dbPool; - if (dbPoolHandle) { - size_t newMax = command->request.calcU64("handlesCount"); - if (newMax) { - SINFO("Setting _dbPoolSize to " << newMax << " from " << _dbPoolSize); - } else { - response.methodLine = "401 Don't Use Zero"; - } - _dbPoolSize = newMax; - dbPoolHandle->setMaxDBs(_dbPoolSize); - } else { - response.methodLine = "404 No DB Pool"; - } } else if (SIEquals(command->request.methodLine, "SetMaxPeerFallBehind")) { // Look up the existing value so we can report what it was. uint64_t existingValue = SQLiteNode::MAX_PEER_FALL_BEHIND; diff --git a/sqlitecluster/SQLitePool.cpp b/sqlitecluster/SQLitePool.cpp index 7e9fe0550..5a1d48385 100644 --- a/sqlitecluster/SQLitePool.cpp +++ b/sqlitecluster/SQLitePool.cpp @@ -35,12 +35,6 @@ SQLite& SQLitePool::getBase() { return _baseDB; } -void SQLitePool::setMaxDBs(size_t newMax) { - unique_lock lock(_sync); - SINFO("Resetting max DB filehandles to " << newMax << " from " << _maxDBs); - _maxDBs = newMax; -} - size_t SQLitePool::getIndex(bool createHandle) { while (true) { unique_lock lock(_sync); diff --git a/sqlitecluster/SQLitePool.h b/sqlitecluster/SQLitePool.h index 642b2448b..42e27dd45 100644 --- a/sqlitecluster/SQLitePool.h +++ b/sqlitecluster/SQLitePool.h @@ -25,8 +25,6 @@ class SQLitePool { // Takes an allocated index and creates the appropriate DB handle if required. SQLite& initializeIndex(size_t index); - void setMaxDBs(size_t newMax); - // Return an object to the pool. void returnToPool(size_t index);