Don't log warning when failing to encode non-default bucketspace
for storage::api::RequestBucketInfoCommand.
#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,11 +119,14 @@ StorageProtocol::encode(const vespalib::Version& version,
}
} catch (std::exception & e) {
+ 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);
}
