Aiven-Open / tiered-storage-for-apache-kafka

RemoteStorageManager for Apache Kafka® Tiered Storage
Apache License 2.0
91 stars 19 forks source link

feat: extend BytesRange to support empty ranges #480

Closed jeqo closed 8 months ago

jeqo commented 8 months ago

Given that indexes could be empty, inclusive ranges should be able to represent the case where size is zero. To do this, to=-1 is proposed to represent ranges that are empty.

Historically, ranges were designed only for segments where empty files were not possible. As recently empty indexes became a possibility when small segment files are created, then the initial design of BytesRange became an issue as it's designed as inclusive-inclusive.

ivanyu commented 8 months ago

One of the reasons why inclusive-inclusive range bounds are not popular in the industry :D