diff --git a/cmake/ConfigureCompiler.cmake b/cmake/ConfigureCompiler.cmake index d49a2befe4..400cead811 100644 --- a/cmake/ConfigureCompiler.cmake +++ b/cmake/ConfigureCompiler.cmake @@ -292,7 +292,6 @@ else() -Wno-undefined-var-template -Wno-unknown-pragmas -Wno-unknown-warning-option - -Wno-unused-function -Wno-unused-parameter ) if (USE_CCACHE) diff --git a/fdbclient/ClientLibManagement.actor.cpp b/fdbclient/ClientLibManagement.actor.cpp index 8b24956ee3..9ca0571e32 100644 --- a/fdbclient/ClientLibManagement.actor.cpp +++ b/fdbclient/ClientLibManagement.actor.cpp @@ -198,7 +198,7 @@ KeyRef chunkKeyFromNo(StringRef clientLibBinPrefix, size_t chunkNo, Arena& arena return clientLibBinPrefix.withSuffix(format("%06zu", chunkNo), arena); } -ClientLibPlatform getCurrentClientPlatform() { +[[maybe_unused]] ClientLibPlatform getCurrentClientPlatform() { #ifdef __x86_64__ #if defined(_WIN32) return ClientLibPlatform::X86_64_WINDOWS; @@ -707,4 +707,4 @@ ACTOR Future>> listClientLibraries(Database db, return result; } -} // namespace ClientLibManagement \ No newline at end of file +} // namespace ClientLibManagement diff --git a/fdbclient/DatabaseConfiguration.cpp b/fdbclient/DatabaseConfiguration.cpp index c2cb04bb2f..d778b35845 100644 --- a/fdbclient/DatabaseConfiguration.cpp +++ b/fdbclient/DatabaseConfiguration.cpp @@ -578,9 +578,6 @@ bool DatabaseConfiguration::setInternal(KeyRef key, ValueRef value) { return true; // All of the above options currently require recovery to take effect } -static KeyValueRef* lower_bound(VectorRef& config, KeyRef const& key) { - return std::lower_bound(config.begin(), config.end(), KeyValueRef(key, ValueRef()), KeyValueRef::OrderByKey()); -} static KeyValueRef const* lower_bound(VectorRef const& config, KeyRef const& key) { return std::lower_bound(config.begin(), config.end(), KeyValueRef(key, ValueRef()), KeyValueRef::OrderByKey()); } diff --git a/fdbclient/FDBTypes.cpp b/fdbclient/FDBTypes.cpp index 3639776e2d..8ada7f2c08 100644 --- a/fdbclient/FDBTypes.cpp +++ b/fdbclient/FDBTypes.cpp @@ -65,3 +65,11 @@ std::string KeySelectorRef::toString() const { return format("%d+lastLessThan(%s)", offset, printable(key).c_str()); } } + +std::string describe(const std::string& s) { + return s; +} + +std::string describe(UID const& item) { + return item.shortString(); +} diff --git a/fdbclient/FDBTypes.h b/fdbclient/FDBTypes.h index 17ad22b93e..d0eb4c0d0b 100644 --- a/fdbclient/FDBTypes.h +++ b/fdbclient/FDBTypes.h @@ -188,18 +188,14 @@ inline std::string describe(const int item) { } // Allows describeList to work on a vector of std::string -static std::string describe(const std::string& s) { - return s; -} +std::string describe(const std::string& s); template std::string describe(Reference const& item) { return item->toString(); } -static std::string describe(UID const& item) { - return item.shortString(); -} +std::string describe(UID const& item); template std::string describe(T const& item) { diff --git a/fdbserver/DeltaTree.h b/fdbserver/DeltaTree.h index c1219bd71a..2c1f7ea91f 100644 --- a/fdbserver/DeltaTree.h +++ b/fdbserver/DeltaTree.h @@ -94,7 +94,7 @@ static int __lessOrEqualPowerOfTwo(unsigned int n) { } */ -static int perfectSubtreeSplitPoint(int subtree_size) { +static inline int perfectSubtreeSplitPoint(int subtree_size) { // return the inorder index of the root node in a subtree of the given size // consistent with the resulting binary search tree being "perfect" (having minimal height // and all missing nodes as far right as possible). @@ -103,7 +103,7 @@ static int perfectSubtreeSplitPoint(int subtree_size) { return std::min(s * 2 + 1, subtree_size - s - 1); } -static int perfectSubtreeSplitPointCached(int subtree_size) { +static inline int perfectSubtreeSplitPointCached(int subtree_size) { static uint16_t* points = nullptr; static const int max = 500; if (points == nullptr) { diff --git a/fdbserver/OldTLogServer_6_2.actor.cpp b/fdbserver/OldTLogServer_6_2.actor.cpp index e25b80f881..4893a5da03 100644 --- a/fdbserver/OldTLogServer_6_2.actor.cpp +++ b/fdbserver/OldTLogServer_6_2.actor.cpp @@ -267,7 +267,7 @@ static StringRef stripTagMessagesKey(StringRef key) { return key.substr(sizeof(UID) + sizeof(Tag) + persistTagMessagesKeys.begin.size()); } -static StringRef stripTagMessageRefsKey(StringRef key) { +[[maybe_unused]] static StringRef stripTagMessageRefsKey(StringRef key) { return key.substr(sizeof(UID) + sizeof(Tag) + persistTagMessageRefsKeys.begin.size()); } diff --git a/fdbserver/RestoreController.actor.cpp b/fdbserver/RestoreController.actor.cpp index 860e6b2e56..a9d0444b74 100644 --- a/fdbserver/RestoreController.actor.cpp +++ b/fdbserver/RestoreController.actor.cpp @@ -37,7 +37,8 @@ #include "flow/Platform.h" #include "flow/actorcompiler.h" // This must be the last #include. -ACTOR static Future clearDB(Database cx); +// TODO: Support [[maybe_unused]] attribute for actors +// ACTOR static Future clearDB(Database cx); ACTOR static Future collectBackupFiles(Reference bc, std::vector* rangeFiles, std::vector* logFiles, @@ -76,7 +77,8 @@ ACTOR static Future notifyLoadersVersionBatchFinished(std::map notifyRestoreCompleted(Reference self, bool terminate); ACTOR static Future signalRestoreCompleted(Reference self, Database cx); -ACTOR static Future updateHeartbeatTime(Reference self); +// TODO: Support [[maybe_unused]] attribute for actors +// ACTOR static Future updateHeartbeatTime(Reference self); ACTOR static Future checkRolesLiveness(Reference self); void splitKeyRangeForAppliers(Reference batchData, @@ -900,16 +902,18 @@ ACTOR static Future buildRangeVersions(KeyRangeMap* pRangeVersion return Void(); } +/* ACTOR static Future clearDB(Database cx) { - wait(runRYWTransaction(cx, [](Reference tr) -> Future { - tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); - tr->setOption(FDBTransactionOptions::LOCK_AWARE); - tr->clear(normalKeys); - return Void(); - })); + wait(runRYWTransaction(cx, [](Reference tr) -> Future { + tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); + tr->setOption(FDBTransactionOptions::LOCK_AWARE); + tr->clear(normalKeys); + return Void(); + })); - return Void(); + return Void(); } +*/ ACTOR static Future initializeVersionBatch(std::map appliersInterf, std::map loadersInterf, @@ -1135,67 +1139,69 @@ ACTOR static Future signalRestoreCompleted(Reference updateHeartbeatTime(Reference self) { - wait(self->recruitedRoles.getFuture()); + wait(self->recruitedRoles.getFuture()); - int numRoles = self->loadersInterf.size() + self->appliersInterf.size(); - state std::map::iterator loader = self->loadersInterf.begin(); - state std::map::iterator applier = self->appliersInterf.begin(); - state std::vector> fReplies(numRoles, Never()); // TODO: Reserve memory for this vector - state std::vector nodes; - state int index = 0; - state Future fTimeout = Void(); + int numRoles = self->loadersInterf.size() + self->appliersInterf.size(); + state std::map::iterator loader = self->loadersInterf.begin(); + state std::map::iterator applier = self->appliersInterf.begin(); + state std::vector> fReplies(numRoles, Never()); // TODO: Reserve memory for this vector + state std::vector nodes; + state int index = 0; + state Future fTimeout = Void(); - // Initialize nodes only once - std::transform(self->loadersInterf.begin(), - self->loadersInterf.end(), - std::back_inserter(nodes), - [](const std::pair& in) { return in.first; }); - std::transform(self->appliersInterf.begin(), - self->appliersInterf.end(), - std::back_inserter(nodes), - [](const std::pair& in) { return in.first; }); + // Initialize nodes only once + std::transform(self->loadersInterf.begin(), + self->loadersInterf.end(), + std::back_inserter(nodes), + [](const std::pair& in) { return in.first; }); + std::transform(self->appliersInterf.begin(), + self->appliersInterf.end(), + std::back_inserter(nodes), + [](const std::pair& in) { return in.first; }); - loop { - loader = self->loadersInterf.begin(); - applier = self->appliersInterf.begin(); - index = 0; - std::fill(fReplies.begin(), fReplies.end(), Never()); - // ping loaders and appliers - while (loader != self->loadersInterf.end()) { - fReplies[index] = loader->second.heartbeat.getReply(RestoreSimpleRequest()); - loader++; - index++; - } - while (applier != self->appliersInterf.end()) { - fReplies[index] = applier->second.heartbeat.getReply(RestoreSimpleRequest()); - applier++; - index++; - } + loop { + loader = self->loadersInterf.begin(); + applier = self->appliersInterf.begin(); + index = 0; + std::fill(fReplies.begin(), fReplies.end(), Never()); + // ping loaders and appliers + while (loader != self->loadersInterf.end()) { + fReplies[index] = loader->second.heartbeat.getReply(RestoreSimpleRequest()); + loader++; + index++; + } + while (applier != self->appliersInterf.end()) { + fReplies[index] = applier->second.heartbeat.getReply(RestoreSimpleRequest()); + applier++; + index++; + } - fTimeout = delay(SERVER_KNOBS->FASTRESTORE_HEARTBEAT_DELAY); + fTimeout = delay(SERVER_KNOBS->FASTRESTORE_HEARTBEAT_DELAY); - // Here we have to handle error, otherwise controller worker will fail and exit. - try { - wait(waitForAll(fReplies) || fTimeout); - } catch (Error& e) { - // This should be an ignorable error. - TraceEvent(g_network->isSimulated() ? SevWarnAlways : SevError, "FastRestoreUpdateHeartbeatError").error(e); - } + // Here we have to handle error, otherwise controller worker will fail and exit. + try { + wait(waitForAll(fReplies) || fTimeout); + } catch (Error& e) { + // This should be an ignorable error. + TraceEvent(g_network->isSimulated() ? SevWarnAlways : SevError, "FastRestoreUpdateHeartbeatError").error(e); + } - // Update the most recent heart beat time for each role - for (int i = 0; i < fReplies.size(); ++i) { - if (!fReplies[i].isError() && fReplies[i].isReady()) { - double currentTime = now(); - auto item = self->rolesHeartBeatTime.emplace(nodes[i], currentTime); - item.first->second = currentTime; - } - } - wait(fTimeout); // Ensure not updating heartbeat too quickly - } + // Update the most recent heart beat time for each role + for (int i = 0; i < fReplies.size(); ++i) { + if (!fReplies[i].isError() && fReplies[i].isReady()) { + double currentTime = now(); + auto item = self->rolesHeartBeatTime.emplace(nodes[i], currentTime); + item.first->second = currentTime; + } + } + wait(fTimeout); // Ensure not updating heartbeat too quickly + } } +*/ // Check if a restore role dies or disconnected ACTOR static Future checkRolesLiveness(Reference self) { diff --git a/fdbserver/SimulatedCluster.actor.cpp b/fdbserver/SimulatedCluster.actor.cpp index 9062c20b58..62d1f71db9 100644 --- a/fdbserver/SimulatedCluster.actor.cpp +++ b/fdbserver/SimulatedCluster.actor.cpp @@ -1223,7 +1223,7 @@ void SimulationConfig::set_config(std::string config) { db.set(kv.first, kv.second); } -StringRef StringRefOf(const char* s) { +[[maybe_unused]] StringRef StringRefOf(const char* s) { return StringRef((uint8_t*)s, strlen(s)); } @@ -2188,7 +2188,7 @@ bool rocksDBEnabled = false; #endif // Populates the TestConfig fields according to what is found in the test file. -void checkTestConf(const char* testFile, TestConfig* testConfig) {} +[[maybe_unused]] void checkTestConf(const char* testFile, TestConfig* testConfig) {} } // namespace @@ -2301,4 +2301,4 @@ ACTOR void setupAndRun(std::string dataFolder, destructed = true; wait(Never()); ASSERT(false); -} \ No newline at end of file +} diff --git a/flow/Tracing.actor.cpp b/flow/Tracing.actor.cpp index 4cb35bc117..173fbe1196 100644 --- a/flow/Tracing.actor.cpp +++ b/flow/Tracing.actor.cpp @@ -122,26 +122,28 @@ ACTOR Future simulationStartServer() { } } +/* // Runs on an interval, printing debug information and performing other // connection tasks. ACTOR Future traceLog(int* pendingMessages, bool* sendError) { - state bool sendErrorReset = false; + state bool sendErrorReset = false; - loop { - TraceEvent("TracingSpanQueueSize").detail("PendingMessages", *pendingMessages); + loop { + TraceEvent("TracingSpanQueueSize").detail("PendingMessages", *pendingMessages); - // Wait at least one full loop before attempting to send messages - // again. - if (sendErrorReset) { - sendErrorReset = false; - *sendError = false; - } else if (*sendError) { - sendErrorReset = true; - } + // Wait at least one full loop before attempting to send messages + // again. + if (sendErrorReset) { + sendErrorReset = false; + *sendError = false; + } else if (*sendError) { + sendErrorReset = true; + } - wait(delay(kQueueSizeLogInterval)); - } + wait(delay(kQueueSizeLogInterval)); + } } +*/ struct UDPTracer : public ITracer { protected: diff --git a/flow/crc32c.cpp b/flow/crc32c.cpp index 759bfd31ef..e9339333a5 100644 --- a/flow/crc32c.cpp +++ b/flow/crc32c.cpp @@ -37,7 +37,7 @@ #include "flow/Platform.h" #include "crc32c-generated-constants.cpp" -static uint32_t append_trivial(uint32_t crc, const uint8_t* input, size_t length) { +[[maybe_unused]] static uint32_t append_trivial(uint32_t crc, const uint8_t* input, size_t length) { for (size_t i = 0; i < length; ++i) { crc = crc ^ input[i]; for (int j = 0; j < 8; j++) @@ -49,7 +49,7 @@ static uint32_t append_trivial(uint32_t crc, const uint8_t* input, size_t length /* Table-driven software version as a fall-back. This is about 15 times slower than using the hardware instructions. This assumes little-endian integers, as is the case on Intel processors that the assembler code here is for. */ -static uint32_t append_adler_table(uint32_t crci, const uint8_t* input, size_t length) { +[[maybe_unused]] static uint32_t append_adler_table(uint32_t crci, const uint8_t* input, size_t length) { const uint8_t* next = input; uint64_t crc;