Skip to contentSkip to conversation

libceph : client only want latest osdmap. If the gap with the latest version exceeds the threshold, mon will send the fullosdmap instead of incremental osdmap

PATCH In review simon gao 2 participants 3 messages Jul 11, 2020 – Jul 14, 2020 Ceph common code (libceph)

lore
Share & tools
lore

simon gao

author
#0 lore raw

PATCH 1/1 libceph : client only want latest osdmap. If the gap with the latest version exceeds the threshold, mon will send the fullosdmap instead of incremental osdmap

Fix: https://tracker.ceph.com/issues/43421

---
 include/linux/ceph/ceph_fs.h | 1 +
 net/ceph/mon_client.c        | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
include/linux/ceph/ceph_fs.h +1 -0
index ebf5ba6..9dcc132 100644
@@ -208,6 +208,7 @@ struct ceph_client_mount {
 } __attribute__ ((packed));
 
 #define CEPH_SUBSCRIBE_ONETIME    1  /* i want only 1 update after have */
+#define CEPH_SUBSCRIBE_LATEST_OSDMAP   2  /* i want the latest fullmap, for client */ 
 
 struct ceph_mon_subscribe_item {
 	__le64 start;
net/ceph/mon_client.c +2 -1
index 3d8c801..8d67671 100644
@@ -349,7 +349,8 @@ static bool __ceph_monc_want_map(struct ceph_mon_client *monc, int sub,
 {
 	__le64 start = cpu_to_le64(epoch);
 	u8 flags = !continuous ? CEPH_SUBSCRIBE_ONETIME : 0;
-
+	if (CEPH_SUB_OSDMAP == sub)
+            flags |= CEPH_SUBSCRIBE_LATEST_OSDMAP;
 	dout("%s %s epoch %u continuous %d\n", __func__, ceph_sub_str[sub],
 	     epoch, continuous);
 
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw
Quoted 25 lines · simon gao

Fix: https://tracker.ceph.com/issues/43421

---
 include/linux/ceph/ceph_fs.h | 1 +
 net/ceph/mon_client.c        | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
include/linux/ceph/ceph_fs.h +1 -0
index ebf5ba6..9dcc132 100644
@@ -208,6 +208,7 @@ struct ceph_client_mount {
 } __attribute__ ((packed));
 
 #define CEPH_SUBSCRIBE_ONETIME    1  /* i want only 1 update after have */
+#define CEPH_SUBSCRIBE_LATEST_OSDMAP   2  /* i want the latest fullmap, for client */
 
 struct ceph_mon_subscribe_item {
        __le64 start;
net/ceph/mon_client.c +0 -0
index 3d8c801..8d67671 100644

net/ceph/mon_client.c static bool __ceph_monc_want_map(struct ceph_mon_client *monc, int sub, · line 355

Quoted 8 lines
net/ceph/mon_client.c +2 -1
@@ -349,7 +349,8 @@ static bool __ceph_monc_want_map(struct ceph_mon_client *monc, int sub,
 {
        __le64 start = cpu_to_le64(epoch);
        u8 flags = !continuous ? CEPH_SUBSCRIBE_ONETIME : 0;
-
+       if (CEPH_SUB_OSDMAP == sub)
+            flags |= CEPH_SUBSCRIBE_LATEST_OSDMAP;
        dout("%s %s epoch %u continuous %d\n", __func__, ceph_sub_str[sub],
             epoch, continuous);

I left my comments in https://github.com/ceph/ceph/pull/32422.
This patch cannot be considered unless a corresponding change is merged into Objecter.

Thanks,

Ilya

author
#2 lore raw

hi idryomov
I've already replied to you under this patch.
thanks.
gao yu

Quoted 43 lines · Ilya Dryomov <[email protected]> 于2020年7月13日周一 下午10:01写道:
Quoted 25 lines · simon gao

Fix: https://tracker.ceph.com/issues/43421

---
 include/linux/ceph/ceph_fs.h | 1 +
 net/ceph/mon_client.c        | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
include/linux/ceph/ceph_fs.h +1 -0
index ebf5ba6..9dcc132 100644
@@ -208,6 +208,7 @@ struct ceph_client_mount {
 } __attribute__ ((packed));
 
 #define CEPH_SUBSCRIBE_ONETIME    1  /* i want only 1 update after have */
+#define CEPH_SUBSCRIBE_LATEST_OSDMAP   2  /* i want the latest fullmap, for client */
 
 struct ceph_mon_subscribe_item {
        __le64 start;
net/ceph/mon_client.c +0 -0
index 3d8c801..8d67671 100644

net/ceph/mon_client.c static bool __ceph_monc_want_map(struct ceph_mon_client *monc, int sub, · line 355

Quoted 8 lines
net/ceph/mon_client.c +2 -1
@@ -349,7 +349,8 @@ static bool __ceph_monc_want_map(struct ceph_mon_client *monc, int sub,
 {
        __le64 start = cpu_to_le64(epoch);
        u8 flags = !continuous ? CEPH_SUBSCRIBE_ONETIME : 0;
-
+       if (CEPH_SUB_OSDMAP == sub)
+            flags |= CEPH_SUBSCRIBE_LATEST_OSDMAP;
        dout("%s %s epoch %u continuous %d\n", __func__, ceph_sub_str[sub],
             epoch, continuous);

I left my comments in https://github.com/ceph/ceph/pull/32422.
This patch cannot be considered unless a corresponding change is merged into Objecter.

Thanks,

Ilya