consulfs icon indicating copy to clipboard operation
consulfs copied to clipboard

mv command is not possible

Open LordFPL opened this issue 8 years ago • 2 comments

Hello,

Thx for this projet, it can be very usefull... but in my case i'm blocked due to the mv command forbiden. I create this issue in case you have a solution, or for others.

All the best :)

LordFPL avatar Aug 02 '17 11:08 LordFPL

Hi, thanks for looking at this project!

There's a good reason for the omission. The "mv" command is implemented using the "rename" operation on a file system, which POSIX says should be atomic. If interrupted, the source and destination paths must either be both unmodified or both changed. It's the only multi-file atomic operation in a POSIX file system, so a lot of software uses it to provide safe modifications.

When I started, Consul didn't support an atomic operation that would remove one key and add another. Rather than implement a non-atomic rename, I just disabled renames altogether. However, a "transaction" endpoint was added to Consul 0.7.0, making it possible to implement as a copy-and-delete operation.

I'll leave this issue open to document the feature request. I make no promise as to when I can build out this piece of functionality.

bwester avatar Aug 02 '17 18:08 bwester

Many thanks for this (very) complete answer :) For information, i have asked to consul group information about an official solution like yours : https://groups.google.com/forum/#!topic/consul-tool/TaPpkq3MdoY

LordFPL avatar Aug 02 '17 21:08 LordFPL