influxdata / influxdata/influxdb

InfluxDB location option return extra row when crossing DST boundary

Open
#23,237 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

InfluxDB version 2.1.1

__Steps to reproduce:__
List the minimal actions needed to reproduce the behavior.

1. Bucket with data from Sunday, 27 March 2022.
2. Query from InfluxD UI with timezone location setting, aggregating window every 1h.

`import "timezone" option location = timezone.location(name: "Europe/Oslo") from(bucket: "bucket") |> range(start: 1648335600, stop: 1648504800) |> filter(fn: (r) => r["_measurement"] == "10") |> aggregateWindow(every: 1h, fn: mean, createEmpty: true) |> fill(usePrevious: true) |> timeShift(duration: -1h)`

3. Select Raw Data

__Expected behavior:__
Data to retain timezone location

__Actual behavior:__
Adds 1 extra row:

Skjermbilde 2022-03-28 kl  21 56 15

**Image from graph**

Skjermbilde 2022-03-28 kl  22 04 37

If we remove "import "timezone" option location = timezone.location(name: "Europe/Oslo"), this is the result without extra row:

Skjermbilde 2022-03-28 kl  21 58 13

__Environment info:__

* System info: Run `uname -srm` and copy the output here
**Linux 4.15.0-166-generic x86_64**

* InfluxDB version: Run `influxd version` and copy the output here
**InfluxDB 2.1.1 (git: 657e1839de) build_date: 2021-11-09T03:03:48Z**

* Other relevant environment details: Container runtime, disk info, etc
Standalone install on ubuntu.

__Config:__
Copy any non-default config values here or attach the full config as a gist or file.

__Logs:__
Include snippet of errors in log.

__Performance:__
Generate profiles with the following commands for bugs related to performance, locking, out of memory (OOM), etc.

```sh
# Commands should be run when the bug is actively happening.
# Note: This command will run for ~30 seconds.
curl -o profiles.tar.gz "http://localhost:8086/debug/pprof/all?cpu=30s"
iostat -xd 1 30 > iostat.txt
# Attach the `profiles.tar.gz` and `iostat.txt` output files.
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the exact Flux query in the InfluxDB UI with Europe/Oslo across the 27 March 2022 DST boundary, then compare raw results with and without the timezone option. Trace the aggregateWindow and timeShift entry points involved; done means the timezone-aware query no longer produces an extra row.

Written by the indexing model from the issue text.

Assessment

Domain
databases
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.