influxdata / influxdata/ui

_time field sometimes off when using aggregateWindow()

Open
#6,485 0 comments 0 reactions 0 assignees View on GitHub
kind/bug team/automation team/ui
Dominant language
TypeScript
Stars
117
Forks
51
Avg merge
2d 15h
Merged PRs (30d)
4

Description

## About the bug

**Steps to reproduce:**
1. Ensure that sensor data that is queried is sent to the DB every eg. 10 seconds
2. Query the data during this time period and use aggregateWindow()

Example:
```
from(bucket: "sensor")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_field"] == "255/0/0")
|> aggregateWindow(every: v.windowPeriod, fn: median, createEmpty: false)
```

**Expected behavior:**
When using aggregateWindow as shown above, I would have expected the “_time” field to stay the same over the 10 seconds period until new data is available.

**Actual behavior:**
If I submit the same query multiple times within this 10 seconds window, the “_time” field sometimes changes to some unexpected odd numbers and on the next query it is back to normal.

**Visual Proof:**
How _time is expected:
![query_expected](https://user-images.githubusercontent.com/76061504/212258004-8ec763b4-1ec7-4f5e-865c-f7cded246f88.png)

How _time looks on some queries:
![query_unexpected](https://user-images.githubusercontent.com/76061504/212257989-6268878c-1a47-436b-9859-4efb2c933c39.png)

## About your environment

**Environment info:**
Linux 4.4.180+ x86_64
influxdb:2.1.1 official docker container

**Config:**
assets-path: ""
bolt-path: /var/lib/influxdb2/influxd.bolt
e2e-testing: false
engine-path: /var/lib/influxdb2/engine
feature-flags: {}
flux-log-enabled: false
http-bind-address: :8086
http-idle-timeout: 3m0s
http-read-header-timeout: 10s
http-read-timeout: 0s
http-write-timeout: 0s
influxql-max-select-buckets: 0
influxql-max-select-point: 0
influxql-max-select-series: 0
key-name: ""
log-level: info
metrics-disabled: true
nats-max-payload-bytes: 1048576
nats-port: 4222
no-tasks: false
pprof-disabled: false
query-concurrency: 1024
query-initial-memory-bytes: 0
query-max-memory-bytes: 0
query-memory-bytes: 9223372036854775807
query-queue-size: 1024
reporting-disabled: true
secret-store: bolt
session-length: 60
session-renew-disabled: false
sqlite-path: ""
storage-cache-max-memory-size: 1073741824
storage-cache-snapshot-memory-size: 26214400
storage-cache-snapshot-write-cold-duration: 10m0s
storage-compact-full-write-cold-duration: 4h0m0s
storage-compact-throughput-burst: 50331648
storage-max-concurrent-compactions: 0
storage-max-index-log-file-size: 1048576
storage-no-validate-field-size: false
storage-retention-check-interval: 30m0s
storage-series-file-max-concurrent-snapshot-compactions: 0
storage-series-id-set-cache-size: 0
storage-shard-precreator-advance-period: 30m0s
storage-shard-precreator-check-interval: 10m0s
storage-tsm-use-madv-willneed: false
storage-validate-keys: false
storage-wal-fsync-delay: 0s
storage-wal-max-concurrent-writes: 0
storage-wal-max-write-delay: 10m0s
storage-write-timeout: 10s
store: disk
testing-always-allow-setup: false
tls-cert: ""
tls-key: ""
tls-min-version: "1.2"
tls-strict-ciphers: false
tracing-type: ""
ui-disabled: false
vault-addr: ""
vault-cacert: ""
vault-capath: ""
vault-client-cert: ""
vault-client-key: ""
vault-client-timeout: 0s
vault-max-retries: 0
vault-skip-verify: false
vault-tls-server-name: ""
vault-token: ""

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.