aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@oath.com>2018-02-14 15:29:44 +0100
committerGitHub <noreply@github.com>2018-02-14 15:29:44 +0100
commit48cbaea4364894bae522ba8bff89305e2798fe4a (patch)
tree8b28e942710204a8eae9366bfea99106d858f1aa
parenteadf1968da3755ae6318c5624b454d329ccf745b (diff)
parentbb7bff48f5cfd64b3207f296950cb9b1c1c53004 (diff)
Merge pull request #5038 from vespa-engine/toregge/suppress-log-warning-for-requestbucketinfocommand
Don't log warning when failing to encode non-default bucketspace
-rw-r--r--storageapi/src/vespa/storageapi/mbusprot/storageprotocol.cpp20
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..30d6f5bd45c 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);