summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@oath.com>2018-02-08 13:08:12 +0000
committerTor Egge <Tor.Egge@oath.com>2018-02-08 14:02:15 +0000
commit8e6906d57191b7fef632e44290a97bf409483422 (patch)
tree0437be855e59f544652a9ef5f042b8838d71ea40
parent14c2d45e53c6efa8c07cbe5164ad908bb5f229bc (diff)
Handle rolling upgrade where some storage nodes use old storage api protocol
while some distributor nodes tracks multiple bucket spaces.
-rw-r--r--storage/src/vespa/storage/distributor/pendingclusterstate.cpp7
-rw-r--r--storageapi/src/vespa/storageapi/messageapi/returncode.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/storage/src/vespa/storage/distributor/pendingclusterstate.cpp b/storage/src/vespa/storage/distributor/pendingclusterstate.cpp
index 51ef710d316..d5d105c862b 100644
--- a/storage/src/vespa/storage/distributor/pendingclusterstate.cpp
+++ b/storage/src/vespa/storage/distributor/pendingclusterstate.cpp
@@ -232,7 +232,12 @@ PendingClusterState::onRequestBucketInfoReply(const std::shared_ptr<api::Request
}
const BucketSpaceAndNode bucketSpaceAndNode = iter->second;
- if (!reply->getResult().success()) {
+ api::ReturnCode result(reply->getResult());
+ if (result== api::ReturnCode::Result::ENCODE_ERROR) {
+ // Handle failure to encode bucket space due to use of old storage api
+ // protocol. Pretend that request succeeded with no buckets returned.
+ LOG(debug, "Got ENCODE_ERROR, pretending success with no buckets");
+ } else if (!result.success()) {
framework::MilliSecTime resendTime(_clock);
resendTime += framework::MilliSecTime(100);
_delayedRequests.emplace_back(resendTime, bucketSpaceAndNode);
diff --git a/storageapi/src/vespa/storageapi/messageapi/returncode.h b/storageapi/src/vespa/storageapi/messageapi/returncode.h
index af4f14c1eeb..78f2168e170 100644
--- a/storageapi/src/vespa/storageapi/messageapi/returncode.h
+++ b/storageapi/src/vespa/storageapi/messageapi/returncode.h
@@ -30,6 +30,7 @@ public:
/** Return status codes */
enum Result {
OK = mbus::ErrorCode::NONE,
+ ENCODE_ERROR = mbus::ErrorCode::ENCODE_ERROR,
EXISTS = Protocol::ERROR_EXISTS,