tests/jfill failure
dkoreshkov opened this issue · 7 comments
Hello!
I added a call to srandom(time(NULL)) into sim_reset and ran "while tests/jfill.test; do :; done"
After a while:
jfill.test: tests/jtutil.c:61: jt_check: Assertion `root_offset < raw_size' failed.
At the time of the failure root is before tail: root 862, tail 864, head 872
It seems that the error recovery in journal_enqueue sometimes leaves a largish gap between root and head, so that journal_peek/dequeue get confused.
Oh, here is another one, takes longer to reproduce:
map.test: tests/map.c:68: check_recurse: Assertion `offset < p_offset' failed.
offset is -1
Well, the crash in map.test goes away when doing journal_dequeue in map_sync only if raw_gc was successful...
Many thanks for your replies, Daniel!
It seems the last fix could be simpler--clear the root just before incrementing the tail:
if (j->tail == j->root)
j->root = DHARA_PAGE_NONE;
j->tail = next_upage(j, j->tail);