Skip to content

Implement n-level directory hashing for backend storage #22532

Closed as not planned
@juur

Description

@juur

Feature Description

It would be handy for scaling and other factors if the repository location could involve a multiple level hash, e.g. instead of /repo.git you have /123/456/789/repo.git or /2/repo.git. The hashing should be configurable in terms of both the unique-values-per-level and the number-of-levels.

This could support simple scaling of NFS backed storage, with perhaps the first layer being 4 (giving [0-4] as the top level directory, corresponding to 4 different mount points) and the second layer being 256 (00 - ff) which may improve performance for entries-per-directory.

The algorithm used should be exposed via some simple CLI tool or similar, such that re-hashing can be done via shell scripts or similar, e.g. mv $(gitea-hash 4 256 repo-name)/repo-name $(gitea-hash 8 256 repo-name)/repo-name to enable scaling

Go I think implements the FNV algorithm which is pretty trivial, so low overhead.

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/featureCompletely new functionality. Can only be merged if feature freeze is not active.type/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions