dontbesatisfied / MongoDB-QnA

카카오톡 오픈채팅방 https://open.kakao.com/o/gcgPaEmc 에서 올라온 질문과 답변을 올려놓는 저장소
7 stars 0 forks source link

Given transaction number x does not match any in-progress transactions. The active transaction number is x #5

Closed SHwan93 closed 3 years ago

SHwan93 commented 3 years ago

Enviroment(please complete the following information):

Describe the question Given transaction number x does not match any in-progress transactions. The active transaction number is x

SHwan93 commented 3 years ago

이 에러는 데이터베이스의 성능과 연관이 있을 수 있습니다. 트랜잭션이 정상적으로 처리되고 세션을 종료시키는데 딜레이가 생겨서 트랜잭션을 요구하는 요청이 많으면 발생합니다.

때문에 withTransaction 이라는 helper 함수를 이용해서 retry을 보장하여 해결하였습니다