Skip to content

Reserve partition ID 1 for storage's metadata partition

Sami Hiltunen requested to merge smh-reserve-partition-id-1 into master

Gitaly may need to store metadata in the storage. This metadata may be general metadata needed to manage the storage and not relate to any specific partition. An example of such metadata is the partition assignment table. It will map (relative_path, partition_id) so we can locate a repository's partition based on its relative path. This is a storage global table though and thus not owned by any specific partition.

Gitaly needs a place to store this sort of metadata. The question then is how Gitaly will know which partition contains this mapping, or other metadata. This commit reserves partition ID 1 for general storage metadata. This solves the chicken and egg problem of where to find the metadata to locate the actual data. With partition ID 1 reserved for metadata, we know to always check there.

There's no metadata partition yet. We simply reserve the ID for future use to ensure we don't need to do migrations in the near future as we are about to roll out WAL on staging.

It's also not relevant for now what this metadata partition will precisely contain. It may contain more or less data. For example, we could either place the partition assignment table there, or we could choose to add indirection and only store the ID of the partition assignment table's real partition there. The important thing is that we have a known location where we can begin our search.

Closes #6078 (closed)

Edited by Sami Hiltunen

Merge request reports