Trim old caps. Still need to make it an LRU.
- preserve pg logs on disk for longer period
- make scrub interruptible
- salvage some way to allow both RMW and DELAYED mode ops?
+ - make the mode per-pg? then at least per-pool access patterns will behave.
- optionally separate osd interfaces (ips) for clients and osds (replication, peering, etc.)
- pg repair
- pg split should be a work queue
- optimize remove wrt recovery pushes?
userspace client
+- make session cap list an LRU
+ - make caps_issued_mask, touch_cap helpers to || kclient
- clean up client mds session vs mdsmap behavior?
- stop using mds's inode_t?
- fix readdir vs fragment race by keeping a separate frag pos, and ignoring dentries below it
mds_sessions[from].was_stale = true;
renew_caps(from);
break;
+
+ case CEPH_SESSION_RECALL_STATE:
+ trim_caps(from, m->get_max_caps());
+ break;
+
default:
assert(0);
}
remove_cap(in, in->caps.begin()->first);
}
-void Client::remove_session_caps(int mds_num) {
- MDSSession* mds = &mds_sessions[mds_num];
+void Client::remove_session_caps(int mds_num)
+{
+ MDSSession *mds = &mds_sessions[mds_num];
while (mds->caps.size())
remove_cap((*mds->caps.begin())->inode, mds_num);
}
+void Client::trim_caps(int mds, int max)
+{
+ dout(10) << "trim_caps mds" << mds << " max" << max << dendl;
+ MDSSession *s = &mds_sessions[mds];
+
+ int trimmed = 0;
+ xlist<InodeCap*>::iterator p = s->caps.begin();
+ while (s->caps.size() > max && !p.end()) {
+ InodeCap *cap = *p;
+ ++p;
+ Inode *in = cap->inode;
+ if (in->caps_used() ||
+ in->caps_dirty()) {
+ dout(20) << " keeping cap on " << *in << " used " << ccap_string(in->caps_used())
+ << " dirty " << ccap_string(in->caps_dirty()) << dendl;
+ continue;
+ }
+ dout(20) << " removing unused cap on " << *in << dendl;
+ remove_cap(in, mds);
+ trimmed++;
+ }
+}
+
void Client::mark_caps_dirty(Inode *in, int caps)
{
dout(10) << "mark_caps_dirty " << *in << " " << ccap_string(in->dirty_caps) << " -> "
void remove_cap(Inode *in, int mds);
void remove_all_caps(Inode *in);
void remove_session_caps(int mds_num);
+ void trim_caps(int mds, int max);
void mark_caps_dirty(Inode *in, int caps);
void maybe_update_snaprealm(SnapRealm *realm, snapid_t snap_created, snapid_t snap_highwater,
int get_op() { return head.op; }
version_t get_seq() { return head.seq; }
utime_t get_stamp() { return utime_t(head.stamp); }
+ int get_max_caps() { return head.max_caps; }
+ int get_max_leases() { return head.max_leases; }
MClientSession() : Message(CEPH_MSG_CLIENT_SESSION) { }
MClientSession(int o, version_t s=0) :