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

Table/Points not deleted when we drop database #41

Closed
william-p opened this issue Nov 12, 2013 · 9 comments
Closed

Table/Points not deleted when we drop database #41

william-p opened this issue Nov 12, 2013 · 9 comments

Comments

@william-p
Copy link

Hi guys,
i have a issue when i use Python driver (https://github.com/influxdb/influxdb-python) but i think it's core issue.

How to reproduce:

  • create database and add correct rights
  • add points
  • query points (it's okay)
  • delete database
  • query points (no point, okay)
  • recreate database
  • query point, server return old points 😕

Interactive Python

Python 2.7.4 (default, Apr 19 2013, 18:28:01) 
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from influxdb import InfluxDBClient
>>> 
>>> client = InfluxDBClient("localhost", 8086, "root", "root", "dbtest")
>>> 
>>> client.create_database("dbtest")
True
>>> client.add_database_user("root", "root")
True
>>> 
>>> json_body = [{
...     "points": [
...         ['value1']
...     ],
...     "name": "id1",
...     "columns": ["key1"]
...  }]
>>> 
>>> client.write_points(json_body)
True
>>> 
>>> print client.query("select * from id1")
[{"name":"id1","columns":["time","sequence_number","key1"],"points":[[1384282753,1,"value1"]]}]
>>> 
>>> client.delete_database("dbtest")
True
>>> 
>>> client.delete_database("dbtest")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/william/gits/checkmy.ws/opt/venv/local/lib/python2.7/site-packages/influxdb/client.py", line 243, in delete_database
    "{0}: {1}".format(response.status_code, response.content))
Exception: 400: Database dbtest doesn't exist
>>> 
>>> print client.query("select * from id1")
[]
>>> 
>>> client.create_database("dbtest")
True
>>> client.add_database_user("root", "root")
True
>>> 
>>> print client.query("select * from id1")
[{"name":"id1","columns":["time","sequence_number","key1"],"points":[[1384282753,1,"value1"]]}]

I have missing something ?

Thanks

@jvshahid
Copy link
Contributor

No, that's definitely a bug. We'll definitely try to reproduce and fix it asap. Thanks for reporting this bug.

@crodas
Copy link

crodas commented Nov 12, 2013

If it helps, I can reproduce the same bug with the PHP driver. To run the test suite I ended up created databases with random names. Looking forward to see this bug closed.

@william-p
Copy link
Author

Good job, fixed in latest (InfluxDB v0.1.1.rc3 (git: d8dc990bb57c4298f857d45a36b39420ebca2926))
Thanks

@xgdgsc
Copy link

xgdgsc commented Aug 11, 2014

Well, I still see this with a database partially deleted after I delete in the web interface. With version 0.8.

@xgdgsc
Copy link

xgdgsc commented Aug 11, 2014

With python interface, it seems to delete fine though.

@jvshahid
Copy link
Contributor

Can you explain what do you mean you're seeing partial data after deleting
the database ? Are you querying the data or looking at files on disk.

Cheers,

-JS

On Mon, Aug 11, 2014 at 2:27 AM, xgdgsc notifications@github.com wrote:

With python interface, it seems to delete fine though.


Reply to this email directly or view it on GitHub
#41 (comment).

@dimrozakis
Copy link

I'm also experiencing the issue where dropping the database doesn't delete the stored measurements. Here's how I can reproduce it:

Create a database called deleteme:

» /opt/influxdb/influx
Connected to http://localhost:8086 version FIXME
InfluxDB shell 0.9.0
> show databases
name: databases
---------------
name

> create database deleteme

Submit a datapoint to create a measurement:

» curl -i -XPOST 'http://localhost:8086/write?db=deleteme' --data-binary 'cpu_load_short,host=server01,region=us-west value=0.64 1434055562000000000'
HTTP/1.1 204 No Content
Request-Id: 04ac4111-2593-11e5-8dbe-000000000000
X-Influxdb-Version: FIXME
Date: Wed, 08 Jul 2015 17:01:48 GMT

Drop deleteme database:

» /opt/influxdb/influx
Connected to http://localhost:8086 version FIXME
InfluxDB shell 0.9.0
> show databases
name: databases
---------------
name
deleteme

> use deleteme
Using database deleteme
> show measurements
name: measurements
------------------
name
cpu_load_short

> drop database deleteme
> show databases
name: databases
---------------
name

Even though deleteme database has been dropped, it can still be 'used' and the measurements are still there. Recreating the deleteme database doesn't change anything (other than it will then appear in show databases):

» /opt/influxdb/influx
Connected to http://localhost:8086 version FIXME
InfluxDB shell 0.9.0
> show databases
name: databases
---------------
name

> use deleteme
Using database deleteme
> show measurements
name: measurements
------------------
name
cpu_load_short

Also, what's with the version FIXME?

@beckettsean
Copy link
Contributor

@dimrozakis please upgrade to 0.9.1. This is a known and fixed bug, covered in #3049

@dimrozakis
Copy link

@beckettsean I upgraded and the the problem is indeed fixed, thanks.

mgattozzi added a commit that referenced this issue Sep 5, 2024
This commit changes how we compact files to use the paths set forth in
this document:

https://docs.google.com/document/d/1Yf7tCvFiXP_unkkpxAD5xX4I764s85Vqgt9jALVgJyo/edit

Given this format:
<compactor id>/c/<db name>/<table>/<gen>/<YYYY-MM-DD>/<HH-MM>/f/<compaction seq>.<file number>.<host>.parquet

We can output a path such as this (from our test suite):
compactor_1/c/test_db/test_table/0/2024-8-22/16-17/f/0.6.us-east-1.parquet

Noticeably this will use the ParquetFileId that was introduced in
#25258. As files are
compacted they'll use this unqiue id as they're written out to object
store.
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

6 participants