Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.3.5] Drops series doesn't works as intended ? #8806

Closed
Orybon opened this issue Sep 8, 2017 · 4 comments
Closed

[1.3.5] Drops series doesn't works as intended ? #8806

Orybon opened this issue Sep 8, 2017 · 4 comments

Comments

@Orybon
Copy link

Orybon commented Sep 8, 2017

Bug report

__System info: InfluxDB 1.3.0 & docker

_Steps to reproduce:

  1. Insert telegraf datas
  2. Try to drop series of a specific host (that doesn't exist anymore so no new datas) using http api

__Expected behavior: Series should be dropped

__Actual behavior: Series aren't dropped

__Additional info: HTTP respoonse is - {"results":[{"statement_id":0}]}

When i launch this command :

 curl -X POST 'localhost:8086/query?db=[db-name]' --data-urlencode 'q=DROP SERIES WHERE host = "2008R2SP1"'

i got the following result :

{"results":[{"statement_id":0}]}

But when i show the series in influx shell i still have the data i tried to delete :

> show series
key
---
win_cpu,host=2008R2SP1,instance=0,objectname=Processor,server_env=infra,server_os_type=windows,server_os_version=2008R2SP1,server_owner=###,server_project=iaas,server_role=templatewin
win_cpu,host=2008R2SP1,instance=1,objectname=Processor,server_env=infra,server_os_type=windows,server_os_version=2008R2SP1,server_owner=###,server_project=iaas,server_role=templatewin

Is this a known issue or did i do something wrong ?

@rbetts
Copy link
Contributor

rbetts commented Sep 8, 2017

First - the quoting here can be a little confusing. You should quote tag key and tag value as "host" = '2008R2SP1'.

However, there were two issues related to drop and delete resolved in 1.3.1 and 1.3.4:
#8531
#8677

@Orybon
Copy link
Author

Orybon commented Sep 8, 2017

Thank you for your answer.

When i use the command as you suggested :
curl -X POST 'localhost:8086/query?db=[db_name]' --data-urlencode 'q=DROP SERIES WHERE "host" = '2008R2SP1''

I got this response :
{"error":"error parsing query: invalid duration"}

I tried to update to 1.3.5, the result is the same.

@Orybon Orybon changed the title [1.3.0] Drops series doesn't works as intended ? [1.3.5] Drops series doesn't works as intended ? Sep 8, 2017
@rbetts
Copy link
Contributor

rbetts commented Sep 8, 2017

The invalid duration is annoying - and confused me too. Here's a working example: https://asciinema.org/a/rC9qZjJiL4hloSNtlScTChSAo

@jsternberg
Copy link
Contributor

Just to note, bash treats quotes differently than standard programming languages. As an example:

$ echo a''b
ab

So since you surround your command with a single quote, you are getting two quoted bodies concatenated together. You have 'q=DROP SERIES WHERE "host" = ', followed by 2008R2SP1, then followed by ''. So the final query gets sent to the server without any quotes. Use double quotes and you will be fine.

I'm going to close this issue as it appears to not be an issue in the software and we cannot change how the quotes work at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants