Version 6.4.1 failed to drop table on windows system
See original GitHub issueDescribe the bug
log : Table remove failed
To reproduce
Double click on questdb.exe
Browser open localhost:9000
CREATE TABLE my_table(ts timestamp,col int) timestamp(ts);
DROP TABLE ‘my_table’;
Expected Behavior
No response
Environment
- **QuestDB version**: 6.4.1
- **OS**:Windows 10 21H2
- **Browser**: Chrome 103.0.5060.53 (64-bit)
Additional context
2022-06-24T07:53:43.448957Z I i.q.c.h.p.JsonQueryProcessorState [1748] exec [q=‘select build’]
2022-06-24T07:53:43.449013Z I i.q.c.h.p.QueryCache hit [thread=questdb-worker-3, sql=select build]
2022-06-24T07:53:43.449034Z I i.q.c.h.p.JsonQueryProcessorState [1748] execute-cached [skip: 0, stop: 1000]
2022-06-24T07:53:43.449257Z I i.q.c.h.p.JsonQueryProcessorState [1748] timings [compiler: 0, count: 0, execute: 337600, q=select build
]
2022-06-24T07:53:43.449375Z I i.q.c.h.p.JsonQueryProcessor all sent [fd=1748, lastRequestBytesSent=444, nCompletedRequests=11, totalBytesSent=338207]
2022-06-24T07:53:43.449514Z I i.q.c.h.p.QueryCache push [thread=questdb-worker-3, sql=select build]
2022-06-24T07:53:43.450021Z I i.q.c.h.p.JsonQueryProcessorState [1636] exec [q=‘drop table ‘my_table’’]
2022-06-24T07:53:43.450046Z I i.q.c.h.p.QueryCache miss [thread=questdb-worker-3, sql=drop table ‘my_table’]
2022-06-24T07:53:43.451466Z I i.q.c.CairoEngine locked [table=my_table
, thread=14]
2022-06-24T07:53:43.451733Z E i.q.c.CairoEngine remove failed [tableName=‘my_table’, error=5]
2022-06-24T07:53:43.452076Z I i.q.c.CairoEngine unlocked [table=my_table
]
2022-06-24T07:53:43.452104Z E i.q.c.h.p.JsonQueryProcessorState [1636] internal error [q=drop table 'my_table'
, ex=
io.questdb.cairo.CairoException: [5] Table remove failed
]
2022-06-24T07:53:43.452371Z I i.q.c.h.p.JsonQueryProcessor all sent [fd=1636, lastRequestBytesSent=283, nCompletedRequests=13, totalBytesSent=4411639]
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Hi @shlex . I was able to reproduce and prepared a fix that should go out in 6.4.2 .
For the time being - you should be able to delete any table after qdb restart .
It is the same thing and depends on how many times tables() function was called from how many threads (because statements are cached per-thread) and which table it listed last by the function . Windows doesn’t allow deleting open files so delete statement starts removing files in table directory until it finds the first one it can’t and then returns error code . Directory traversal order is filesystem dependent so dir cleanup could fail without removing any files if _meta is returned first or it could remove all files except _meta (because ‘leaked’ descriptor is for table metadata file ) .