Consider ways to commit repo changes and metadata changes atomically
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 668
- Forks
- 135
- Avg merge
- 4d 19h
- Merged PRs (30d)
- 7
Description
When repositories are updated, the corresponding metadata is updated afterwards sequentially.
However, it is possible that operations on repository succeed, but operations on metadata fail.
This scenario has two consequences:
- The UI shows inconsistent states.
- Api calls will fail until the repository and metadata are synced to the same state.
Below is an example where removeRepo fails, but this scenario can happen with any of createRepo, restoreRepo
Sample case
Assume that repository removal succeeds, but the corresponding metadata removal fails
This means the following patch would've failed, and /repos/{repoName}/removal doesn't exist under dogma/metadata.json.
From this state there are two problems..
- From the UI, it isn't possible to restore/purge the repository since the UI depends on
dogma/metadata.jsoninformation. (The UI shows that the repository is still in thecreatedstate) - For paths from the API, restoration is possible but an exception will be thrown when trying to update the metadata (
RemoveOperationrequires that the path exists). So the repository will be restored, but the rest API http response will indicate failure.
I'm still unsure how to approach this issue, but leaving this issue for reference
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked update paths in server/src/main/java/com/linecorp/centraldogma/server/internal/api/RepositoryServiceV1.java and the corresponding operations in server/src/main/java/com/linecorp/centraldogma/server/metadata/MetadataService.java. Trace createRepo, restoreRepo, and removeRepo, focusing on failures between repository and metadata updates. Done means these operations cannot leave repository and metadata in divergent states, with the affected UI and API flows remaining consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100