influxdata / influxdata/kapacitor

Could not replay a batch with a query record composed of multiple measurements

Open
#1,700 0 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

Hello,

I have the following message during the replay :
```
running replay: unexpected number of batch collectors. exp 1 got 2
```

To reproduce easily:

**InfluxDB data**
```
CREATE DATABASE pages
USE pages
INSERT errors,atag=a value=5 1511997457000000000
INSERT views,atag=a value=10 1511997457000000000
```

**Tick script test.tick:**
```
// Get errors batch data
var errors = batch
|query('SELECT sum(value) FROM "pages"."autogen".errors')
.period(1h)
.every(1h)
.groupBy(time(1m), *)
.fill(0)
|log()

// Get views batch data
var views = batch
|query('SELECT sum(value) FROM "pages"."autogen".views')
.period(1h)
.every(1h)
.groupBy(time(1m), *)
.fill(0)
|log()
```

**Command to create the task, the record and launch the replay:**
```
kapacitor define mybug -dbrp pages.autogen -tick test.tick -type batch
kapacitor record query -recording-id test_record -query "select * from pages.autogen.errors; select * from pages.autogen.views;" -type batch
kapacitor replay -recording test_record -rec-time -task mybug
```

**Result :**
```
root@:~/influx/kapacitor/bug# kapacitor replay -recording test_record -rec-time -task mybug
c06323a0-c7e8-4752-9445-cc03d285291b
running replay: unexpected number of batch collectors. exp 1 got 2
```

**Environment:**
```
kapacitor-dev_1 | [run] 2017/11/29 23:34:58 I! Kapacitor starting, version 1.3.3, branch HEAD, commit ce586f35e89e75a1779e2b493caba15d66295a15
kapacitor-dev_1 | [run] 2017/11/29 23:34:58 I! Go version go1.7.5
influxdb-dev_1 | [I] 2017-11-29T23:34:58Z InfluxDB starting, version 1.3.7, branch 1.3, commit 2d474a3089bcfce6b472779be9470a1f0ef3d5e4
influxdb-dev_1 | [I] 2017-11-29T23:34:58Z Go version go1.8.4, GOMAXPROCS set to 4
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with test.tick and the `kapacitor record query` and `kapacitor replay` commands shown in the issue. Start by tracing batch replay handling for the two query measurements and the check that reports the collector count. Done means the recorded batch with both queries replays successfully without the unexpected collector-count error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.