-
Notifications
You must be signed in to change notification settings - Fork 107
Conversation
is this an important or beneficial characteristic? why? |
Because we're deciding based on the last update time whether a metric is active or not. |
I just had an idea. The logic we have in place here is to prevent us from trying to update all metricDefs at the same time, as this would result in ingestion blocking while waiting for writes to cassandra to complete. Why dont we just simplify this and use a static updateInterval, but use a non-blocking write to the writeQueue. If we successfully add the metricDef to the writeQueue then we update the lastUpdate timestamp. If we cant write to the writeQueue because it is full, then we just move on. The next time the metric is received we will try and add it to the writeQueue again. This will lead to the updates of all MetricDefs to be spaced out over the window. eg,
|
We have to take a step back. What problem are we actually trying to solve?
The current code is easy to reason about but non-deterministic. The proposed formula makes it deterministic. @woodsaj's latest suggestion makes it non-deterministic again, I don't understand the point. Also there's so much code being written/changed all touching this code (the latest stuff in master + #568 which is high prio + #570 which is high prio). I told @replay he could tackle this under the assumption it would be a trivial patch but if this is going to get complicated then we should wait and focus on the other stuff first. |
@woodsaj regarding your suggestion: |
computing the hash for every metric received is expensive. We can probably improve ingestion latency by 10% (and therefor increase maximum ingestion rate) by using the non-blocking channel writes i have used above. There is definitely room for improvement to handle the highlighted edge cases. Given there are a number of issues with the index, we should do a larger re-design/refactor to address them all.
|
Yeah, that's a valid concern, i haven't benchmarked the hashing. |
6d9979a
to
d0f2c0d
Compare
d0f2c0d
to
4a48ab2
Compare
Changes who Cassandra Idx decides whether the
LastUpdate
property of an index entry needs to be updated or not.The decision is now based around a hash that's using a given metric's
Id
as input, so if multiple nodes receive the same metric point they should all reach the same conclusion.fixes #559