Skip to content

Identify storage's by name rather than filesystem id when moving repos

Sami Hiltunen requested to merge smh-filesystem-id-drop into master

When moving repositories, we first check whether the storages are the same or not. If they are the same, the repository is not moved, given that would be a non-sensical operation. The storage's are currently identified by a filesystem ID. This is not necessary, given there's no reason to point two storage's to the same Gitaly storage or to the same Gitaly Cluster virtual storage. As storage names are also unique, we can simply use them to identify whether the source and the target storage are the same.

Praefect doesn't virtualize the filesystem ID. Storage scoped accessor calls like the ServerInfo RPC are routed to a random Gitaly node as none of the nodes have a special status. This causes the filesystem ID returned for a virtual storage to change between calls. This causes issues for the repository moves as if two different Gitaly servers respond to the ServerInfo calls done for the source and destination storage, the repository will be removed from the virtual storage. This causes data loss. Comparing the storage's by name avoids the problem.

In the longer term, the filesystem id should probably be dropped. It's still needed as long as the Rugged patches are around.

Closes gitaly#3752 (closed)

Edited by Sami Hiltunen

Merge request reports