/- librados
- async io
- list_objects
+ - perl swig wrapper
/- object classes
- optionally separate osd interfaces (ips) for clients and osds (replication, peering, etc.)
- fix readdir vs fragment race by keeping a separate frag pos, and ignoring dentries below it
mds
-- fix client op replay
- - ordering
- - should to set caps/lock states so that ops can proceed without revoking from client
- - need to make sure replayed ops finish before new ops proceed. globally across the cluster. ick.
- on replay, but dirty scatter replicas on lists so that they get flushed? or does rejoin handle that?
- linkage vs cdentry replicas and remote rename....
-- make recovery work with early replies
- - purge each session's unused preallocated inodes
- hard link backpointers
- anchor source dir
- build snaprealm for any hardlinked file
do_file_recover();
}
-
+void MDCache::purge_prealloc_ino(inodeno_t ino, Context *fin)
+{
+ object_t oid(ino, 0);
+ dout(10) << "purge_prealloc_ino " << ino << " oid " << oid << dendl;
+ ceph_object_layout ol = mds->osdmap->make_object_layout(oid,
+ mds->mdsmap->get_metadata_pg_pool());
+ SnapContext snapc;
+ mds->objecter->remove(oid, ol, snapc, g_clock.now(), 0, 0, fin);
+}
void do_file_recover();
void _recovered(CInode *in, int r);
+ void purge_prealloc_ino(inodeno_t ino, Context *fin);
+
+
public:
}
+struct C_MDS_session_purged : public Context {
+ Server *server;
+ Session *session;
+ C_MDS_session_purged(Server *s, Session *ss) : server(s), session(ss) {}
+ void finish(int r) {
+ server->_finish_session_purge(session);
+ }
+};
+
void Server::find_idle_sessions()
{
dout(10) << "find_idle_sessions" << dendl;
}
dout(10) << "autoclosing stale session " << session->inst << " last " << session->last_cap_renew << dendl;
- mds->sessionmap.set_state(session, Session::STATE_STALE_CLOSING);
- version_t pv = ++mds->sessionmap.projected;
- mdlog->submit_entry(new ESession(session->inst, false, pv),
- new C_MDS_session_finish(mds, session, false, pv));
- mdlog->flush();
+ if (session->prealloc_inos.empty()) {
+ _finish_session_purge(session);
+ } else {
+ mds->sessionmap.set_state(session, Session::STATE_STALE_PURGING);
+ C_Gather *fin = new C_Gather(new C_MDS_session_purged(this, session));
+ for (map<inodeno_t,inodeno_t>::iterator p = session->prealloc_inos.m.begin();
+ p != session->prealloc_inos.m.end();
+ p++) {
+ inodeno_t last = p->first + p->second;
+ for (inodeno_t i = p->first; i < last; i = i + 1)
+ mds->mdcache->purge_prealloc_ino(i, fin->new_sub());
+ }
+ }
}
+}
+void Server::_finish_session_purge(Session *session)
+{
+ dout(10) << "_finish_session_purge " << session->inst << dendl;
+ assert(session->is_stale_purging());
+ mds->sessionmap.set_state(session, Session::STATE_STALE_CLOSING);
+ version_t pv = ++mds->sessionmap.projected;
+ mdlog->submit_entry(new ESession(session->inst, false, pv),
+ new C_MDS_session_finish(mds, session, false, pv));
+ mdlog->flush();
}
}
}
-
void Server::recall_client_state(float ratio)
{
int max_caps_per_client = g_conf.mds_cache_size * .8;
void handle_client_session(class MClientSession *m);
void _session_logged(Session *session, bool open, version_t pv, interval_set<inodeno_t>& inos,version_t piv);
+ void _finish_session_purge(Session *);
version_t prepare_force_open_sessions(map<__u32,entity_inst_t> &cm);
void finish_force_open_sessions(map<__u32,entity_inst_t> &cm);
void terminate_sessions();
void process_reconnect_cap(CInode *in, int from, ceph_mds_cap_reconnect& capinfo);
void reconnect_gather_finish();
void reconnect_tick();
-
+
void recall_client_state(float ratio);
// -- requests --
static const int STATE_OPEN = 2;
static const int STATE_CLOSING = 3; // journaling close
static const int STATE_STALE = 4;
- static const int STATE_STALE_CLOSING = 5;
+ static const int STATE_STALE_PURGING = 5;
+ static const int STATE_STALE_CLOSING = 6;
//static const int STATE_RECONNECTING = 5; // ?
private:
bool is_open() { return state == STATE_OPEN; }
bool is_closing() { return state == STATE_CLOSING; }
bool is_stale() { return state == STATE_STALE; }
+ bool is_stale_purging() { return state == STATE_STALE_PURGING; }
bool is_stale_closing() { return state == STATE_STALE_CLOSING; }
// -- caps --