Skip to content

[BE] 자동 롤백 기준을 liveness로 변경#374

Merged
w0uldy0u merged 21 commits intodevfrom
chore/#366/auto_rollback_using_liveness
Feb 16, 2026
Merged

[BE] 자동 롤백 기준을 liveness로 변경#374
w0uldy0u merged 21 commits intodevfrom
chore/#366/auto_rollback_using_liveness

Conversation

@w0uldy0u
Copy link
Collaborator

Closes #366

목적

API 서버의 문제가 아닌, 잠시 DB 혹은 Redis와의 연결이 불안정할때 자동으로 롤백 하는 것을 방지합니다.

@w0uldy0u w0uldy0u self-assigned this Feb 14, 2026
@w0uldy0u w0uldy0u added deploy 배포 관련 인프라 labels Feb 14, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @w0uldy0u, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 풀 리퀘스트는 백엔드 API 서버의 배포 안정성을 향상시키기 위해 자동 롤백 기준을 liveness 헬스 체크로 변경합니다. 이는 API 서버 자체는 정상 작동하지만, DB나 Redis와 같은 외부 의존성 연결이 일시적으로 불안정할 때 불필요한 자동 롤백이 발생하는 것을 방지합니다. 또한, Yjs 협업 데이터의 영속성을 위해 Redis Stream을 통합하여 실시간 협업 기능의 견고함을 더했습니다.

Highlights

  • Redis를 활용한 Yjs 협업 데이터 영속성: Yjs 협업 데이터의 영속성을 위해 Redis Stream을 통합했습니다. CollaborationService가 Yjs 업데이트 프레임을 RedisStreamStore를 통해 Redis에 저장하도록 리팩토링되었습니다.
  • 자동 롤백 기준 변경 (liveness): Spring Boot Actuator의 헬스 체크 그룹을 readinessliveness로 분리하고, 백엔드 서비스의 자동 롤백 기준을 liveness로 변경했습니다. 이는 API 서버 자체는 정상 작동하지만, DB나 Redis와 같은 외부 의존성 연결이 일시적으로 불안정할 때 불필요한 자동 롤백을 방지합니다.
  • Docker Compose 환경 업데이트: 개발 및 스테이징 환경의 Docker Compose 파일에 Redis 서비스 정의와 헬스 체크 설정이 추가되었습니다. 또한, 백엔드 서비스의 헬스 체크 로직이 개선되고 MySQL 및 Redis에 대한 의존성이 명시되었습니다.
  • 단위 테스트 추가: CollaborationServiceSessionRegistry의 핵심 로직에 대한 단위 테스트가 추가되어 코드의 안정성을 높였습니다.
Changelog
  • backend/api/build.gradle
    • spring-boot-starter-data-redis 의존성이 추가되었습니다.
  • backend/api/src/main/java/com/yat2/episode/collaboration/CollaborationService.java
    • RedisStreamStore를 사용하도록 리팩토링되었으며, Yjs 업데이트 프레임을 Redis에 추가하는 로직과 toByteArray 헬퍼 메서드가 추가되었습니다.
  • backend/api/src/main/java/com/yat2/episode/collaboration/RedisStreamRepository.java
    • 제거되었습니다.
  • backend/api/src/main/java/com/yat2/episode/collaboration/RedisStreamStore.java
    • Yjs 업데이트를 Redis Stream에 저장하기 위한 새로운 서비스가 추가되었습니다.
  • backend/api/src/main/java/com/yat2/episode/collaboration/YjsProtocolUtil.java
    • Yjs 업데이트 프레임을 식별하는 유틸리티 클래스가 추가되었습니다.
  • backend/api/src/main/java/com/yat2/episode/global/config/RedisConfig.java
    • RedisTemplate<String, byte[]>를 위한 Redis 설정이 추가되었습니다.
  • backend/api/src/main/resources/application.yml
    • Redis 연결 속성이 구성되었고, Actuator 헬스 체크 그룹이 readinessliveness로 업데이트되었습니다.
  • backend/api/src/test/java/com/yat2/episode/collaboration/CollaborationServiceTest.java
    • CollaborationService에 대한 단위 테스트가 추가되었습니다.
  • backend/api/src/test/java/com/yat2/episode/collaboration/SessionRegistryTest.java
    • SessionRegistry에 대한 단위 테스트가 추가되었습니다.
  • backend/docker-compose.yml
    • Redis 서비스 및 볼륨 정의가 추가되었습니다.
  • infra/prod/docker-compose.yml
    • Caddy에 UDP 포트 매핑이 추가되었습니다.
  • infra/stage/docker-compose.yml
    • 백엔드 헬스 체크가 업데이트되었고, MySQL 및 Redis에 대한 depends_on이 추가되었으며, Redis 서비스와 헬스 체크가 추가되었습니다.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/deploy-production.yml
    • .github/workflows/deploy-staging.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이 PR은 API 서버의 헬스체크 기준을 변경하여 DB나 Redis와 같은 외부 의존성의 일시적인 문제로 인해 서비스가 롤백되는 것을 방지하는 것을 목표로 하고 있습니다. livenessreadiness 프로브를 분리한 것은 좋은 접근입니다. 또한, 협업 기능에서 발생하는 업데이트를 Redis Stream에 저장하여 영속성을 확보하고, 이에 대한 테스트 코드를 추가한 점도 긍정적입니다. 몇 가지 개선점을 제안합니다. 스테이징 환경의 docker-compose.yml에서 헬스체크가 의도와 다르게 동작할 수 있는 부분을 수정하고, Redis에 데이터를 저장할 때 원자성을 보장하도록 개선하는 것을 고려해 보세요.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da01bd54ae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Collaborator

@kimhji kimhji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

혹시 merge into dev에서 기존에 base로 두신 branch로 변경 가능할까요?
변경사항 파악이 어려워요 🥲

@w0uldy0u w0uldy0u changed the base branch from dev to feat/#356/use_redis_to_save_yjs_update February 15, 2026 18:29
@w0uldy0u
Copy link
Collaborator Author

혹시 merge into dev에서 기존에 base로 두신 branch로 변경 가능할까요? 변경사항 파악이 어려워요 🥲

해뒀습니다!

Copy link
Collaborator

@kimhji kimhji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@w0uldy0u w0uldy0u changed the base branch from feat/#356/use_redis_to_save_yjs_update to dev February 15, 2026 19:28
@w0uldy0u w0uldy0u merged commit 16b267e into dev Feb 16, 2026
4 checks passed
@w0uldy0u w0uldy0u deleted the chore/#366/auto_rollback_using_liveness branch February 16, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deploy 배포 관련 인프라

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BE] 자동 롤백 Liveness 기준으로 수정

2 participants