Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/images/native-build/cmake/external/External_fmt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
14 changes: 7 additions & 7 deletions src/subsystems/storage/cache_client/CacheClientImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ CacheClientStatus CacheClientImpl::Upload(
LOG_WARN_CACHECLIENT_EXTENDED(
"Upload to server failed, error: {}",
*uploadRequest,
response.result());
static_cast<int>(response.result()));
status = CacheClientStatus::INTERNAL_ERROR;
}

Expand Down Expand Up @@ -626,7 +626,7 @@ CacheClientStatus CacheClientImpl::Download(
LOG_DEBUG_CACHECLIENT_EXTENDED(
"Download response: {}, filesize: {}, isFullDownload: {}",
*downloadRequest,
response.result(),
static_cast<int>(response.result()),
response.filesize(),
response.isfulldownload());

Expand Down Expand Up @@ -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<int>(response.result()),
hostname);
m_spConnectionManager->ReleaseConnection(hostname, std::move(connection), true);
return CacheClientStatus::INTERNAL_ERROR;
Expand Down Expand Up @@ -1060,7 +1060,7 @@ CacheClientStatus CacheClientImpl::GetLastAccessTimeDistribution(

LOG_INFO_REQID("Last access time distribution response from server: {}, for server: {}",
*lastAccessTimeDistributionRequest,
response.result(),
static_cast<int>(response.result()),
hostname);

switch (response.result())
Expand All @@ -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<int>(response.result()),
hostname);
return CacheClientStatus::INTERNAL_ERROR;
}
Expand Down Expand Up @@ -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<int>(response.result()),
hostname);

switch(response.result())
Expand All @@ -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<int>(response.result()),
hostname);
return CacheClientStatus::INTERNAL_ERROR;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ int main()
}
else
{
LOG_ERROR("Liveness probe failed. Download status: {}", status);
LOG_ERROR("Liveness probe failed. Download status: {}", static_cast<int>(status));
return 1;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/subsystems/storage/cache_server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(eRequestType), std::to_underlying(eResponseCode));
if (bReuse)
{
// To re-use the client connection, put it back into the epoll list
Expand All @@ -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<int>(eRequestType), std::to_underlying(eResponseCode));
if (close(clientFd) < 0)
{
LOG_WARN("Failed to close client fd={}, errno: {}:{}", clientFd, errno, strerror(errno));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ bool IBManager::Init()
LOG_INFO("Configured IB device: {},{},{},{},{},{}",
m_ibDevice.port,
m_ibDevice.lid,
m_ibDevice.mtu,
static_cast<int>(m_ibDevice.mtu),
m_ibDevice.sendCQ->cqe,
devAttr.max_qp,
devAttr.max_qp_wr);
Expand Down Expand Up @@ -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<int>(wc.opcode));
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(request.type_case()), clientConnection.GetId());
}

LOG_DEBUG("Done handling request={}", request.type_case());
LOG_DEBUG("Done handling request={}", static_cast<int>(request.type_case()));
return bRet;
}
//---------------------------------------------------------------------------------------------------------------------
12 changes: 6 additions & 6 deletions src/subsystems/storage/cache_server/state/CacheManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -956,7 +956,7 @@ void CacheManager::EvictionWorker()
? 0
: now - static_cast<time_t>(m_nEvictionLastAccessThresholdSeconds);
LOG_INFO("Using fixed eviction threshold: {}",
LOG_READABLE_TIME_UTC(evictionThreshold));
fmt::streamed(LOG_READABLE_TIME_UTC(evictionThreshold)));
}
if(evictionThreshold <= 0)
{
Expand All @@ -974,7 +974,7 @@ void CacheManager::EvictByAccessTime(time_t nEvictionLastAccessTime)
int nNumFilesDeleted = 0;
vector<string> 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<size_t>(NUM_MAPS); bucket++)
{
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/subsystems/storage/common/IBUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(portAttr.active_mtu), devAttr.max_qp, portAttr.lid);
break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(response.curlCode));
throw RemoteClientException(
"CurlError: " + context + ": " + std::string(curl_easy_strerror(response.curlCode)));
}
Expand Down Expand Up @@ -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<int>(response.curlCode), response.statusCode);
return response;
}
//---------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -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<int>(response.curlCode), response.statusCode);
return response;
}
//---------------------------------------------------------------------------------------------------------------------
Expand Down
14 changes: 7 additions & 7 deletions src/subsystems/storage/stress_tests/perf_tests/PerfClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(eStatus));
nGlobalFailureCounter++;
}
else
Expand Down Expand Up @@ -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<int>(eStatus));
nGlobalFailureCounter++;
}
else
Expand Down Expand Up @@ -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<int>(initStatus));
return static_cast<int>(initStatus);
}

Expand Down Expand Up @@ -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<int>(initStatus));
return static_cast<int>(initStatus);
}

Expand All @@ -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<int>(status));
return static_cast<int>(status);
}
else
Expand Down Expand Up @@ -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<int>(initStatus));
return static_cast<int>(initStatus);
}

Expand All @@ -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<int>(status));
return static_cast<int>(status);
}
else
Expand Down
Loading