influxdata / influxdata/kapacitor

join node emits incorrect data when script disabled

Open
#897 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.4k
Forks
479
Avg merge
4d 16h
Merged PRs (30d)
4

Description

While trying to come up with a solution for https://groups.google.com/forum/#!topic/influxdb/sPWnPkr8pxU I noticed that when a script is disabled, a `join` node can emit incorrect data. For example:

```
var data = stream
|from().measurement('system').groupBy('host')
|stats(200ms).align()
|difference('emitted').as('emitted')

var data_crit = data
|window().period(500ms).every(1u)
|sum('emitted').as('emittedsum')

data
|join(data_crit).as('warn','crit').tolerance(200ms).fill(0)
|log()
```

when the above script is run, and fed data, and then disabled, the following is the result:

```
[deadnode:log9] 2016/09/13 13:12:30 I! {stats host=foo {false [host]} map[host:foo] map[warn.emitted:1 crit.emittedsum:5] 2016-09-13 17:12:30 +0000 UTC}
[deadnode:log9] 2016/09/13 13:12:30 I! {stats host=foo {false [host]} map[host:foo] map[warn.emitted:2 crit.emittedsum:5] 2016-09-13 17:12:30.2 +0000 UTC}
[deadnode:log9] 2016/09/13 13:12:30 I! {stats host=foo {false [host]} map[host:foo] map[warn.emitted:2 crit.emittedsum:5] 2016-09-13 17:12:30.4 +0000 UTC}
[deadnode:log9] 2016/09/13 13:12:30 I! {stats host=foo {false [host]} map[host:foo] map[warn.emitted:1 crit.emitted:0] 2016-09-13 17:12:30.6 +0000 UTC}
```

Notice that last line, how it has `crit.emitted`. This field shouldn't exist. I don't know where it's coming from. And the field that should exist, `crit.emittedsum`, does not.

This is with a kapacitor build from eccff59 (current master)

Contributor guide

Open the contributing guide

Research direction

Start by running the provided Kapacitor script with the task disabled and inspect the join node's emitted fields, especially the final record. Trace the join node's handling of the warn and crit streams, then verify that disabled-script output retains crit.emittedsum and does not emit crit.emitted.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
stream-processing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.