-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check if the internal project and repos exist before creating them #1010
Conversation
Motivation: Central Dogma server currently attempts to create internal projects and repositories during starting up, even if they already exist. This is unnecessary for most scenarios, except when setting up a new cluster. Modifications: - Added checks to verify if the internal project and repositories exist before attempting to create them. - Propagated the read-only exception to the caller if it's raised while creating the internal project. - It doesn't make sense to continue to run the cluster because the internal project must exist when the cluster gets back to non read-only mode. Result: - Central Dogma servers now checks for the existence of internal projects and repos before attempting to create them.
"mirroringEnabled": true, | ||
"numMirroringThreads": null, | ||
"maxNumFilesPerMirror": null, | ||
"maxNumBytesPerMirror": null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me remove these broken properties for now.
We will introduce a build process to prevent this sort of mistakes later as described in
#1003
throw new Error("failed to initialize an internal project: " + projectName, peeled); | ||
if (!projectManager.exists(projectName)) { | ||
try { | ||
executor.execute(createProject(creationTimeMillis, Author.SYSTEM, projectName)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Could you wrap createProject()
and createRepository()
with forcePush()
command to make it work in REPLICATION_ONLY
mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion. Applied. 👍
server/src/main/java/com/linecorp/centraldogma/server/command/Command.java
Show resolved
Hide resolved
The test failure in CI will be fixed by #1016 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @minwoox! 👍👍
Motivation:
Central Dogma server currently attempts to create internal projects and repositories during starting up, even if they already exist. This is unnecessary for most scenarios, except when setting up a new cluster.
Modifications:
Result: