From: Yan, Zheng Date: Fri, 19 Jan 2018 23:07:57 +0000 (+0800) Subject: mds: don't try opening inodes that haven't been created X-Git-Tag: v13.1.0~436^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2154c2bca256d7885d4d36db23aec10ff5b6b96f;p=ceph.git mds: don't try opening inodes that haven't been created Signed-off-by: Yan, Zheng --- diff --git a/src/mds/MDCache.h b/src/mds/MDCache.h index ed138f3078a4..f271592384c4 100644 --- a/src/mds/MDCache.h +++ b/src/mds/MDCache.h @@ -600,6 +600,9 @@ public: bool rejoin_has_cap_reconnect(inodeno_t ino) const { return cap_imports.count(ino); } + void add_replay_ino_alloc(inodeno_t ino) { + cap_imports_missing.insert(ino); // avoid opening ino during cache rejoin + } const cap_reconnect_t *get_replay_cap_reconnect(inodeno_t ino, client_t client) { if (cap_imports.count(ino) && cap_imports[ino].count(client) && diff --git a/src/mds/Server.cc b/src/mds/Server.cc index b78c04ec71c9..8f365378ac30 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -214,6 +214,10 @@ void Server::dispatch(Message *m) if (req->is_replay()) { dout(3) << "queuing replayed op" << dendl; queue_replay = true; + if (req->head.ino && + !session->have_completed_request(req->get_reqid().tid, nullptr)) { + mdcache->add_replay_ino_alloc(inodeno_t(req->head.ino)); + } } else if (req->get_retry_attempt()) { // process completed request in clientreplay stage. The completed request // might have created new file/directorie. This guarantees MDS sends a reply