Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
0.10.0.1
-
None
-
None
-
None
Description
While reviewing KIP-33, I noticed that there are a few places that we can improve in closing a log.
1. In FileMessageSet.close(): We should probably call flush after trim since the later could change the size of the file channel.
2. AbstractIndex.close(): We should call flush at the end.
3. In Log.close(), if we hit an IOException, currently we just log it and proceed with a clean shutdown. However, an IOException could leave the log or indexes (e.g., when calling flush()) in a corrupted state. So, we probably should halt the jvm in this case to force log recovery on restart.