box.snapshot does not remove space folders
Environment:
OS: Ubuntu 22.04.2 LTS
, Centos7
(and I suppose any OS)
tarantool: 2.10.4-13-g0bd23eb1d
, 2.10.5-14-ga646920
Problem:
Empty folder size is 4kB (ext2). Creation/dropping vinyl spaces leaves empty subfolders
Expected Behavior:
After calling box.snapshot()
redundant folders that corresponding dropped spaces are removed
Actual Behavior:
After calling box.snapshot()
redundant folders that corresponding dropped spaces are empty
Steps to Reproduce:
Create and run default app:
cartridge create --name test_app
cartridge build
cartridge start -d
cartridge replicasets setup --bootstrap-vshard
Look at the contents of the storage folder:
test_app$ du -hs tmp/data/test_app.s1-master/*
8.0K tmp/data/test_app.s1-master/00000000000000000000.snap
1.1M tmp/data/test_app.s1-master/00000000000000000000.xlog
20K tmp/data/test_app.s1-master/config
20K tmp/data/test_app.s1-master/config.backup
Create and drop vinyl space:
test_app.s1-master> space_name = "test"
space = box.schema.space.create(space_name, {
format = {
{ "id", "unsigned", is_nullable = false }
},
engine = "vinyl",
if_not_exists = true
})
space:create_index("id", {
type = "TREE",
unique = true,
if_not_exists = true,
parts = { { field = "id", type = "unsigned" } },
})
space:drop()
---
...
Look at the contents of the storage folder:
test_app$ du -hs tmp/data/test_app.s1-master/*
8.0K tmp/data/test_app.s1-master/00000000000000000000.snap
4.0K tmp/data/test_app.s1-master/00000000000000000000.vylog
1.1M tmp/data/test_app.s1-master/00000000000000000000.xlog
8.0K tmp/data/test_app.s1-master/513
20K tmp/data/test_app.s1-master/config
20K tmp/data/test_app.s1-master/config.backup
test_app$ du -hs tmp/data/test_app.s1-master/513/*
4.0K tmp/data/test_app.s1-master/513/0
Also call box.snapshot
:
test_app.s1-master> box.snapshot()
---
- ok
...
It does not work:
test_app$ du -hs tmp/data/test_app.s1-master/*
8.0K tmp/data/test_app.s1-master/00000000000000000000.snap
4.0K tmp/data/test_app.s1-master/00000000000000000000.vylog
84K tmp/data/test_app.s1-master/00000000000000000000.xlog
44K tmp/data/test_app.s1-master/00000000000000015051.snap
4.0K tmp/data/test_app.s1-master/00000000000000015051.vylog
8.0K tmp/data/test_app.s1-master/513
20K tmp/data/test_app.s1-master/config
20K tmp/data/test_app.s1-master/config.backup
test_app$ du -hs tmp/data/test_app.s1-master/513/*
4.0K tmp/data/test_app.s1-master/513/0
Also you can create and drop a lot of space
test_app.s1-master> for i=1,1000 do
space_name = "test" .. tostring(i)
space = box.schema.space.create(space_name, {
format = {
{ "id", "unsigned", is_nullable = false }
},
engine = "vinyl",
if_not_exists = true
})
space:create_index("id", {
type = "TREE",
unique = true,
if_not_exists = true,
parts = { { field = "id", type = "unsigned" } },
})
space:drop()
end
box.snapshot()
test_app$ du -hs tmp/data/*
1.1M tmp/data/test_app.router
8.7M tmp/data/test_app.s1-master
9.1M tmp/data/test_app.s1-replica
1.1M tmp/data/test_app.s2-master
1.1M tmp/data/test_app.s2-replica
1.1M tmp/data/test_app-stateboard
test_app$ du -hs tmp/data/test_app.s1-master/*
8.0K tmp/data/test_app.s1-master/00000000000000000000.snap
180K tmp/data/test_app.s1-master/00000000000000000000.vylog
588K tmp/data/test_app.s1-master/00000000000000000000.xlog
44K tmp/data/test_app.s1-master/00000000000000022044.snap
20K tmp/data/test_app.s1-master/00000000000000022044.vylog
8.0K tmp/data/test_app.s1-master/513
...
8.0K tmp/data/test_app.s1-master/1512
20K tmp/data/test_app.s1-master/config
20K tmp/data/test_app.s1-master/config.backup
Edited by Asya Lomakina