You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/04/14 07:15:28 UTC

[GitHub] [ignite] nizhikov commented on a change in pull request #9001: IGNITE-14516 Always log to not archived segment

nizhikov commented on a change in pull request #9001:
URL: https://github.com/apache/ignite/pull/9001#discussion_r612995101



##########
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:
       > 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)
   
   It's not an issue to continue to log into some segment if "rollover" happens before the restart, because there is nothing to lose(next segment is empty) and we just "write-ahead" to log.
   
   The issue happens if we already copy the current state of the segment to archive. 
   If we continue to log into copied segment then we lose newly logged records, because co




-- 
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:
users@infra.apache.org