-
Notifications
You must be signed in to change notification settings - Fork 115
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
Ordering of rewrites and matches in relay.conf #14
Comments
Forgot to say thankyou... |
Hmmm, this surprises me a lot indeed! |
Crap, no good, evaluation problem here. The destinations for a metric are evaluated in one go, thus the rewrite inbetween changes the value for the entire run. |
... |
oi, old is 6000, so it IS correct (thought I got it reversed somehow) |
This is one example of what should not be done in an ideal world, but will be too costly (performance) if done the ideal way, so here we go: Pushed down metric strdup(3)-ing to router_route, such that we don't share a single pointer to the metric for all destinations. This is necessary to avoid seeing the rewritten metric at every destination, because now a string copy is made at the time of evaluating the rule. Had to change the contract of queue not to do any strdup(3)-ing now, which made it incidentially a bit more consistent overall. Catch is now that server_send() assumes it gets a pointer to a copy for itself (as input to queue_enqueue). Without this, we'd have to make more copies, or maintain a string list and clean that up, which all boils down to a lot of work, not necessarily de-complicating the whole core.
I'd appreciate a test of this commit. I had to do some sneaky malloc changes (see commit message), so it is not impossible the thing crashes after handling some data. I think I traced all starts and ends, so it should be fine from that point of view. |
Thanks, |
Looks Good! |
Morning,
It looks like rewrites are performed before matches, such as a match placed before a rewrite will be sent data which has been subject to the rewrite.
From the documentation:
I understand that this is not the intended behaviour.
Methodology:
relay invocation in terminal session 1:
Listener for cluster old in terminal 2:
Listener for cluster new in terminal 3:
Feed data into graphite from terminal 4:
Expected result in cluster old:
Expected result in cluster new:
Actual result in cluster old:
Actual result in cluster new:
The text was updated successfully, but these errors were encountered: