brig icon indicating copy to clipboard operation
brig copied to clipboard

copy does not pin destination

Open evgmik opened this issue 4 years ago • 3 comments

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.

evgmik avatar Mar 15 '21 03:03 evgmik

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.

sahib avatar Apr 03 '21 15:04 sahib

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.

evgmik avatar Apr 11 '21 00:04 evgmik

Maybe we should wait until we implement our new 'pin' hints.

Agreed.

sahib avatar Apr 11 '21 16:04 sahib