2단계 커밋 프로토콜

위키백과, 우리 모두의 백과사전.

트랜잭션 처리, 데이터베이스, 컴퓨터 네트워크에서 2단계 커밋 프로토콜(two-phase commit protocol, 2PC)은 원자적 커밋 프로토콜(ACP)의 일종이다. 트랜잭션을 커밋할지, 아니면 롤백할지에 대해 분산 원자적 트랜잭션에 관여하는 분산 알고리즘의 하나이다. (특별한 종류의 일치 프로토콜) 이 프로토콜은 수많은 종류의 일시적 시스템 문제(프로세스, 네트워크 노드, 통신 등)에도 목표를 수행하므로 널리 이용된다.[1][2][3] 그러나 잠재적인 모든 문제 구성을 복구할 수 있는 것은 아니며, 드문 경우 문제 해결을 위해 사용자(시스템의 관리자)의 간섭이 요구된다.

기본 알고리즘[편집]

  • 커밋 요청 단계
  • 커밋 단계
    • 성공
    • 실패
Coordinator                                         Cohort
                              QUERY TO COMMIT
                -------------------------------->
                              VOTE YES/NO           prepare*/abort*
                <-------------------------------
commit*/abort*                COMMIT/ROLLBACK
                -------------------------------->
                              ACKNOWLEDGMENT        commit*/abort*
                <--------------------------------  
end

* 표시는 레코드가 안정적인 스토리지로 강제함을 뜻한다.[4]

같이 보기[편집]

참조[편집]

  1. Philip A. Bernstein, Vassos Hadzilacos, Nathan Goodman (1987): Concurrency Control and Recovery in Database Systems, Chapter 7, Addison Wesley Publishing Company, ISBN 0-201-10715-5
  2. Gerhard Weikum, Gottfried Vossen (2001): Transactional Information Systems, Chapter 19, Elsevier, ISBN 1-55860-508-8
  3. Philip A. Bernstein, Eric Newcomer (2009): Principles of Transaction Processing, 2nd Edition Archived 2010년 8월 7일 - 웨이백 머신, Chapter 8, Morgan Kaufmann (Elsevier), ISBN 978-1-55860-623-4
  4. C. Mohan, Bruce Lindsay and R. Obermarck (1986): "Transaction management in the R* distributed database management system",ACM Transactions on Database Systems (TODS), Volume 11 Issue 4, Dec. 1986, Pages 378 - 396