If we do a non-idempotent op and it does a commit itself, we don't see
fs->is_committed() true ever. Also count full commit cycles, and kill
ourselves after several of those have gone by.
Signed-off-by: Sage Weil <sage@newdream.net>
Mutex::Locker l(com_lock);
return committing_seq != committed_seq;
}
+ uint64_t get_committed_seq() {
+ Mutex::Locker l(com_lock);
+ return committed_seq;
+ }
public:
JournalingObjectStore() : op_seq(0),
bool committing = false;
uint64_t committed_at = 0;
+ uint64_t committed_seq = 0;
+ int num_commits = 0;
while (true) {
// build buffer
bufferlist bl;
}
}
if (committed_at && committed > committed_at + 100) {
- cout << " have seen several commits since the last journal flush, exiting to fake a crash" << std::endl;
+ cout << " have seen several ops commit since the last journal flush, exiting to fake a crash" << std::endl;
_exit(0);
}
+
+ if (fs->get_committed_seq() != committed_seq) {
+ num_commits++;
+ committed_seq = fs->get_committed_seq();
+ if (num_commits > 5) {
+ cout << " have seen several commit cycles, exiting to fake a crash" << std::endl;
+ _exit(0);
+ }
+ }
}
}