If a broker uploaded a segment to the remote, but didn't delete it locally and was restarted, it will not delete the local segment after restart until the next segment is uploaded. Most likely, because this remains -1 until the next segment upload (in this log).
Possible fix: update highestOffsetWithRemoteIndex on start for the leader.
If a broker uploaded a segment to the remote, but didn't delete it locally and was restarted, it will not delete the local segment after restart until the next segment is uploaded. Most likely, because this remains -1 until the next segment upload (in this log).
Possible fix: update
highestOffsetWithRemoteIndex
on start for the leader.