OPTION(filestore_inject_stall, OPT_INT, 0) // artificially stall for N seconds in op queue thread
OPTION(filestore_fail_eio, OPT_BOOL, true) // fail/crash on EIO
OPTION(filestore_replica_fadvise, OPT_BOOL, true)
+OPTION(filestore_debug_verify_split, OPT_BOOL, false)
OPTION(journal_dio, OPT_BOOL, true)
OPTION(journal_aio, OPT_BOOL, false)
OPTION(journal_block_align, OPT_BOOL, true)
coll_t dest,
const SequencerPosition &spos)
{
- dout(15) << __func__ << " " << cid << " bits: " << bits << dendl;
- int dstcmp = _check_replay_guard(dest, spos);
- if (dstcmp < 0)
- return 0;
- if (dstcmp > 0 && !collection_empty(dest))
- return -ENOTEMPTY;
-
- int srccmp = _check_replay_guard(cid, spos);
- if (srccmp < 0)
- return 0;
-
- _set_replay_guard(cid, spos, true);
- _set_replay_guard(dest, spos, true);
-
- Index from;
- int r = get_index(cid, &from);
+ int r;
+ {
+ dout(15) << __func__ << " " << cid << " bits: " << bits << dendl;
+ int dstcmp = _check_replay_guard(dest, spos);
+ if (dstcmp < 0)
+ return 0;
+ if (dstcmp > 0 && !collection_empty(dest))
+ return -ENOTEMPTY;
- Index to;
- if (!r)
- r = get_index(dest, &to);
+ int srccmp = _check_replay_guard(cid, spos);
+ if (srccmp < 0)
+ return 0;
- if (!r)
- r = from->split(rem, bits, to);
+ _set_replay_guard(cid, spos, true);
+ _set_replay_guard(dest, spos, true);
- _close_replay_guard(cid, spos);
- _close_replay_guard(dest, spos);
+ Index from;
+ r = get_index(cid, &from);
+
+ Index to;
+ if (!r)
+ r = get_index(dest, &to);
+
+ if (!r)
+ r = from->split(rem, bits, to);
+
+ _close_replay_guard(cid, spos);
+ _close_replay_guard(dest, spos);
+ }
+ if (g_conf->filestore_debug_verify_split) {
+ vector<hobject_t> objects;
+ hobject_t next;
+ while (1) {
+ collection_list_partial(
+ cid,
+ next,
+ get_ideal_list_min(), get_ideal_list_max(), 0,
+ &objects,
+ &next);
+ if (objects.empty())
+ break;
+ for (vector<hobject_t>::iterator i = objects.begin();
+ i != objects.end();
+ ++i) {
+ assert(!i->match(bits, rem));
+ }
+ objects.clear();
+ }
+ next = hobject_t();
+ while (1) {
+ collection_list_partial(
+ dest,
+ next,
+ get_ideal_list_min(), get_ideal_list_max(), 0,
+ &objects,
+ &next);
+ if (objects.empty())
+ break;
+ for (vector<hobject_t>::iterator i = objects.begin();
+ i != objects.end();
+ ++i) {
+ assert(i->match(bits, rem));
+ }
+ objects.clear();
+ }
+ }
return r;
}