influxdata / influxdata/influxdb

Delete without predicated not deleting any data but reports success

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

Description

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

1. use influx-cli to delete all measurements and data between timestamps

`influx delete --host http://localhost:8086 --token ...== --org my-org --bucket my-bucket --start 2022-12-23T12:00:00Z --stop 2022-12-23T23:00:00Z`

__Expected behavior:__

All measurements and data to be deleted within the provided time period.

__Actual behavior:__
All measurements and data are still present.

Deleting all measurements one by one using a predicate works as expected. But not providing a predicated does nothing.

`influx delete --host http://localhost:8086 --token ...== --org my-org --bucket my-bucket --start 2022-12-23T12:00:00Z --stop 2022-12-23T23:00:00Z --http-debug --predicate '_measurement=foobar'`

__Environment info:__

* System info: Linux 5.10.0-19-amd64 x86_64
* InfluxDB version: 2.6.0 docker container
* Other relevant environment details: docker

__Config:__
all default

__Logs:__

```
ts=2022-12-24T11:52:12.608119Z lvl=debug msg="user find by ID" log_id=0exzaXIG000 store=new took=0.047ms
ts=2022-12-24T11:52:12.609023Z lvl=debug msg="org find" log_id=0exzaXIG000 store=new took=0.165ms
ts=2022-12-24T11:52:12.609210Z lvl=debug msg="bucket find" log_id=0exzaXIG000 store=new took=0.138ms
ts=2022-12-24T11:52:12.659269Z lvl=debug msg=Deleted log_id=0exzaXIG000 orgID=dc348d458c862184 bucketID=94abd7bec8b00721
ts=2022-12-24T11:52:12.659843Z lvl=debug msg=Request log_id=0exzaXIG000 service=http method=POST host=localhost:8086 path=/api/v2/delete query="bucket=my-bucket&org=my-org" proto=HTTP/1.1 status_code=204 response_size=0 content_length=-1 referrer= remote=172.17.0.1:56100 user_agent=Sha took=52.299ms body="{\"start\":\"2022-12-23T12:00:00Z\",\"stop\":\"2022-12-23T23:00:00Z\"}\n"
```

Logs indicate success with status 204.
CLI also reports success with 204 when using http-debug flag.
Same behaviour with using curl and HTTP API directly.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the documented influx delete command, then compare it with the working predicate form and the direct POST request to /api/v2/delete. Inspect the delete request handling and its 204 response path; done means deleting without a predicate removes data in the requested time range and still reports success only when the operation completes.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, cli, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.