Praefect - Replication logic
When the goal is to have n replica's of a certain repository praefect should be able to create a new replica.
- Check if the repository exists
- If this is the case; either remove or update. (implementation detail, not decided at the time of writing)
- Create a repository as mirror
- Ensure all refs are fetched. (keep-around, environments, etc, etc)
- Calculate the checksum for both the leader and the new replica to check if these are the same.
This is probably a bit dense, and non-exhaustive. For example; the checksum calculation is probably racey. But the question is if the initial version needs to deal with these problems, or if allowing experimentation is more important.
Another question to answer; there's no mechanism yet to mark 1 repository suitable for replication. This might require an RPC, or a config option? The latter option is less dynamic, and might not suffice.