lakeFS icon indicating copy to clipboard operation
lakeFS copied to clipboard

3713 repository state and unique identifier

Open itaidavid opened this issue 1 year ago • 1 comments

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 showactive` 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

itaidavid avatar Jul 24 '22 00:07 itaidavid

Closes #3713

itaidavid avatar Jul 24 '22 06:07 itaidavid

Closed as it is covered by #3841

itaidavid avatar Aug 15 '22 16:08 itaidavid