summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-07-14 15:54:29 -0700
committerSage Weil <sage@inktank.com>2013-07-15 15:33:08 -0700
commit595c09df9134fb0d62144fe1594914c90e567dca (patch)
tree14af9bf6ca15ccc18fba8cbd4ceece9a19fa13af
parent8c178e0d39d8d4a4820eb061f79d74f95e60199f (diff)
downloadceph-595c09df9134fb0d62144fe1594914c90e567dca.tar.gz
messages/MClientReconnect: clear data when encoding
The MClientReconnect puts everything in the data payload portion of the message and nothing in the front portion. That means that if the message is resent (socket failure or something), the messenger thinks it hasn't been encoded yet (front empty) and reencodes, which means everything gets added (again) to the data portion. Decoding keep decoding until it runs out of data, so the second copy means we decode garbage snap realms, leading to the crash in bug Clearing data each time around resolves the problem, although it does mean we do the encoding work multiple times. We could alternatively (or also) stick some data in the front portion of the payload (ignored), but that changes the wire protocol and I would rather not do that. Fixes: #4565 Backport: cuttlefish Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Greg Farnum <greg@inktank.com> (cherry picked from commit 314cf046b0b787ca69665e8751eab6fe7adb4037)
-rw-r--r--src/messages/MClientReconnect.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/messages/MClientReconnect.h b/src/messages/MClientReconnect.h
index 21f0021f31f..4e2839cab69 100644
--- a/src/messages/MClientReconnect.h
+++ b/src/messages/MClientReconnect.h
@@ -53,6 +53,7 @@ public:
}
void encode_payload(uint64_t features) {
+ data.clear();
if (features & CEPH_FEATURE_MDSENC) {
::encode(caps, data);
} else if (features & CEPH_FEATURE_FLOCK) {