nizhikov commented on a change in pull request #9001:
URL: https://github.com/apache/ignite/pull/9001#discussion_r613842133
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
##########
@@ -1325,6 +1325,14 @@ private FileWriteHandle rollOver(FileWriteHandle cur,
@Nullable WALRecord rec) t
private FileWriteHandle restoreWriteHandle(@Nullable WALPointer
lastReadPtr) throws StorageException {
long absIdx = lastReadPtr == null ? 0 : lastReadPtr.index();
+ FileDescriptor[] walArchiveFiles = walArchiveFiles();
+
+ if (archiver != null &&
+ !F.isEmpty(walArchiveFiles) &&
+ absIdx <= walArchiveFiles[walArchiveFiles.length - 1].idx) {
+ absIdx = walArchiveFiles[walArchiveFiles.length - 1].idx + 1;
Review comment:
@tkalkirill
I see your point
> If we had written a record to the auto-rolloved segment
Write something just to make segment "nonempty" is the wrong approach - we
shouldn't do spare writes.
Moreover, spare write can not happen, also due to the write thread feeze.
So with some "fake" record we just make this issue less probable.
I think we should make a decision based on the currently existing
`SwitchSegmentRecord`.
Please, take a look at PR and my
[comment](https://github.com/apache/ignite/pull/9001#issuecomment-820201450)
> In the root cause of the current ticket, we do not write any WAL record to
the new segment
My understanding is different - the root cause of the issue is the failover
algorithm that, currently, can't distinguish between full and nonfull segments
during node start - this leads to the wrong decision on what segment Ignite
should continue to log into.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]