MCPcopy Create free account
hub / github.com/ceph/ceph / finish

Method finish

src/mds/Server.cc:3787–3812  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3785 C_MDS_TryFindInode(Server *s, const MDRequestRef& r, MDCache *m, inodeno_t i) :
3786 ServerContext(s), mdr(r), mdcache(m), ino(i) {}
3787 void finish(int r) override {
3788 if (r == -ESTALE) { // :( find_ino_peers failed
3789 /*
3790 * There has one case that when the MDS crashes and the
3791 * openfiletable journal couldn't be flushed and then
3792 * the replacing MDS is possibly won't load some already
3793 * opened CInodes into the MDCache. And if the clients
3794 * will retry some requests after reconnected, the MDS
3795 * will return -ESTALE after failing to find the ino in
3796 * all active peers.
3797 *
3798 * As a workaround users can run `ls -R ${mountpoint}`
3799 * to list all the sub-files or sub-direcotries from the
3800 * mountpoint.
3801 *
3802 * We need try to open the ino and try it again.
3803 */
3804 CInode *in = mdcache->get_inode(ino);
3805 if (in && in->state_test(CInode::STATE_PURGING))
3806 server->respond_to_request(mdr, r);
3807 else
3808 mdcache->open_ino(ino, (int64_t)-1, new C_MDS_TryOpenInode(server, mdr, ino));
3809 } else {
3810 server->dispatch_client_request(mdr);
3811 }
3812 }
3813};
3814
3815CInode* Server::rdlock_path_pin_ref(const MDRequestRef& mdr,

Callers

nothing calls this directly

Calls 5

respond_to_requestMethod · 0.80
open_inoMethod · 0.80
get_inodeMethod · 0.45
state_testMethod · 0.45

Tested by

no test coverage detected