@@ -107,17 +107,12 @@ public LoadedLogOffsets load() throws IOException {
107107 // WriterStateManager used during log recovery may have deleted some files without the
108108 // LogLoader.writerStateManager instance witnessing the deletion.
109109 writerStateManager .removeStraySnapshots (logSegments .baseOffsets ());
110-
111- // TODO, Here, we use 0 as the logStartOffset passed into rebuildWriterState. The reason is
112- // that the current implementation of logStartOffset in Fluss is not yet fully refined, and
113- // there may be cases where logStartOffset is not updated. As a result, logStartOffset is
114- // not yet reliable. Once the issue with correctly updating logStartOffset is resolved in
115- // issue https://github.com/apache/fluss/issues/744, we can use logStartOffset here.
116- // Additionally, using 0 versus using logStartOffset does not affect correctness—they both
117- // can restore the complete WriterState. The only difference is that using logStartOffset
118- // can potentially skip over more segments.
119110 LogTablet .rebuildWriterState (
120- writerStateManager , logSegments , 0 , nextOffset , isCleanShutdown );
111+ writerStateManager ,
112+ logSegments ,
113+ logStartOffsetCheckpoint ,
114+ nextOffset ,
115+ isCleanShutdown );
121116
122117 LogSegment activeSegment = logSegments .lastSegment ().get ();
123118 activeSegment .resizeIndexes ((int ) conf .get (ConfigOptions .LOG_INDEX_FILE_SIZE ).getBytes ());
@@ -261,16 +256,12 @@ private int recoverSegment(LogSegment segment) throws IOException {
261256 logSegments .getTableBucket (),
262257 logTabletDir ,
263258 this .writerStateManager .writerExpirationMs ());
264- // TODO, Here, we use 0 as the logStartOffset passed into rebuildWriterState. The reason is
265- // that the current implementation of logStartOffset in Fluss is not yet fully refined, and
266- // there may be cases where logStartOffset is not updated. As a result, logStartOffset is
267- // not yet reliable. Once the issue with correctly updating logStartOffset is resolved in
268- // issue https://github.com/apache/fluss/issues/744, we can use logStartOffset here.
269- // Additionally, using 0 versus using logStartOffset does not affect correctness—they both
270- // can restore the complete WriterState. The only difference is that using logStartOffset
271- // can potentially skip over more segments.
272259 LogTablet .rebuildWriterState (
273- writerStateManager , logSegments , 0 , segment .getBaseOffset (), false );
260+ writerStateManager ,
261+ logSegments ,
262+ logStartOffsetCheckpoint ,
263+ segment .getBaseOffset (),
264+ false );
274265 int bytesTruncated = segment .recover ();
275266 // once we have recovered the segment's data, take a snapshot to ensure that we won't
276267 // need to reload the same segment again while recovering another segment.
0 commit comments