From 1e83d7e1ab3b0195836ef3a3f247ae95874d0e01 Mon Sep 17 00:00:00 2001 From: Junhyun Shim Date: Thu, 28 Jul 2022 00:45:50 +0200 Subject: [PATCH] Apply code review suggestions --- fdbserver/CommitProxyServer.actor.cpp | 6 +----- fdbserver/storageserver.actor.cpp | 8 ++------ flow/flow.cpp | 7 ++++--- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/fdbserver/CommitProxyServer.actor.cpp b/fdbserver/CommitProxyServer.actor.cpp index 7c27d5ad69..5d58d36586 100644 --- a/fdbserver/CommitProxyServer.actor.cpp +++ b/fdbserver/CommitProxyServer.actor.cpp @@ -1845,12 +1845,8 @@ ACTOR static Future doKeyServerLocationRequest(GetKeyServerLocationsReques while (tenantEntry.isError()) { bool finalQuery = commitData->version.get() >= minTenantVersion; - Optional tenantName; - if (req.tenant.name.present()) { - tenantName = req.tenant.name.get(); - } ErrorOr> _tenantEntry = - getTenantEntry(commitData, tenantName, Optional(), finalQuery); + getTenantEntry(commitData, req.tenant.name, Optional(), finalQuery); tenantEntry = _tenantEntry; if (tenantEntry.isError()) { diff --git a/fdbserver/storageserver.actor.cpp b/fdbserver/storageserver.actor.cpp index ec3f8a011f..fc47b0bd01 100644 --- a/fdbserver/storageserver.actor.cpp +++ b/fdbserver/storageserver.actor.cpp @@ -3222,9 +3222,7 @@ ACTOR Future quickGetValue(StorageServer* data, ++data->counters.quickGetValueMiss; if (SERVER_KNOBS->QUICK_GET_VALUE_FALLBACK) { - state Transaction tr(data->cx, - pOriginalReq->tenantInfo.name.present() ? pOriginalReq->tenantInfo.name.get() - : Optional()); + state Transaction tr(data->cx, pOriginalReq->tenantInfo.name.castTo()); tr.setVersion(version); // TODO: is DefaultPromiseEndpoint the best priority for this? tr.trState->taskID = TaskPriority::DefaultPromiseEndpoint; @@ -3859,9 +3857,7 @@ ACTOR Future quickGetKeyValues( ++data->counters.quickGetKeyValuesMiss; if (SERVER_KNOBS->QUICK_GET_KEY_VALUES_FALLBACK) { - state Transaction tr(data->cx, - pOriginalReq->tenantInfo.name.present() ? pOriginalReq->tenantInfo.name.get() - : Optional()); + state Transaction tr(data->cx, pOriginalReq->tenantInfo.name.castTo()); tr.setVersion(version); // TODO: is DefaultPromiseEndpoint the best priority for this? tr.trState->taskID = TaskPriority::DefaultPromiseEndpoint; diff --git a/flow/flow.cpp b/flow/flow.cpp index 7dd4e1f43b..06a3241f09 100644 --- a/flow/flow.cpp +++ b/flow/flow.cpp @@ -414,9 +414,10 @@ void bindDeterministicRandomToOpenssl() { if (ec) { ::ERR_error_string_n(ec, msg, sizeof(msg)); } - printf("ERROR: Failed to bind DeterministicRandom to OpenSSL RNG\n" - " OpenSSL error message: '%s'\n", - msg); + fprintf(stderr, + "ERROR: Failed to bind DeterministicRandom to OpenSSL RNG\n" + " OpenSSL error message: '%s'\n", + msg); throw internal_error(); } else { printf("DeterministicRandom successfully bound to OpenSSL RNG\n");