influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

data files and series exist after drop database

Open jasper-zhang opened this issue 11 years ago • 12 comments

My version is 0.9.0, and I created a cluster of 3 servers. After I create a db and insert some data to it, I drop the db. I find the db files in the server which I curl the drop command are deleted, but data files in other two servers exist still. Otherwise, I find the result of "show series" is still seen !!

jasper-zhang avatar Jun 19 '15 10:06 jasper-zhang

The result of "SHOW MEASUREMENTS" exists also.

jasper-zhang avatar Jun 19 '15 11:06 jasper-zhang

Same issue here

maxcanada avatar Jun 19 '15 11:06 maxcanada

Since clustering is in alpha-state, not all operations are support on clusters. DROP MEASUREMENT is one such operation. It only works correctly on a single node.

Please follow https://github.com/influxdb/influxdb/issues/3009 -- when this issue is closed, DROP MEASUREMENT will work on a cluster.

otoolep avatar Jun 19 '15 15:06 otoolep

Actually we have this issue on a single node Thanks

maxcanada avatar Jun 19 '15 15:06 maxcanada

Can you please show me an entire sequence of curl commands demonstrating the issue on your single node, as described here?

https://github.com/influxdb/influxdb/blob/master/CONTRIBUTING.md#bug-reports

otoolep avatar Jun 19 '15 15:06 otoolep

Hi,

Here is the list of commands I've done :

curl -G http://localhost:8086/query --data-urlencode "q=CREATE DATABASE mydb" Result : {"results":[{}]}

curl -G http://localhost:8086/query --data-urlencode "q=CREATE RETENTION POLICY myrp ON mydb DURATION 365d REPLICATION 1 DEFAULT" Result : {"results":[{}]}

curl -d '{"database" : "mydb, retentionPolicy" : "myrp", "points": [{"measurement":"cpu","tags":{"region":"useast","host":"server_1","service":"redis"},"fields":{"value":61}}]}' -H "Content-Type: application/json" http://localhost:8086/write

curl -G http://localhost:8086/query --data-urlencode "q=DROP DATABASE mydb"

curl -G http://localhost:8086/query --data-urlencode 'db=mydb' --data-urlencode 'q=SELECT * from cpu' {"results":[{"error":"database not found: mydb"}]}

curl -G http://localhost:8086/query --data-urlencode "q=CREATE DATABASE mydb" curl -G http://localhost:8086/query --data-urlencode "q=CREATE RETENTION POLICY myrp ON mydb DURATION 365d REPLICATION 1 DEFAULT" Result : {"results":[{}]}

Here is the problem :

curl -G http://localhost:8086/query --data-urlencode 'db=mydb' --data-urlencode 'q=SHOW MEASUREMENTS' {"results":[{"series":[{"name":"measurements","columns":["name"],"values":[["cpu"]]}]}]}

No data in there though : curl -G http://localhost:8086/query --data-urlencode 'db=mydb' --data-urlencode 'q=SELECT * from cpu' {"results":[{}]}

Thanks a lot,

maxcanada avatar Jun 20 '15 10:06 maxcanada

@maxcanada -- the JSON in your supplied "write" is not valid. retentionPolicy needs to be quoted.

otoolep avatar Jun 22 '15 18:06 otoolep

Fixed by https://github.com/influxdb/influxdb/pull/3090

otoolep avatar Jun 22 '15 19:06 otoolep

Thanks @maxcanada for the bug report.

otoolep avatar Jun 22 '15 19:06 otoolep

@otoolep --DROP MEASUREMENT will not work when my MEASUREMENT contains dot, result show: { "error": "error parsing query: found ., expected SELECT, DELETE, SHOW, CREATE, DROP, GRANT, REVOKE, ALTER, SET at line 1, char 21" }

jasper-zhang avatar Jun 23 '15 02:06 jasper-zhang

@jasper-zhang you must double-quote measurement names that contain a period.

beckettsean avatar Jun 23 '15 22:06 beckettsean

The original issue has been addressed and 0.9.1 will have the fix.

otoolep avatar Jun 23 '15 23:06 otoolep