Mmuzaf commented on a change in pull request #9001:
URL: https://github.com/apache/ignite/pull/9001#discussion_r612671010
##########
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:
Is it correct to set the segment index based on the wal-archive
directory? As far as I understand, the issue about the rolling over a segment
that we are losing the node stop.
So, in the test `testWallRollover` the following line returns different
segment index on the second iteration (after th node restart):
`long cutIdx = aware.curAbsWalIdx();`
1. if the WAL archive enabled `cutIdx=0` on the first iteration and
`cutIdx=1` on the second iteration (this is correct)
2. if the WAL archive disabled `cutIdx=0` on the first iteration and
`cutIdx=0` on the second iteration, however, the rollover already happened and
after restart, the node will log entries to the incorrect WAL segment (this
should be fixed)
--
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]