Skip to content

Commit

Permalink
fix(issues2038): fix timestamp to offset not found (#2039) (#2041)
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Han <[email protected]>
  • Loading branch information
superhx authored Sep 26, 2024
1 parent f22830a commit c8a0b17
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/scala/kafka/log/streamaspect/ElasticLog.scala
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,11 @@ class ElasticLog(val metaStream: MetaStream,
partitionMeta.setRecoverOffset(recoveryPoint)

maybeHandleIOException(s"Error while closing $topicPartition in dir ${dir.getParent}") {
CoreUtils.swallow(persistLogMeta(), this)
CoreUtils.swallow(checkIfMemoryMappedBufferClosed(), this)
CoreUtils.swallow(segments.close(), this)
// https://github.com/AutoMQ/automq/issues/2038
// ElasticLogMeta should be saved after all segments are closed cause of the last segment may append new time index when close.
CoreUtils.swallow(persistLogMeta(), this)
CoreUtils.swallow(persistPartitionMeta(), this)
CoreUtils.swallow(closeStreams().get(), this)
}
Expand Down

0 comments on commit c8a0b17

Please sign in to comment.