summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/protocol.h5
-rw-r--r--xlators/protocol/client/src/client-protocol.c10
-rw-r--r--xlators/protocol/server/src/server-protocol.c8
3 files changed, 14 insertions, 9 deletions
diff --git a/libglusterfs/src/protocol.h b/libglusterfs/src/protocol.h
index b17f83bcd..10db213f5 100644
--- a/libglusterfs/src/protocol.h
+++ b/libglusterfs/src/protocol.h
@@ -35,6 +35,11 @@
#include "byte-order.h"
+/* Any changes in the protocol structure or adding new '[f,m]ops' needs to
+ * bump the protocol version by "0.1"
+ */
+/* Protocol version 1.0 was ASCII based dictionary protocol */
+#define GF_PROTOCOL_VERSION "2.0"
struct gf_stat {
uint64_t ino;
diff --git a/xlators/protocol/client/src/client-protocol.c b/xlators/protocol/client/src/client-protocol.c
index 261027648..096713687 100644
--- a/xlators/protocol/client/src/client-protocol.c
+++ b/xlators/protocol/client/src/client-protocol.c
@@ -6125,11 +6125,11 @@ protocol_client_handshake (xlator_t *this, transport_t *trans)
char *process_uuid_xl;
options = this->options;
- ret = dict_set_str (options, "version", PACKAGE_VERSION);
+ ret = dict_set_str (options, "protocol-version", GF_PROTOCOL_VERSION);
if (ret < 0) {
gf_log (this->name, GF_LOG_DEBUG,
- "failed to set version(%s) in options dictionary",
- PACKAGE_VERSION);
+ "failed to set protocol version(%s) in handshake msg",
+ GF_PROTOCOL_VERSION);
}
asprintf (&process_uuid_xl, "%s-%s", this->ctx->process_uuid,
@@ -6138,8 +6138,8 @@ protocol_client_handshake (xlator_t *this, transport_t *trans)
process_uuid_xl);
if (ret < 0) {
gf_log (this->name, GF_LOG_DEBUG,
- "failed to set process-uuid(%s) in options dictionary",
- PACKAGE_VERSION);
+ "failed to set process-uuid(%s) in handshake msg",
+ process_uuid_xl);
}
if (this->ctx->cmd_args.volfile_server) {
diff --git a/xlators/protocol/server/src/server-protocol.c b/xlators/protocol/server/src/server-protocol.c
index 6faf0a517..accd8358f 100644
--- a/xlators/protocol/server/src/server-protocol.c
+++ b/xlators/protocol/server/src/server-protocol.c
@@ -6955,7 +6955,7 @@ mop_setvolume (call_frame_t *frame, xlator_t *bound_xl,
if (trans->xl_private != conn)
trans->xl_private = conn;
- ret = dict_get_str (params, "version", &version);
+ ret = dict_get_str (params, "protocol-version", &version);
if (ret < 0) {
ret = dict_set_str (reply, "ERROR",
"No version number specified");
@@ -6968,11 +6968,11 @@ mop_setvolume (call_frame_t *frame, xlator_t *bound_xl,
goto fail;
}
- ret = strcmp (version, PACKAGE_VERSION);
+ ret = strcmp (version, GF_PROTOCOL_VERSION);
if (ret != 0) {
asprintf (&msg,
- "Version mismatch: client(%s) Vs server (%s)",
- version, PACKAGE_VERSION);
+ "protocol version mismatch: client(%s) - server(%s)",
+ version, GF_PROTOCOL_VERSION);
ret = dict_set_dynstr (reply, "ERROR", msg);
if (ret < 0)
gf_log (trans->xl->name, GF_LOG_DEBUG,