Zero unused space #881
Replies: 3 comments 2 replies
-
It's possible with the I created a POC that queries the database and deallocates unused space from all associated volumes. |
Beta Was this translation helpful? Give feedback.
-
|
I would wait for a tested/proven version of it. If I loose lots of data again I'll probably stop trying to make sia work. I heard about punch hole thing. That wouldn't require a lot of IO. It should be just meta data, right? |
Beta Was this translation helpful? Give feedback.
-
|
@Didrole Thanks! I'll check it soon. Have you tested it on a real node? Maybe I should make a test net node to play with it |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been talking for a while about this feature for a while in other issues, but it seems I haven't created it's own discussion.
It' would be nice to have an option (off by default, that can be turned on) to automatically zero freed storage space (write zeroes). I'm not sure if it's possible to report it unused to the filesystem and go back to being sparse file - that would be even better. I know creating a sparse file is possible, but once he space is filled I don't know if you can free holes in the middle.
I'll explain again why I need this. All of my hosts share the disk space with storage that's also used for different purpose. If I allow 10TB of storage for hostd then it gets slowly fragmented and all of the space is taken. even though half may be actually used. To counter this I resize volumes, but it's quite troublesome and slow.
Zeroing the unused space would effectively free that space since I'm on ZFS with compression. Even the lowest compression level makes zeros take almost no space at all. I don't know how they do it but large sequences of zeroes take almost no space. The only penalty is the data being zeroed has to be read before writing zeroes.
Alternative solution: I really don't want to go there, but if you can't squeeze it into your plans, please tell me how to figure out the empty blocks and zero it manually - offline of course. I know if I mess up something I'll ruin my contracts storage, so I would prefer to not do that, so it's a last resort. Give me a quick info where in the database can I get this info from, exact block size in bytes. Are there any caveats? Anything I don't know that might break something even if I don't mess up the blocks offsets/sizes?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions