Title
#users-public
l

Lalit Patel

09/12/2022, 10:21 AM
Hi, I am new to QuestDB. I am using version 6.5.2 . I tried to go through https://questdb.io/docs/get-started/first-database . But in the end of tutorial DROP TABLE command is just not working in both web console and psql terminal with following error in log - "2022-09-12T10:08:02.360736Z I i.q.g.SqlCompiler batch [text=DROP TABLE 'sensors';] 2022-09-12T10:08:02.361894Z I i.q.c.p.ReaderPool closed 'sensors' [at=0:0, reason=LOCKED] 2022-09-12T10:08:02.361952Z I i.q.c.CairoEngine locked [table=
sensors
, thread=13] 2022-09-12T10:08:02.362142Z E i.q.c.CairoEngine remove failed [tableName='sensors', error=39] 2022-09-12T10:08:02.362415Z I i.q.c.CairoEngine unlocked [table=
sensors
] 2022-09-12T10:08:02.362464Z C i.q.c.p.PGConnectionContext error [pos=-1, msg=
Table remove failed
, errno=`39]" I tried to clear the table using command TRUNCATE TABLE 'sensors'; and then then tried again to drop table, but error remain same. What I am missing here ?
Jaromir Hamala

Jaromir Hamala

09/12/2022, 10:45 AM
Hello Lalit, what OS you are running on? Can you share your code?
l

Lalit Patel

09/12/2022, 10:48 AM
I am running CentOS Linux 7.9.2009 64 bit. I am just trying the DROP command in web-console as well as using psql terminal
10:51 AM
Is there some configuration option to turn on DROP command to be executed ? I am just evaluating for one of our use case.
Jaromir Hamala

Jaromir Hamala

09/12/2022, 10:54 AM
Table remove failed
, errno=`39] according to https://questdb.io/docs/troubleshooting/os-error-codes/ the errno 39 means
Directory not empty.
The directory is expected not to be empty. so the error is weird. do know what filesystem you are using?
l

Lalit Patel

09/12/2022, 11:09 AM
I am using xfs filesystem. My test machine is basically a Virtual Machine.
11:11 AM
I also saw errno 39. Thats why I tried to clear all records. But still I am not able to drop the tables. I thought it is a small issue. Shall I post an issue over github ?
Jaromir Hamala

Jaromir Hamala

09/12/2022, 11:49 AM
just a quick test to rule out silly errors: Are you using the table name consistently in lower case? it means
CREATE TABLE sensors
and not e.g.
CREATE TABLE Sensors
or similar.
l

Lalit Patel

09/12/2022, 12:07 PM
I checked it again. I am using the correct name. But still I am not able to drop the table.
Jaromir Hamala

Jaromir Hamala

09/12/2022, 12:19 PM
that’s super strange. this is such a basic use-case. there must be something in your setup which makes it different from most. XFS could be a candidate, but chances are there is something else. let me try to reproduce it. you said it’s a virtual machine. is it vmware? xen? kvm? ec2? something else?
l

Lalit Patel

09/12/2022, 12:34 PM
KVM through openstack. Thanks
Jaromir Hamala

Jaromir Hamala

09/12/2022, 12:51 PM
hm, I’m running the same centos, with XFS, but I cannot reproduce the issue
12:53 PM
can you go to your DB directory and do
ls -la
? the default DB directory on Linux is in
/home/<user>/.questdb/db
12:54 PM
the DB directory has one directory per table. the
DROP TABLE
command is supposed to recursively delete everything from the directory belonging to the table being dropped. and then drop the table directory itself. for some reason this does not work for you. chances are there is a hidden file or something and the recursive delete misses it and then it fails to delete the main table directory. but it’s just a hypothesis, without having any evidence. so let’s try to gather some.
l

Lalit Patel

09/12/2022, 4:25 PM
I had configured my own dir instead of default. However I ensured that user has RW permission in the dir. In mean time I tested with a different machine with ext4 filesystem and it worked without an issue. I will check with default dir and get back to you tomorrow. Thanks for your kind suggestion.