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

Method tick

src/osdc/Objecter.cc:2227–2336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2225}
2226
2227void Objecter::tick()
2228{
2229 shared_lock rl(rwlock);
2230
2231 ldout(cct, 10) << "tick" << dendl;
2232
2233 // we are only called by C_Tick
2234 tick_event = 0;
2235
2236 if (!initialized) {
2237 // we raced with shutdown
2238 ldout(cct, 10) << __func__ << " raced with shutdown" << dendl;
2239 return;
2240 }
2241
2242 set<OSDSession*> toping;
2243
2244
2245 // look for laggy requests
2246 auto cutoff = ceph::coarse_mono_clock::now();
2247 cutoff -= ceph::make_timespan(cct->_conf->objecter_timeout); // timeout
2248
2249 unsigned laggy_ops = 0;
2250
2251 for (auto siter = osd_sessions.begin();
2252 siter != osd_sessions.end(); ++siter) {
2253 auto s = siter->second;
2254 scoped_lock l(s->lock);
2255 bool found = false;
2256 for (auto p = s->ops.begin(); p != s->ops.end(); ++p) {
2257 auto op = p->second;
2258 ceph_assert(op->session);
2259 if (op->stamp < cutoff) {
2260 ldout(cct, 2) << " tid " << p->first << " on osd." << op->session->osd
2261 << " is laggy" << dendl;
2262 found = true;
2263 ++laggy_ops;
2264 }
2265 }
2266 for (auto p = s->linger_ops.begin();
2267 p != s->linger_ops.end();
2268 ++p) {
2269 auto op = p->second;
2270 std::unique_lock wl(op->watch_lock);
2271 ceph_assert(op->session);
2272 ldout(cct, 10) << " pinging osd that serves lingering tid " << p->first
2273 << " (osd." << op->session->osd << ")" << dendl;
2274 found = true;
2275 if (op->is_watch && op->registered && !op->last_error)
2276 _send_linger_ping(op);
2277 }
2278 for (auto p = s->command_ops.begin();
2279 p != s->command_ops.end();
2280 ++p) {
2281 auto op = p->second;
2282 ceph_assert(op->session);
2283 ldout(cct, 10) << " pinging osd that serves command tid " << p->first
2284 << " (osd." << op->session->osd << ")" << dendl;

Callers

nothing calls this directly

Calls 13

make_timespanFunction · 0.85
reschedule_meMethod · 0.80
nowFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
emptyMethod · 0.45
get_epochMethod · 0.45
get_startMethod · 0.45
countMethod · 0.45
setMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected