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

Fix Default node mishandling batch groupBy tags #1233

Merged
merged 1 commit into from
Mar 9, 2017
Merged

Conversation

desa
Copy link
Contributor

@desa desa commented Feb 28, 2017

Required for all non-trivial PRs
  • Rebased/mergable
  • Tests pass
  • CHANGELOG.md updated
  • Sign CLA (if not already signed)

@desa
Copy link
Contributor Author

desa commented Feb 28, 2017

@nathanielc This could probably use a bit more testing to guarantee that the tags are properly set on both the points in a batch and the batch itself. If you think adding those tests would be worthwhile, I'm happy to add them.

@desa desa added review and removed in progress labels Feb 28, 2017
desa added a commit that referenced this pull request Mar 1, 2017
@desa
Copy link
Contributor Author

desa commented Mar 2, 2017

Not sure why this is yellow. It's been green for awhile now.

CHANGELOG.md Outdated
@@ -30,6 +30,9 @@
Specifically in the JSON result data the old key `Series` is always `series`, and the old key `Err` is now always `error` instead of for only some of the outputs.
- [#1181](https://github.com/influxdata/kapacitor/pull/1181): Fix bug parsing dbrp values with quotes.
- [#1228](https://github.com/influxdata/kapacitor/pull/1228): Fix panic on loading replay files without a file extension.
- [#1192](https://github.com/influxdata/kapacitor/issues/1192): BREAKING: Fix bug in Default Node not updating batch tags and groupID.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this breaking?

@@ -84,7 +87,7 @@ func (d *DefaultNode) setDefaults(fields models.Fields, tags models.Tags) (model
newTags := tags
tagsCopied := false
for tag, value := range d.d.Tags {
if _, ok := tags[tag]; !ok {
if v := tags[tag]; v == "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see this is the breaking change. I guess we should break things :) Should we enable this behavior behind a flag? Something like

|default()
   .tag('dc', 'sfc')
   .defaultEmptyTags()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

While it is breaking, I think that this is the correct functionality. The reason being that it's not possible to write a point in line protocol with an empty tag value and therefore and points that would have meet this condition would be points where someone grouped by a tag that did not exist. If I'm a user, I would have to know when I group by something that doesn't exist, that the resulting data will be tagged with the non existent tag, but with an empty string and so I much use the defaultEmptyTags().

The counter argument to this is that it is a breaking change, and we shouldn't break things that people may be relying on.

I'm happy to go whichever route you think is best.

Copy link
Contributor

Choose a reason for hiding this comment

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

The reason being that it's not possible to write a point in line protocol with an empty tag value

I didn't realize this. Since it is true, (I just tested it) it is not possible that someone was relying on the subtle difference in behavior.

So lets make the change as is but not mark it as BREAKING since it is not actually possible that someone was relying on the difference.

Add Changelog entry for #1233

Remove BREAKING from changelog entry
@desa desa merged commit 5c54c02 into master Mar 9, 2017
@desa desa deleted the md-issue#1192 branch March 9, 2017 21:13
@desa desa removed the review label Mar 9, 2017
fdhex pushed a commit to fdhex/kapacitor that referenced this pull request Jun 12, 2018
Add Changelog entry for influxdata#1233

Remove BREAKING from changelog entry
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