-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix : 그룹 요청 수락 동시성 문제 해결 , 그룹에 대한 인원정보 API 개발 #462
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 그룹원 아이디 삭제하고, 조회하여 수정
seokho-1116
reviewed
Jun 2, 2024
backend/core/src/main/java/site/timecapsulearchive/core/global/error/ErrorCode.java
Outdated
Show resolved
Hide resolved
...nd/core/src/main/java/site/timecapsulearchive/core/domain/group/api/query/GroupQueryApi.java
Outdated
Show resolved
Hide resolved
backend/core/src/main/java/site/timecapsulearchive/core/global/config/redis/RedissonConfig.java
Outdated
Show resolved
Hide resolved
.../core/src/main/java/site/timecapsulearchive/core/global/config/redis/RedissonLockAspect.java
Outdated
Show resolved
Hide resolved
.../core/src/main/java/site/timecapsulearchive/core/global/config/redis/RedissonLockAspect.java
Outdated
Show resolved
Hide resolved
.../core/src/main/java/site/timecapsulearchive/core/global/config/redis/RedissonLockAspect.java
Outdated
Show resolved
Hide resolved
...java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupCommandService.java
Outdated
Show resolved
Hide resolved
...java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupCommandService.java
Outdated
Show resolved
Hide resolved
.../core/src/main/java/site/timecapsulearchive/core/global/config/redis/RedissonLockAspect.java
Show resolved
Hide resolved
- 테스트도 수정 - redis 상수 처리 추가
- 큐 네트워크 연결을 제외하고 락 적용
seokho-1116
approved these changes
Jun 3, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
작업 내용 (Content)
링크 (Links)
기타 사항 (Etc)
낙관적 락 적용 시 : 현재 Service에서 MemberGroup을 조회하지 않기에, 낙관적락을 사용할 수 없음
비관적 락 적용 시 : MemberGroup 테이블에서 조건에 맞는 MemberGroup의 개수를 세는 조회 쿼리에 적용하면, 독점 Lock을 걸어야 하는데, 이는 해당 행에 읽기와 쓰기를 모두 막아버림. -> 다른 트랜잭션에서는 해당 행에 대한 읽기와 쓰기를 못하므로 부하가 심할 것으로 예상함. (그룹 요청 수락 관련 뿐만 아니라, 다른 비지니스 로직에서도 MemberGroup에 대한 읽기 쓰기 연산이 있기 때문)
따라서 Redis 분산 락을 적용함 -> Lettuce와 Redisson 방식이 있는데, Lettuce는 개발자가 직접 구현을 해야 하고, Redisson은 Lock 인터페이스가 있음. Redis에 계속 요청을 보내서 확인하는 방식이라 Redis에 부하가 Redisson 방식보다 심함. 따라서 더 편하고 분산 락 관련 안전하게 구현 가능한 Redisson 방식으로 선택
그룹원 정보 API는 쿼리가 간단한 JOIN문이라 테스트 안함
Merge 전 필요 작업 (Checklist before merge)
희망 리뷰 완료 일 (Expected due date)