Closed ivanyu closed 1 year ago
On which branch is this happening?
3.3-2022-10-06-tiered-storage
Did you try running on 3.0
to see if its also there?
Reproduces on 3.3-2022-10-06-tiered-storage
, but works as expected on 3.0-li
. The 10000
segment is not rolled on 3.0, so the 9920
remains active and not deleted.
It seems, on 3.3 it reproduces inconsistently, so I can't guarantee it doesn't happen on 3.0 as well.
UPD: no, it's consistent. The segment roll happens as the same moment as first deletion:
[2023-04-21 13:33:12,765] INFO [LocalLog partition=topic1-0, dir=/home/ivanyu/kafka/kafka-ts-development/_run-kafka-logs] Rolled new log segment at offset 10000 in 4 ms. (kafka.log.LocalLog)
[2023-04-21 13:33:12,784] INFO [ProducerStateManager partition=topic1-0] Wrote producer snapshot at offset 10000 with 0 producer ids in 19 ms. (kafka.log.ProducerStateManager)
[2023-04-21 13:33:12,786] INFO [UnifiedLog partition=topic1-0, dir=/home/ivanyu/kafka/kafka-ts-development/_run-kafka-logs] Deleting segment LogSegment(baseOffset=0, size=502355, lastModifiedTime=1682073046965, largestRecordTimestamp=Some(1682073046848)) due to retention time 120000ms breach based on the largest record timestamp in the segment (kafka.log.UnifiedLog)
@ivanyu I believe I have found the root cause for the fix, can you apply this patch onto the 3.3 branch and confirm whether it solves the problem or not?
Seems to be working with the patch: the 10000 segment is not created and the 9920 one remains the active.
Perfect thanks! I need to update my github subscriptions, I missed this.
Force updating the branch now with the patch.
Closing ticket, the 3.3-2022-10-06-tiered-storage
has force pushed with the fix.
Start a broker with the following configuration:
(it uses our
UniversalRemoteStorageManager
, but it doesn't matter).Create the topic with the following command:
Fill it with the following command:
The last/active segment is
00000000000000009920
.Now happens this:
All the current segments on the disk are uploaded (save for the last, i.e. active).
A new segment is rolled (don't know why, the data aren't being written, but it doesn't matter)
The
00000000000000009920
becomes eligible for uploading and cleaning, but it is not uploaded.Old segments are cleaned
including the
00000000000000009920
, which is not uploaded.