brig
brig copied to clipboard
copy does not pin destination
When a file or dir is copied, it does not get pinned, and thus candidate for removal which is not intended. Test case
$ ali touch /t1
$ ali cp /t1 t2
$ ali ls
SIZE BKEND MODTIME PATH PIN CACHED HINT
0 B 44 B 2021-03-14 23:01:14 EDT /t1 ✔ ✔ enc:chacha20-zip:guess
0 B 44 B 2021-03-14 23:01:14 EDT /t2 ✔ enc:chacha20-zip:guess
Notice that pin for copied /t2 is unset.
I would say fs.Copy should preserve the pin status.
I would say fs.Copy should preserve the pin status.
Yep, it probably should.
Side note: I'm currently working on re-building linker.go (...and probably rename it to mdag.go...) to support a transparent staging area that does not generate many intermediate, wasteful metadata copies. That's a bigger undertaking though and will keep me busy in the next time.
I looked at possible implementation, of pin status copy. It seems to be convoluted since the node does not store its pin status within itself. Additionally, copy internally does not keep reference to the source, so access to pin statuses of a directory children is lost.
I also debating now with myself that maybe pin status should not be copied. It is really intention dependent.
Maybe we should wait until we implement our new 'pin' hints.
Maybe we should wait until we implement our new 'pin' hints.
Agreed.