diff options
author | Tor Egge <Tor.Egge@oath.com> | 2018-02-14 12:15:37 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@oath.com> | 2018-02-14 12:21:29 +0000 |
commit | a842c5d66a75bc73665a3ea6b9a1c2ba557b83ee (patch) | |
tree | 70487870ce0cee61f1f667ee729f41eb28df5e5e /storageapi/src | |
parent | 901668a427460089aefbf615c9353b75452e2e89 (diff) |
Don't log warning when failing to encode non-default bucketspace
for storage::api::RequestBucketInfoCommand.
Diffstat (limited to 'storageapi/src')
-rw-r--r-- | storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp | 20 |
1 files 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 <vespa/vespalib/util/exceptions.h> #include <vespa/document/util/stringutil.h> +#include <vespa/document/bucket/fixed_bucket_spaces.h> #include <sstream> #include <vespa/log/bufferedlogger.h> @@ -42,6 +43,14 @@ namespace { vespalib::Version version5_0beta(4, 3, 0); } + +static bool +suppressEncodeWarning(const api::StorageMessage *msg) +{ + const auto *req = dynamic_cast<const api::RequestBucketInfoCommand *>(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); |