#define CEPH_FEATURE_OSD_HITSET_GMT (1ULL<<54)
#define CEPH_FEATURE_HAMMER_0_94_4 (1ULL<<55)
#define CEPH_FEATURE_NEW_OSDOP_ENCODING (1ULL<<56) /* New, v7 encoding */
+#define CEPH_FEATURE_MON_STATEFUL_SUB (1ULL<<57) /* stateful mon subscription */
#define CEPH_FEATURE_RESERVED2 (1ULL<<61) /* slow down, we are almost out... */
#define CEPH_FEATURE_RESERVED (1ULL<<62) /* DO NOT USE THIS ... last bit! */
CEPH_FEATURE_OSD_PROXY_WRITE_FEATURES | \
CEPH_FEATURE_OSD_HITSET_GMT | \
CEPH_FEATURE_HAMMER_0_94_4 | \
+ CEPH_FEATURE_MON_STATEFUL_SUB | \
0ULL)
#define CEPH_FEATURES_SUPPORTED_DEFAULT CEPH_FEATURES_ALL
} else if (!cur_mon.empty()) {
// just renew as needed
utime_t now = ceph_clock_now(cct);
- ldout(cct, 10) << "renew subs? (now: " << now
- << "; renew after: " << sub_renew_after << ") -- "
- << (now > sub_renew_after ? "yes" : "no")
- << dendl;
- if (now > sub_renew_after)
- _renew_subs();
+ if (!cur_con->has_feature(CEPH_FEATURE_MON_STATEFUL_SUB)) {
+ ldout(cct, 10) << "renew subs? (now: " << now
+ << "; renew after: " << sub_renew_after << ") -- "
+ << (now > sub_renew_after ? "yes" : "no")
+ << dendl;
+ if (now > sub_renew_after)
+ _renew_subs();
+ }
cur_con->send_keepalive();
if (cct->_conf->mon_client_ping_timeout > 0 &&
cur_con->has_feature(CEPH_FEATURE_MSGR_KEEPALIVE2)) {
utime_t lk = cur_con->get_last_keepalive_ack();
- utime_t interval = ceph_clock_now(cct) - lk;
+ utime_t interval = now - lk;
if (interval > cct->_conf->mon_client_ping_timeout) {
ldout(cct, 1) << "no keepalive since " << lk << " (" << interval
<< " seconds), reconnecting" << dendl;
void MonClient::handle_subscribe_ack(MMonSubscribeAck *m)
{
if (sub_renew_sent != utime_t()) {
+ // NOTE: this is only needed for legacy (infernalis or older)
+ // mons; see tick().
sub_renew_after = sub_renew_sent;
sub_renew_after += m->interval / 2.0;
ldout(cct, 10) << "handle_subscribe_ack sent " << sub_renew_sent << " renew after " << sub_renew_after << dendl;
}
}
- // ???
-
- if (reply)
- m->get_connection()->send_message(new MMonSubscribeAck(monmap->get_fsid(), (int)g_conf->mon_subscribe_interval));
+ if (reply) {
+ // we only need to reply if the client is old enough to think it
+ // has to send renewals.
+ ConnectionRef con = m->get_connection();
+ if (!con->has_feature(CEPH_FEATURE_MON_STATEFUL_SUB))
+ m->get_connection()->send_message(new MMonSubscribeAck(
+ monmap->get_fsid(), (int)g_conf->mon_subscribe_interval));
+ }
}