-
Notifications
You must be signed in to change notification settings - Fork 454
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
Simplify M3DB config #1371
Simplify M3DB config #1371
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1371 +/- ##
=========================================
- Coverage 70.6% 67.1% -3.5%
=========================================
Files 823 666 -157
Lines 70369 59352 -11017
=========================================
- Hits 49692 39870 -9822
+ Misses 17455 16897 -558
+ Partials 3222 2585 -637
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #1371 +/- ##
========================================
- Coverage 70.7% 70.5% -0.2%
========================================
Files 823 823
Lines 70484 70754 +270
========================================
+ Hits 49840 49890 +50
- Misses 17415 17569 +154
- Partials 3229 3295 +66
Continue to review full report at Codecov.
|
521ef48
to
f880207
Compare
8d8d154
to
0127691
Compare
This reverts commit 61f2c669587373e658cea22f83a803ec4a62ba63.
@benraskin92 Yeah I'll add a "complete" YAML file that has everything filled out and then we can start adding comments to it or something |
@benraskin92 I created a file called |
"tagEncoder": defaultPoolPolicy, | ||
"tagDecoder": defaultPoolPolicy, | ||
"context": poolPolicyDefault{ | ||
size: 262144, |
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.
nit: throw these numbers into consts?
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.
I kinda like it how it is, reads like a YAML file / table. They basically are constants since everything is declared at the top anyways
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.
Fair enough, I was thinking specifically for 262144
and some of the other values which are commonly used, but I guess doing that would kinda imply that they're all tied together
if err := p.IdentifierPool.initDefaultsAndValidate("identifier"); err != nil { | ||
return err | ||
} | ||
if err := p.FetchBlockMetadataResultsPool.initDefaultsAndValidate("fetchBlockMetadataResults"); err != nil { |
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.
I think you may have FetchBlockMetadataResultsPool
twice here
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.
nah its dumb, there is FetchBlockMetadataResultsPool
and FetchBlocksMetadataResultsPool
(note the s
)
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.
Ah, gotcha
if err := p.BlockMetadataSlicePool.initDefaultsAndValidate("blockMetadataSlice"); err != nil { | ||
return err | ||
} | ||
if err := p.BlocksMetadataPool.initDefaultsAndValidate("blocksMetadata"); err != nil { |
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.
May have BlocksMetadataPool
twice too
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.
same comment as above, they're different (note the s
)
@@ -351,6 +351,7 @@ func newM3DBStorage( | |||
etcdCfg = &cfg.ClusterManagement.Etcd | |||
|
|||
case len(cfg.Clusters) == 1 && | |||
cfg.Clusters[0].Client.EnvironmentConfig != nil && |
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.
Is this fine to fail if configs are not 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.
I don't follow. Could you elaborate?
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.
My bad, somehow got myself convinced you could have cfg.Clusters[0].Client.EnvironmentConfig
be nil and continue here properly at the moment
xretry.NewOptions(). | ||
SetInitialBackoff(500 * time.Millisecond). | ||
SetBackoffFactor(2). | ||
SetMaxRetries(3). |
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.
nit: Is it intentional to have the write retrier have 3 backoff factor and 2 retries and the fetch retrier to have it flipped?
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 I'm just copya-pastaing what was in our old YAML files
samplingRate: 1.0 | ||
extended: none | ||
|
||
limits: |
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.
Any chance you could add something like this to this config? I've been meaning to add it to defaults and the docs to have users use collision free id generation by default
# Configuration setting for generating metric IDs from tags.
tagOptions:
metricName: "_new"
idScheme: quoted
if writeBatchPoolPolicy.Size == 0 { | ||
// If no value set, calculate a reasonabble value based on the commit log | ||
var writeBatchPoolSize int | ||
if policy.WriteBatchPool.Size != nil { |
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.
Might need to check that it's not 0 too?
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.
0 is a valid pool size I think, basically turns off pooling
@@ -351,6 +351,7 @@ func newM3DBStorage( | |||
etcdCfg = &cfg.ClusterManagement.Etcd | |||
|
|||
case len(cfg.Clusters) == 1 && | |||
cfg.Clusters[0].Client.EnvironmentConfig != nil && |
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.
My bad, somehow got myself convinced you could have cfg.Clusters[0].Client.EnvironmentConfig
be nil and continue here properly at the moment
"tagEncoder": defaultPoolPolicy, | ||
"tagDecoder": defaultPoolPolicy, | ||
"context": poolPolicyDefault{ | ||
size: 262144, |
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.
Fair enough, I was thinking specifically for 262144
and some of the other values which are commonly used, but I guess doing that would kinda imply that they're all tied together
Hard code all our defaults for pooling and filesystem and M3 client so they don't need to be provided in every YAML