lakeFS
lakeFS copied to clipboard
3713 repository state and unique identifier
Introducing RepositoryState
- A repository is either active
- can be used and accessed normally, or it is deleting
which means it is not accessible for any use, except for a delete retry
Repository creation was changed to create the initial commit and default branch prior to the repository itself, guaranteeing that once the reposiory is created it is created completely. There is a chance, of course, that due to a failure the commit or branch are left hanging, unreachable, in the DB
Repository deletion was modified to set the RepositoryState
to deleting
, making the repository inaccessible and, in fact, deleted. This state update is followed by a deletion of all repositorys entities and eventually the repository itself. It is possible that this will be a long operation and may involve some retries. For the entire operation, the
RepositoryIDcannot be reused, although the repository "does not exist" Get/list respositories was modified to only show
active` repositories
In order to achieve the above, this PR includes some refactoring to the ref/manager:
Some new repository (private) get functions introduced, to support getting a deleted
repository, without breaking the GetRepository
interface that only returns an active repository. Added some functionality to return a Repository or a RepositoryRecord, with or without predicate, to supprt different needs by different functions
Branch and Commit creation logic was moved to private createBranch and addCommit to break the dependency of an existing repository and support the precreation of these entities as part of a respoitory creation. The interface functions CreateBranch
and AddCommit
use these private functions
Closes #3713
Closed as it is covered by #3841