Skip to content

[WIP] Read and write from/to multiple ingesters #49

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

Merged
merged 3 commits into from
Oct 14, 2016
Merged

Conversation

juliusv
Copy link
Contributor

@juliusv juliusv commented Oct 13, 2016

@jml FYI

Not sure what to do about LabelValuesForLabelName(). It is only used for the UI to retrieve all metric names for autocompletion. Currently I just try to read from all ingesters in there, and it's not clear whether it makes sense to introduce any failure thresholds in there (since we're not querying N ingesters for a hash, but all, independent of any hash).

Copy link
Contributor

@jml jml left a comment

Choose a reason for hiding this comment

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

Very cool! I've made a few comments as conversation starting points, rather than concrete recommendations.

@@ -101,6 +103,11 @@ func main() {
flag.DurationVar(&cfg.flushPeriod, "ingester.flush-period", 1*time.Minute, "Period with which to attempt to flush chunks.")
flag.DurationVar(&cfg.maxChunkAge, "ingester.max-chunk-age", 10*time.Minute, "Maximum chunk age before flushing.")
flag.IntVar(&cfg.numTokens, "ingester.num-tokens", 128, "Number of tokens for each ingester.")
flag.IntVar(&cfg.distributorConfig.ReadReplicas, "distributor.read-replicas", 3, "The number of available ingesters to read from.")
flag.IntVar(&cfg.distributorConfig.WriteReplicas, "distributor.write-replicas", 3, "The number of available ingesters to write to.")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we just want number of replicas. I can't imagine a circumstance where we'd want these numbers to differ.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, not 100% sure about this, but you're probably right and I can't see how differing numbers would make sense.

Get(key uint32) (ring.IngesterDesc, error)
GetAll() []ring.IngesterDesc
Get(key uint32, n int, heartbeatTimeout time.Duration) ([]ring.IngesterDesc, error)
GetAll(heartbeatTimeout time.Duration) []ring.IngesterDesc
Copy link
Contributor

Choose a reason for hiding this comment

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

Another approach might be to exclude the heartbeatTimeout from the parameters and instead implement it as a decorator. Not sure it's a better approach, mind you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From discussion: consider making the heartbeat timeout a property of the ring instead of passing it in on each call. Then the ring could also report in its metrics Collect() method how many total vs. timed out ingesters there are.

result = append(result, b[j])
j++
} else {
result = append(result, a[i])
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible for the value at b[i] to be different from a[i]?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, that's prevented in the ingesters, like in Prometheus itself. If two ingesters do end up having different values for the same timestamp for some broken reason, it's still a good thing to just filter that out here.

@@ -101,24 +102,52 @@ func (r *Ring) loop() {
})
}

// Get returns a collector close to the hash in the circle.
func (r *Ring) Get(key uint32) (IngesterDesc, error) {
// Get returns up to n ingesters close to the hash in the circle.
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if it's worth having a new type that implements Collector but has multiple ingesters as a backend?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Like: Distributor -> Replicator -> Ingesters?

Hmm, could make sense, but one more type. Let's defer that decision for later, I would propose?

Copy link
Contributor

@jml jml Oct 14, 2016

Choose a reason for hiding this comment

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

Agree re deferring.

ingesterQueries: prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "prometheus",
Name: "distributor_ingester_queries_total",
Help: "The total number queries sent to ingesters.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: "total number of queries"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, fixed.

@juliusv juliusv merged commit 24dbd8d into master Oct 14, 2016
@juliusv juliusv deleted the replication branch October 14, 2016 15:10
tomwilkie added a commit that referenced this pull request Nov 18, 2016
fd875e2 Fix test wrt shellcheck
54ec2d9 Don't capitalise error messages
19d3b6e Merge pull request #49 from weaveworks/pin-shfmt
fea98f6 Go get from the vendor dir
1d867b0 Try and vendor a specific version of shfmt
76619c2 Merge pull request #48 from weaveworks/revert-41-user-tokens
4f96c51 Revert "Add experimental support for user tokens"
d00033f Merge pull request #41 from weaveworks/user-tokens
245ed26 Merge pull request #47 from weaveworks/46-shfmt
c1d7815 Fix shfmt error
cb39746 Don't overright lint_result with 0 when shellcheck succeeds
8ab80e8 Merge pull request #45 from weaveworks/lint
83d5bd1 getting integration/config and test shellcheck-compliant
cff9ec3 Fix some shellcheck errors
7a843d6 run shellcheck as part of lint if it is installed
31552a0 removing spurious space from test
6ca7c5f Merge pull request #44 from weaveworks/shfmt
952356d Allow lint to lint itself
b7ac59c Run shfmt on all shell files in this repo
5570b0e Add shfmt formatting of shell files in lint
0a67594 fix circle build by splatting gopath permissions
b990f48 Merge pull request #42 from kinvolk/lorenzo/fix-git-diff
224a145 Check if SHA1 exists before calling `git diff`
1c3000d Add auto_apply config for wcloud
0ebf5c0 Fix wcloud -serivice
354e083 Fixing lint
586060b Add experimental support for user tokens

git-subtree-dir: tools
git-subtree-split: fd875e27c5379d443574bcf20f24a52a594871ca
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