Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
I think this could only happen when the FSWAL has not been initialized yet, in this way we should return OptionalLong.of(0) instead of OptionalLong.empty(). As in the replication implenentation, if we can make sure a file is not being written any more, we will dequeue it and go to the next file.
Although in the current implementation, it should not be a problem and we will only test beingWritten after reading from a WAL file, but since the FSWAL has not been initialized yet, the replication queue of this FSWAL should not be initialized too, so we are safe for now.
But anyway, this is still a potential bug if we change the implementation in the future, so let's change it OptionalLong.of(0) and let replication framework know that it should wait a bit.