-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
receiver/compact/store/sidecar: Added a provision in the bucket config to add a prefix
#3289
Conversation
Signed-off-by: dsayan154 <dsayan154@gmail.com>
Signed-off-by: dsayan154 <dsayan154@gmail.com>
Signed-off-by: dsayan154 <dsayan154@gmail.com>
Signed-off-by: dsayan154 <dsayan154@gmail.com>
Signed-off-by: dsayan154 <dsayan154@gmail.com>
Signed-off-by: dsayan154 <dsayan154@gmail.com>
Signed-off-by: dsayan154 <dsayan154@gmail.com>
Signed-off-by: dsayan154 <dsayan154@gmail.com>
…dated the documentation for it. To address [issue 1318](thanos-io#1318) Signed-off-by: dsayan154 <dsayan154@gmail.com>
Signed-off-by: dsayan154 <dsayan154@gmail.com>
Signed-off-by: dsayan154 <dsayan154@gmail.com>
Signed-off-by: dsayan154 <dsayan154@gmail.com>
prefix
prefix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments!
Amazing and clean work BTW ❤️
Addressing a suggestion to modify the comment. Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com> Signed-off-by: dsayan154 <dsayan154@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks ❤️
I have a couple of suggestions.
- How about embedding
Bucket
into new struct? - Could we maybe add some end-to-end tests?
- We need a changelog entry.
prefix
prefix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just minor comments to address, then we can merge! (:
Thanks!
…gelog entry Signed-off-by: dsayan154 <dsayan154@gmail.com>
pkg/objstore/objstore.go
Outdated
} | ||
|
||
func (pbkt *prefixedBucket) Delete(ctx context.Context, name string) (err error) { | ||
pname := filepath.Join(pbkt.prefix, name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should juse path.Join()
and not filepath.Join()
. The former guarantees paths are joined with /
, which is what object stores expect.
Same comment applies across the change set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aso the .Join()
is used quite a lot. You could add an help prefixedBucket.nameWithPrefix(name string)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, might be good to add a helper function but I don't know how will it reduce the redundancy of the code, as I'll have to call the helper function same number of times as I have called filepath.Join().
But I'll update the code with your suggestion. I think it will add consistency to the code.
return pbkt.bkt.Close() | ||
} | ||
|
||
func (pbkt *prefixedBucket) Iter(ctx context.Context, dir string, f func(string) error) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be possible to add a unit test on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @pracucci ,
I have added few unit tests for the Iter(), can you please review this? the tests are running fine locally.
Sorry for such a late response on this PR, I was busy with office deliverables. I hope to address these comments by next weekend. |
Co-authored-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: dsayan154 <dsayan154@gmail.com>
Signed-off-by: dsayan154 <dsayan154@gmail.com>
Signed-off-by: dsayan154 <dsayan154@gmail.com>
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Getting below error while building thanos docker image after taking this PR through make docker
|
What would it take to get this done? |
@@ -112,6 +114,16 @@ Highlights: | |||
- [#3114](https://github.com/thanos-io/thanos/pull/3114) Query Frontend: Added support for Memacached cache. | |||
- **breaking** Renamed flag `log_queries_longer_than` to `log-queries-longer-than`. | |||
- [#3166](https://github.com/thanos-io/thanos/pull/3166) UIs: Added UI for passing a `storeMatch[]` parameter to queries. | |||
<<<<<<< HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to clean these
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This PR is to address issue #1318 .
Changes
prefix
to BucketConfig struct in factory.goVerification
Not yet verified, this is for the maintainers to review, if this is the right approach to address this issue. I am struggling to add unit tests for this, so any hints would be helpful. But, I can test it manually if the overall feedback on this approach is positive.