Client re-send cap flush when MDS restarts. The cap flush message
may release some caps even if the corresponding flush is already
completed.
Fixes: #13546
Signed-off-by: Yan, Zheng <zyan@redhat.com>
ack->set_snap_follows(follows);
ack->set_client_tid(m->get_client_tid());
mds->send_message_client_counted(ack, m->get_connection());
- m->put();
- return;
+ if (m->get_op() == CEPH_CAP_OP_FLUSHSNAP) {
+ m->put();
+ return;
+ } else {
+ // fall-thru because the message may release some caps
+ m->clear_dirty();
+ m->set_op(CEPH_CAP_OP_UPDATE);
+ }
}
// "oldest flush tid" > 0 means client uses unique TID for each flush
void set_oldest_flush_tid(ceph_tid_t tid) { oldest_flush_tid = tid; }
ceph_tid_t get_oldest_flush_tid() { return oldest_flush_tid; }
+ void clear_dirty() { head.dirty = 0; }
+
MClientCaps()
: Message(CEPH_MSG_CLIENT_CAPS, HEAD_VERSION, COMPAT_VERSION),
osd_epoch_barrier(0),