From a842c5d66a75bc73665a3ea6b9a1c2ba557b83ee Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Wed, 14 Feb 2018 12:15:37 +0000 Subject: Don't log warning when failing to encode non-default bucketspace for storage::api::RequestBucketInfoCommand. --- .../vespa/storageapi/mbusprot/storageprotocol.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp b/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp index 6d1dc8d587b..e5b9b1f9102 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp +++ b/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp @@ -5,6 +5,7 @@ #include "storagereply.h" #include #include +#include #include #include @@ -42,6 +43,14 @@ namespace { vespalib::Version version5_0beta(4, 3, 0); } + +static bool +suppressEncodeWarning(const api::StorageMessage *msg) +{ + const auto *req = dynamic_cast(msg); + return ((req != nullptr) && (req->getBucketSpace() != document::FixedBucketSpaces::default_space())); +} + static mbus::Blob encodeMessage(const ProtocolSerialization & serializer, const mbus::Routable & routable, @@ -110,10 +119,13 @@ StorageProtocol::encode(const vespalib::Version& version, } } catch (std::exception & e) { - LOGBP(warning, "Failed to encode %s storage protocol message %s: %s", - version.toString().c_str(), - message.getInternalMessage()->toString().c_str(), - e.what()); + if (version < version6_0 && + !suppressEncodeWarning(message.getInternalMessage().get())) { + LOGBP(warning, "Failed to encode %s storage protocol message %s: %s", + version.toString().c_str(), + message.getInternalMessage()->toString().c_str(), + e.what()); + } } return mbus::Blob(0); -- cgit v1.2.3 From bb7bff48f5cfd64b3207f296950cb9b1c1c53004 Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Wed, 14 Feb 2018 14:03:09 +0000 Subject: Don't suppress warnings if protocol version is version6_0. --- storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp b/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp index e5b9b1f9102..30d6f5bd45c 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp +++ b/storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp @@ -119,8 +119,8 @@ StorageProtocol::encode(const vespalib::Version& version, } } catch (std::exception & e) { - if (version < version6_0 && - !suppressEncodeWarning(message.getInternalMessage().get())) { + if (!(version < version6_0 && + suppressEncodeWarning(message.getInternalMessage().get()))) { LOGBP(warning, "Failed to encode %s storage protocol message %s: %s", version.toString().c_str(), message.getInternalMessage()->toString().c_str(), -- cgit v1.2.3