Skip to content

objectpool: Raise error if object pool does not exist on fetch

Patrick Steinhardt requested to merge pks-objectpool-dont-init-on-fetch into master

The objectpool.FetchOrigin() function is responsible for updating an object pool by pulling all changes from its primary pool member. The lifecycle of this function is somewhat weird though: it doesn't require the pool to exist yet, but will instead just create it in case it cannot be found.

This means that the FetchIntoObjectPool() RPC which uses this function unexpectedly has repository-creation semantics. But RPCs that create repositories need special treatment in Gitaly Cluster so that the newly created repository can properly be registered in the database and so that paths may be rewritten as required. The RPC is not marked as such though, which means that things may start to misbehave in case the repo really does get created by FetchOrigin().

Drop this unexpected behaviour and instead raise an error in case the object pool does not exist. Object pools must be created via the CreateObjectPool() RPC first before they can be used, which Gitaly Cluster knows to handle as repository-creating.

Changelog: fixed

Part of #4385 (closed).

Edited by Patrick Steinhardt

Merge request reports