sashapolo commented on code in PR #7101:
URL: https://github.com/apache/ignite-3/pull/7101#discussion_r2597721484
##########
modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/segstore/SegmentFileManager.java:
##########
@@ -337,17 +364,22 @@ private WriteBufferWithMemtable
reserveBytesWithRollover(int size) throws IOExce
* storage, not taking pending in-memory state into account.
*/
long firstLogIndexInclusiveOnRecovery(long groupId) {
+ SegmentFileWithMemtable currentSegmentFile =
this.currentSegmentFile.get();
+
+ SegmentInfo segmentInfo =
currentSegmentFile.memtable().segmentInfo(groupId);
+
+ // We need to consult with the latest memtable in case it contains a
prefix tombstone.
+ if (segmentInfo != null && segmentInfo.firstIndexKept() != -1) {
+ return segmentInfo.firstIndexKept();
+ }
+
long firstLogIndexFromIndexStorage =
indexFileManager.firstLogIndexInclusive(groupId);
Review Comment:
This method returns the smallest log index present in the storage. Most
recent memtable only contains information about the "tail" of the storage.
Therefore we need to look in the old index files first. We still need to peek
in the latest memtable first, because it can contain a not yet persisted prefix
tombstone (so IndexFileManager doesn't know about it).
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]