If the system crashes when the WAL have just opened a new empty active segment and all closed segments are fully persisted and therefore deleted from the WAL, the WAL can lose track of the current batch id on start up. This happens because the empty active segment is the only reference the WAL has for the current batch id, which means the WAL would start from 0 again if this is deleted, causing duplicate batch ids.
If the system crashes when the WAL have just opened a new empty active segment and all closed segments are fully persisted and therefore deleted from the WAL, the WAL can lose track of the current batch id on start up. This happens because the empty active segment is the only reference the WAL has for the current batch id, which means the WAL would start from 0 again if this is deleted, causing duplicate batch ids.