Skip to content
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

Ignore invalid configurations when migrating legacy mirrors and credentials #1007

Merged
merged 1 commit into from
Aug 13, 2024

Commits on Aug 13, 2024

  1. Ignore invalid configurations when migrating legacy mirrors and crede…

    …ntials
    
    Motivation:
    
    If an exception is raised while performing a mirror migration job,
    it tries to roll back the migration.
    https://github.com/line/centraldogma/blob/5912bf7dd52bda8c414ba1e25c9a1155f981b42d/server/src/main/java/com/linecorp/centraldogma/server/internal/mirror/MirroringMigrationService.java#L135-L139
    However, I found out that the rollback also could fail if there is
    no migration on a project. `entries` may be empty that results in raising
    `RedundantChangeException`.
    https://github.com/line/centraldogma/blob/5912bf7dd52bda8c414ba1e25c9a1155f981b42d/server/src/main/java/com/linecorp/centraldogma/server/internal/mirror/MirroringMigrationService.java#L266-L267
    
    Initially, I thought it was better to stop the whole migration job
    immediately to make the migration status atomic if an exception was
    raised. However, that was a bad choice. If it fails, it remains in
    `REPLICATION_ONLY` mode, which is difficult to fix manually.
    
    Modification:
    
    - Always recover the server status to `WRITABLE` even when a mirror
      migration job completes exceptionally.
    - Warn invalid mirror and credential configurations and continue to
      migration the remaining projects.
    - Try to rollback if the new migration directory is not empty.
    
    Result:
    
    - The server status is correctly reset to `WRITABLE` when a mirror
      migration job fails.
    ikhoon committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    65b410f View commit details
    Browse the repository at this point in the history