Skip to content

Commit

Permalink
topicctl bug fix for offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
ssingudasu committed Dec 13, 2023
1 parent 8ad90a7 commit c425205
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pkg/messages/bounds.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func GetPartitionBounds(
"Moving first offset forward to match min offset (%d)",
minOffset,
)
firstOffset = minOffset
firstOffset = minOffset - 1
}

var firstMessage kafka.Message
Expand Down Expand Up @@ -233,11 +233,18 @@ func GetPartitionBounds(
)
}

log.Debugf(
"Final offsets for %d: %d->%d",
partition,
firstMessage.Offset,
lastMessage.Offset,
)

return Bounds{
Partition: partition,
FirstOffset: firstMessage.Offset,
FirstTime: firstMessage.Time,
LastOffset: lastMessage.Offset,
LastOffset: lastMessage.Offset + 1,
LastTime: lastMessage.Time,
}, nil
}
Expand Down

0 comments on commit c425205

Please sign in to comment.