.*: Add support for StartAfter option in ListObjects#256
.*: Add support for StartAfter option in ListObjects#256waltherlee wants to merge 4 commits intothanos-io:mainfrom
Conversation
Signed-off-by: Walther Lee <walthere.lee@gmail.com>
Signed-off-by: Walther Lee <walthere.lee@gmail.com>
Signed-off-by: Walther Lee <walthere.lee@gmail.com>
Signed-off-by: Walther Lee <walthere.lee@gmail.com>
|
👋 thanks for your contribution. I would suggest writing a small RFC first and opening a PR with it in the Thanos repo so that we could discuss your feature before implementing it because it sounds to me like there could be lots of edge cases |
|
@GiedriusS Sounds good! Will do. But yes, there's a lot of states we can have between multiple compactor shards and/or time windows. I will be testing a first version in the following weeks in a fork, so hopefully I can also show some prod data and metrics in the Thanos PR 🤞 |
|
we use the thanos obj store clients and are interested in this feature. are maintainers open to merging this even if its not directly used by thanos? thx @waltherlee for working on this 🙏 |
|
I will be sending the RFC I mentioned above this week. It took me a little longer to make it work, but I have a version that has been working as expected for weeks. That should help with the review in this PR as well 🙂 |
|
🤞 Proposal sent: thanos-io/thanos#8765 |
Thanos compactors have to walk-through and list all metadata files (or block folders depending on the discovery strategy) in S3 before starting compactions. For buckets with dozens of millions of blocks, that sync can take hours, and it has to be started all over every time the compactors are restarted, even if the first sync had finished and compactions had already started.
I’m working on a checkpoint implementation in Thanos to be able to recover a meta sync where it was left after a restart, but for this to work, objstore needs to support StartAfter, StartOffset and Marker as an option for the ListObjects Iter.
I tried to cover as many providers as possible. I checked the documentation for each one to make sure that they take object prefixes as value for the offset.
Changes
WithStartAfter()option inobjstore.go.StartAfterhandling inPrefixedBucketto prepend the bucket prefix to the option value.StartAftersupport inInMemBucketfor testing.Verification
StartAfternon-recursive and recursive cases in theAcceptanceTest.InMemBucketunit tests covering recursive, non-recursive, and unsupported-provider validation.TestMetricBucket_Close.