diff --git a/src/images/native-build/cmake/external/External_fmt.cmake b/src/images/native-build/cmake/external/External_fmt.cmake index c944644a..4cc40e38 100644 --- a/src/images/native-build/cmake/external/External_fmt.cmake +++ b/src/images/native-build/cmake/external/External_fmt.cmake @@ -14,9 +14,9 @@ ExternalProject_Add( fmt - # Pin the official fmt 8.1.1 release archive by SHA-256. - URL "https://github.com/fmtlib/fmt/releases/download/8.1.1/fmt-8.1.1.zip" - URL_HASH "SHA256=23778bad8edba12d76e4075da06db591f3b0e3c6c04928ced4a7282ca3400e5d" + # Pin the official fmt 9.1.0 release archive by SHA-256. + URL "https://github.com/fmtlib/fmt/releases/download/9.1.0/fmt-9.1.0.zip" + URL_HASH "SHA256=cceb4cb9366e18a5742128cb3524ce5f50e88b476f1e54737a47ffdf4df4c996" UPDATE_COMMAND "" CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_DEP_INSTALL_DIR} diff --git a/src/subsystems/storage/cache_client/CacheClientImpl.cpp b/src/subsystems/storage/cache_client/CacheClientImpl.cpp index f8a5a623..85ad1ea0 100644 --- a/src/subsystems/storage/cache_client/CacheClientImpl.cpp +++ b/src/subsystems/storage/cache_client/CacheClientImpl.cpp @@ -446,7 +446,7 @@ CacheClientStatus CacheClientImpl::Upload( LOG_WARN_CACHECLIENT_EXTENDED( "Upload to server failed, error: {}", *uploadRequest, - response.result()); + static_cast(response.result())); status = CacheClientStatus::INTERNAL_ERROR; } @@ -626,7 +626,7 @@ CacheClientStatus CacheClientImpl::Download( LOG_DEBUG_CACHECLIENT_EXTENDED( "Download response: {}, filesize: {}, isFullDownload: {}", *downloadRequest, - response.result(), + static_cast(response.result()), response.filesize(), response.isfulldownload()); @@ -949,7 +949,7 @@ CacheClientStatus CacheClientImpl::DeleteGroupFromServer( default: LOG_ERROR_REQID("Delete request failed due to unknown response: {}, for server: {}", *deleteGroupRequest, - response.result(), + static_cast(response.result()), hostname); m_spConnectionManager->ReleaseConnection(hostname, std::move(connection), true); return CacheClientStatus::INTERNAL_ERROR; @@ -1060,7 +1060,7 @@ CacheClientStatus CacheClientImpl::GetLastAccessTimeDistribution( LOG_INFO_REQID("Last access time distribution response from server: {}, for server: {}", *lastAccessTimeDistributionRequest, - response.result(), + static_cast(response.result()), hostname); switch (response.result()) @@ -1082,7 +1082,7 @@ CacheClientStatus CacheClientImpl::GetLastAccessTimeDistribution( default: LOG_ERROR_REQID("Last access time distribution request failed due to unknown response: {}, for server: {}", *lastAccessTimeDistributionRequest, - response.result(), + static_cast(response.result()), hostname); return CacheClientStatus::INTERNAL_ERROR; } @@ -1210,7 +1210,7 @@ CacheClientStatus CacheClientImpl::DeleteByLastAccessTime(/*[in]*/ const char* l LOG_INFO_REQID("Delete by last access request for time {} completed with response: {}, for server: {}", *deleteByLastAccessTimeRequest, lastAccessTime, - response.result(), + static_cast(response.result()), hostname); switch(response.result()) @@ -1227,7 +1227,7 @@ CacheClientStatus CacheClientImpl::DeleteByLastAccessTime(/*[in]*/ const char* l default: LOG_ERROR_REQID("Delete by last access request failed due to unknown response: {}, for server: {}", *deleteByLastAccessTimeRequest, - response.result(), + static_cast(response.result()), hostname); return CacheClientStatus::INTERNAL_ERROR; } diff --git a/src/subsystems/storage/cache_client/liveness_probe/Liveness.cpp b/src/subsystems/storage/cache_client/liveness_probe/Liveness.cpp index 1d00fad4..437474a8 100644 --- a/src/subsystems/storage/cache_client/liveness_probe/Liveness.cpp +++ b/src/subsystems/storage/cache_client/liveness_probe/Liveness.cpp @@ -94,7 +94,7 @@ int main() } else { - LOG_ERROR("Liveness probe failed. Download status: {}", status); + LOG_ERROR("Liveness probe failed. Download status: {}", static_cast(status)); return 1; } } diff --git a/src/subsystems/storage/cache_server/Server.cpp b/src/subsystems/storage/cache_server/Server.cpp index 5a8d0cac..985f69e9 100644 --- a/src/subsystems/storage/cache_server/Server.cpp +++ b/src/subsystems/storage/cache_server/Server.cpp @@ -103,7 +103,7 @@ void HandleSocket(int epollFd) ResponseCode eResponseCode = ResponseCode::SUCCESS; std::size_t nFileSize = 0; bool bReuse = HandleRequest(socketConnection, eRequestType, eResponseCode, nFileSize); - LOG_DEBUG("Request type: {}, response code: {}", eRequestType, std::to_underlying(eResponseCode)); + LOG_DEBUG("Request type: {}, response code: {}", static_cast(eRequestType), std::to_underlying(eResponseCode)); if (bReuse) { // To re-use the client connection, put it back into the epoll list @@ -119,7 +119,7 @@ void HandleSocket(int epollFd) else { LOG_INFO("Close fd={} after request processing, request type: {}, response code: {}", - clientFd, eRequestType, std::to_underlying(eResponseCode)); + clientFd, static_cast(eRequestType), std::to_underlying(eResponseCode)); if (close(clientFd) < 0) { LOG_WARN("Failed to close client fd={}, errno: {}:{}", clientFd, errno, strerror(errno)); diff --git a/src/subsystems/storage/cache_server/infiniband/IBManager.cpp b/src/subsystems/storage/cache_server/infiniband/IBManager.cpp index 7cb77aeb..b3d330f1 100644 --- a/src/subsystems/storage/cache_server/infiniband/IBManager.cpp +++ b/src/subsystems/storage/cache_server/infiniband/IBManager.cpp @@ -131,7 +131,7 @@ bool IBManager::Init() LOG_INFO("Configured IB device: {},{},{},{},{},{}", m_ibDevice.port, m_ibDevice.lid, - m_ibDevice.mtu, + static_cast(m_ibDevice.mtu), m_ibDevice.sendCQ->cqe, devAttr.max_qp, devAttr.max_qp_wr); @@ -328,7 +328,7 @@ void IBManager::IBListenerThread() if (wc.opcode != IBV_WC_RECV) { - LOG_CRITICAL("Received unexpected completion opcode: {}", wc.opcode); + LOG_CRITICAL("Received unexpected completion opcode: {}", static_cast(wc.opcode)); continue; } diff --git a/src/subsystems/storage/cache_server/operations/HandleRequest.cpp b/src/subsystems/storage/cache_server/operations/HandleRequest.cpp index 02a288c4..ee0ce449 100644 --- a/src/subsystems/storage/cache_server/operations/HandleRequest.cpp +++ b/src/subsystems/storage/cache_server/operations/HandleRequest.cpp @@ -96,10 +96,10 @@ bool HandleRequest(IConnection& clientConnection, } else { - LOG_ERROR("unkown req type={}, close id={}", request.type_case(), clientConnection.GetId()); + LOG_ERROR("unkown req type={}, close id={}", static_cast(request.type_case()), clientConnection.GetId()); } - LOG_DEBUG("Done handling request={}", request.type_case()); + LOG_DEBUG("Done handling request={}", static_cast(request.type_case())); return bRet; } //--------------------------------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/subsystems/storage/cache_server/state/CacheManager.cpp b/src/subsystems/storage/cache_server/state/CacheManager.cpp index 87dae52d..59c37044 100644 --- a/src/subsystems/storage/cache_server/state/CacheManager.cpp +++ b/src/subsystems/storage/cache_server/state/CacheManager.cpp @@ -946,7 +946,7 @@ void CacheManager::EvictionWorker() // Use dynamic eviction threshold that adapts based on cache size and access patterns evictionThreshold = CalculateDynamicEvictionThreshold(); LOG_INFO("Using dynamic eviction threshold: {}", - LOG_READABLE_TIME_UTC(evictionThreshold)); + fmt::streamed(LOG_READABLE_TIME_UTC(evictionThreshold))); } else { @@ -956,7 +956,7 @@ void CacheManager::EvictionWorker() ? 0 : now - static_cast(m_nEvictionLastAccessThresholdSeconds); LOG_INFO("Using fixed eviction threshold: {}", - LOG_READABLE_TIME_UTC(evictionThreshold)); + fmt::streamed(LOG_READABLE_TIME_UTC(evictionThreshold))); } if(evictionThreshold <= 0) { @@ -974,7 +974,7 @@ void CacheManager::EvictByAccessTime(time_t nEvictionLastAccessTime) int nNumFilesDeleted = 0; vector vecFilesToDelete; LOG_INFO("Started evict by access time, Eviction last access time: {}", - LOG_READABLE_TIME_UTC(nEvictionLastAccessTime)); + fmt::streamed(LOG_READABLE_TIME_UTC(nEvictionLastAccessTime))); for(size_t bucket = 0; bucket < static_cast(NUM_MAPS); bucket++) { @@ -1049,7 +1049,7 @@ void CacheManager::EvictByAccessTime(time_t nEvictionLastAccessTime) m_totalCachedSize.fetch_sub(nDeleteFileSize); LOG_INFO("Delete files by access time: {}, num files: {}, size: {}", - LOG_READABLE_TIME_UTC(nEvictionLastAccessTime), + fmt::streamed(LOG_READABLE_TIME_UTC(nEvictionLastAccessTime)), nNumFilesDeleted, nDeleteFileSize); for (auto& filename : vecFilesToDelete) @@ -1096,7 +1096,7 @@ bool CacheManager::GetLastAccessTimeDistribution( for (auto it = lastAccessTimeDistribution.begin(); it != lastAccessTimeDistribution.end(); ++it) { LOG_DEBUG("Last access time: {}, size: {}", - LOG_READABLE_TIME_UTC(it->first), + fmt::streamed(LOG_READABLE_TIME_UTC(it->first)), it->second); } @@ -1162,7 +1162,7 @@ time_t CacheManager::CalculateDynamicEvictionThreshold() evictionThreshold = lastBucketTimestamp + (time_t)m_nEvictionBucketIntervalSeconds; // round up to include all entries in this bucket LOG_INFO("Dynamic eviction threshold calculated: {}, will evict ~{} bytes, bucketIntervalSec={}, sizeToEvict={}", - LOG_READABLE_TIME_UTC(evictionThreshold), + fmt::streamed(LOG_READABLE_TIME_UTC(evictionThreshold)), accumulatedSize, m_nEvictionBucketIntervalSeconds, sizeToEvict); diff --git a/src/subsystems/storage/common/IBUtils.cpp b/src/subsystems/storage/common/IBUtils.cpp index fad3cf67..ceb7ba15 100644 --- a/src/subsystems/storage/common/IBUtils.cpp +++ b/src/subsystems/storage/common/IBUtils.cpp @@ -186,7 +186,7 @@ namespace ibutils bDeviceFound = true; LOG_INFO("Found active IB device: {},{}:{},{},{},{},{},{},{}", deviceId, (devices.get())[deviceId]->name, port, devAttr.sys_image_guid, portAttr.active_speed, - portAttr.active_width, portAttr.active_mtu, devAttr.max_qp, portAttr.lid); + portAttr.active_width, static_cast(portAttr.active_mtu), devAttr.max_qp, portAttr.lid); break; } diff --git a/src/subsystems/storage/storage_intercept/remote_client/blob/BlobAuthTokenProvider.cpp b/src/subsystems/storage/storage_intercept/remote_client/blob/BlobAuthTokenProvider.cpp index 0885422f..81fe499c 100644 --- a/src/subsystems/storage/storage_intercept/remote_client/blob/BlobAuthTokenProvider.cpp +++ b/src/subsystems/storage/storage_intercept/remote_client/blob/BlobAuthTokenProvider.cpp @@ -278,7 +278,7 @@ TokenInfo BlobAuthTokenProvider::ExecuteWithRetry( else { LOG_ERROR("{}: non-retryable curl error: {} ({})", - context, curl_easy_strerror(response.curlCode), response.curlCode); + context, curl_easy_strerror(response.curlCode), static_cast(response.curlCode)); throw RemoteClientException( "CurlError: " + context + ": " + std::string(curl_easy_strerror(response.curlCode))); } @@ -685,7 +685,7 @@ HttpResponse BlobAuthTokenProvider::PerformCurlRequestWithHeaders(const std::str curl_slist_free_all(headers); curl_easy_cleanup(curl); - LOG_INFO("CURL response code: {}, http status code: {}", response.curlCode, response.statusCode); + LOG_INFO("CURL response code: {}, http status code: {}", static_cast(response.curlCode), response.statusCode); return response; } //--------------------------------------------------------------------------------------------------------------------- @@ -735,7 +735,7 @@ HttpResponse BlobAuthTokenProvider::PerformCurlPostRequest(const std::string& ur curl_slist_free_all(headers); // unique_ptr will handle cleanup - LOG_INFO("CURL POST response code: {}, http status code: {}", response.curlCode, response.statusCode); + LOG_INFO("CURL POST response code: {}, http status code: {}", static_cast(response.curlCode), response.statusCode); return response; } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/subsystems/storage/stress_tests/perf_tests/PerfClient.cpp b/src/subsystems/storage/stress_tests/perf_tests/PerfClient.cpp index 1ed70c46..259bfcb1 100644 --- a/src/subsystems/storage/stress_tests/perf_tests/PerfClient.cpp +++ b/src/subsystems/storage/stress_tests/perf_tests/PerfClient.cpp @@ -86,7 +86,7 @@ bool UploadWithRetries( if(eStatus != CacheClientStatus::SUCCESS) { - LOG_WARN("Upload {} failed with error {}", strFileName, eStatus); + LOG_WARN("Upload {} failed with error {}", strFileName, static_cast(eStatus)); nGlobalFailureCounter++; } else @@ -114,7 +114,7 @@ bool DownloadWithRetries( if(eStatus != CacheClientStatus::SUCCESS) { - LOG_WARN("Download {} failed with error {}", strFileName, eStatus); + LOG_WARN("Download {} failed with error {}", strFileName, static_cast(eStatus)); nGlobalFailureCounter++; } else @@ -765,7 +765,7 @@ int PerfClient(int argc, char *argv[]) if (initStatus != CacheClientStatus::SUCCESS) { - LOG_CRITICAL("Failed to initialize cache client with error {}", initStatus); + LOG_CRITICAL("Failed to initialize cache client with error {}", static_cast(initStatus)); return static_cast(initStatus); } @@ -942,7 +942,7 @@ int EvictionClient(int argc, char* argv[]) if (initStatus != CacheClientStatus::SUCCESS) { - LOG_CRITICAL("Failed to initialize cache client with error {}", initStatus); + LOG_CRITICAL("Failed to initialize cache client with error {}", static_cast(initStatus)); return static_cast(initStatus); } @@ -953,7 +953,7 @@ int EvictionClient(int argc, char* argv[]) if (status != CacheClientStatus::SUCCESS) { - LOG_CRITICAL("Failed to request eviction, return code: {}", status); + LOG_CRITICAL("Failed to request eviction, return code: {}", static_cast(status)); return static_cast(status); } else @@ -997,7 +997,7 @@ int LastAccessTimeDistributionClient(int argc, char* argv[]) if (initStatus != CacheClientStatus::SUCCESS) { - LOG_CRITICAL("Failed to initialize cache client with error {}", initStatus); + LOG_CRITICAL("Failed to initialize cache client with error {}", static_cast(initStatus)); return static_cast(initStatus); } @@ -1010,7 +1010,7 @@ int LastAccessTimeDistributionClient(int argc, char* argv[]) if (status != CacheClientStatus::SUCCESS) { - LOG_CRITICAL("Failed to get last access distribution, return code: {}", status); + LOG_CRITICAL("Failed to get last access distribution, return code: {}", static_cast(status)); return static_cast(status); } else