journal - reports full/CRC failed when it shouldn't
In several test runs, writing changesets to journal reported that journal is either full or failed to open completely with CRC error. This however didn't appear all the time, so it is probably a racing condition.
2013-11-07T01:47:26 [notice] Journal for 'example.com.' is full, flushing.
2013-11-07T01:47:26 [error] Incoming IXFR of 'example.com.' with '127.0.0.1@53531': Failed to serialize and store changesets: Requested
2013-11-07T01:47:26 [notice] Incoming IXFR of 'example.com.' with '127.0.0.1@53531': Can't fit the differences in the journal.
2013-11-07T01:47:26 [notice] Incoming IXFR of 'example.com.' with '127.0.0.1@53531': Retrying with AXFR.
2013-11-02T01:40:14 Incoming IXFR of 'example.com.' with '127.0.0.1@53531': Serial 2007120755 -> 2007120756.
2013-11-02T01:40:14 [warning] Journal file '/tmp/knot-test.master/.wd/slave-14987/example.com.diff.db' CRC error, it will be flushed.
2013-11-02T01:40:15 Incoming IXFR of 'example.com.' with '127.0.0.1@53531': Finished in 0.93s (finalization 0.92s).
Journal was refcounted and scheduler could start the journal flush process when an IXFR/UPDATE was still putting new changes. This could lead to marking some nodes as flushed while they weren't written yet and CRC calculated from the wrong data.