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

Function test_error

src/osd/ECInject.cc:262–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260 }
261
262 static bool test_error(const ghobject_t& o,
263 std::map<ghobject_t,std::pair<int64_t,int64_t>> *failures)
264 {
265 std::lock_guard<ceph::recursive_mutex> l(lock);
266 auto it = failures->find(o);
267 if (it == failures->end()) {
268 ghobject_t os = o;
269 os.hobj.oid.name = "*";
270 os.hobj.set_hash(0);
271 it = failures->find(os);
272 }
273 if (it != failures->end()) {
274 auto && [when,duration] = it->second;
275 if (when > 0) {
276 when--;
277 return false;
278 }
279 if (--duration <= 0) {
280 failures->erase(it);
281 }
282 return true;
283 }
284 return false;
285 }
286
287 bool test_read_error0(const ghobject_t& o)
288 {

Callers 5

test_read_error0Function · 0.85
test_read_error1Function · 0.85
test_write_error1Function · 0.85
test_write_error2Function · 0.85
test_write_error3Function · 0.85

Calls 4

findMethod · 0.45
endMethod · 0.45
set_hashMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected