src/uv_truncate.c:58: Assertion `i < n_segments' failed
In the latest commit version: 05a49e0, one assertion failed: src/uv_truncate.c:58: void uvTruncateWorkCb(uv_work_t *): Assertion `i < n_segments'. Attached is the log file n_segments-assertion-failure.log. Hope it could help you debug.
Thanks for testing, always valuable! I'll have a look.
It seems what happens here is that our node believes that an open segment open-1 exists, and contains the entries at indices from 2 to 55. It decides to truncate its log at index 51 due to receiving messages from a more current leader, and the barrier for the truncate operation kicks off finalization of open-1 -- but that fails, because open-1 doesn't exist on disk for some reason. The truncation code then only sees one closed segment, which has index 1 only, and one empty open segment open-4, so it can't find the index it's looking for and trips the assertion.
Unfortunately, we're missing the earlier part of the log, which might tell us how open-1 ended up not existing. @jerrytesting, do you happen to have the complete log handy? What kind of setup/conditions were you using for this run?