← Documents Documentation/admin-guide/blockdev/drbd/drbd-connection-state-overview.dot GitHub 원문 ↗

Linux 6.18.37 · Admin guide

DRBD 연결 상태 개요

DRBD가 독립 상태에서 연결 협상과 비트맵 교환·재동기화를 거쳐 정상 연결되거나 통신 장애 뒤 재연결을 준비하는 전체 상태 전이를 설명하는 DOT 도식입니다.

Source pathDocumentation/admin-guide/blockdev/drbd/drbd-connection-state-overview.dot
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

drbd-connection-state-overview.dot:1-85

DRBD가 독립 상태에서 연결 협상과 비트맵 교환·재동기화를 거쳐 정상 연결되거나 통신 장애 뒤 재연결을 준비하는 전체 상태 전이를 설명하는 DOT 도식입니다.

핵심은 연결 협상과 데이터 동기화를 분리해 보는 것입니다. 연결 조건이 맞으면 데이터 동일성에 따라 즉시 `Connected`가 되거나 비트맵 교환과 재동기화를 수행하며, 어느 주요 단계에서든 통신 손실이 발생하면 `CommTrouble`을 거쳐 `Unconnected`로 돌아갑니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 // vim: set sw=2 sts=2 :
2 digraph {
3 rankdir=BT
4 bgcolor=white
5
6 node [shape=plaintext]
7 node [fontcolor=black]
8
9 StandAlone [ style=filled,fillcolor=gray,label=StandAlone ]
10
11 node [fontcolor=lightgray]
12
13 Unconnected [ label=Unconnected ]
14
15 CommTrouble [ shape=record,
16 label="{communication loss|{Timeout|BrokenPipe|NetworkFailure}}" ]
17
18 node [fontcolor=gray]
19
20 subgraph cluster_try_connect {
21 label="try to connect, handshake"
22 rank=max
23 WFConnection [ label=WFConnection ]
24 WFReportParams [ label=WFReportParams ]
25 }
26
27 TearDown [ label=TearDown ]
28
29 Connected [ label=Connected,style=filled,fillcolor=green,fontcolor=black ]
30
31 node [fontcolor=lightblue]
32
33 StartingSyncS [ label=StartingSyncS ]
34 StartingSyncT [ label=StartingSyncT ]
35
36 subgraph cluster_bitmap_exchange {
37 node [fontcolor=red]
38 fontcolor=red
39 label="new application (WRITE?) requests blocked\lwhile bitmap is exchanged"
40
41 WFBitMapT [ label=WFBitMapT ]
42 WFSyncUUID [ label=WFSyncUUID ]
43 WFBitMapS [ label=WFBitMapS ]
44 }
45
46 node [fontcolor=blue]
47
48 cluster_resync [ shape=record,label="{<any>resynchronisation process running\l'concurrent' application requests allowed|{{<T>PausedSyncT\nSyncTarget}|{<S>PausedSyncS\nSyncSource}}}" ]
49
50 node [shape=box,fontcolor=black]
51
52 // drbdadm [label="drbdadm connect"]
53 // handshake [label="drbd_connect()\ndrbd_do_handshake\ndrbd_sync_handshake() etc."]
54 // comm_error [label="communication trouble"]
55
56 //
57 // edges
58 // --------------------------------------
59
60 StandAlone -> Unconnected [ label="drbdadm connect" ]
61 Unconnected -> StandAlone [ label="drbdadm disconnect\lor serious communication trouble" ]
62 Unconnected -> WFConnection [ label="receiver thread is started" ]
63 WFConnection -> WFReportParams [ headlabel="accept()\land/or \lconnect()\l" ]
64
65 WFReportParams -> StandAlone [ label="during handshake\lpeers do not agree\labout something essential" ]
66 WFReportParams -> Connected [ label="data identical\lno sync needed",color=green,fontcolor=green ]
67
68 WFReportParams -> WFBitMapS
69 WFReportParams -> WFBitMapT
70 WFBitMapT -> WFSyncUUID [minlen=0.1,constraint=false]
71
72 WFBitMapS -> cluster_resync:S
73 WFSyncUUID -> cluster_resync:T
74
75 edge [color=green]
76 cluster_resync:any -> Connected [ label="resnyc done",fontcolor=green ]
77
78 edge [color=red]
79 WFReportParams -> CommTrouble
80 Connected -> CommTrouble
81 cluster_resync:any -> CommTrouble
82 edge [color=black]
83 CommTrouble -> Unconnected [label="receiver thread is stopped" ]
84
85 }
86

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

연결 협상, 동기화 및 장애 복구 상태 전이

1-85

이 DOT 그래프는 DRBD 연결이 독립 실행 상태에서 시작해 연결 협상, 비트맵 교환과 재동기화를 거쳐 정상 연결 상태에 이르는 흐름을 나타냅니다. `rankdir=BT`는 그래프를 아래에서 위로 배치하고, 흰 배경과 글자색·채움색은 상태의 성격과 진행 단계를 구분합니다. `StandAlone`은 회색, `Connected`는 녹색으로 채워져 시작점과 정상 완료 상태를 강조합니다.

`StandAlone`에서 `drbdadm connect`를 실행하면 `Unconnected`로 이동하고 수신 스레드가 시작되면 `WFConnection`에 들어갑니다. `accept()` 또는 `connect()`가 성립하면 `WFReportParams`에서 피어 매개변수를 교환합니다. 핸드셰이크 중 필수 조건에 합의하지 못하면 `StandAlone`으로 돌아가며, 데이터가 동일해 동기화가 필요 없으면 바로 `Connected`가 됩니다.

동기화가 필요한 경우 소스 쪽은 `WFBitMapS`, 대상 쪽은 `WFBitMapT`로 분기합니다. 대상은 `WFSyncUUID`를 한 번 더 거친 뒤 재동기화 대상 포트로 들어가고, 소스는 재동기화 소스 포트로 직접 들어갑니다. 비트맵 교환 클러스터의 빨간 설명은 비트맵을 교환하는 동안 새 애플리케이션 요청, 특히 쓰기 요청이 차단됨을 뜻합니다.

`cluster_resync`는 재동기화가 진행되는 `SyncSource`·`SyncTarget`과 일시 정지 상태 `PausedSyncS`·`PausedSyncT`를 한 레코드로 묶습니다. 이 구간에서도 동시 애플리케이션 요청은 허용됩니다. 재동기화가 끝나면 녹색 간선을 따라 `Connected`로 이동합니다. 원문의 간선 라벨 `resnyc done`은 `resync done`의 오타이지만 원문 보존을 위해 그대로 유지합니다.

`WFReportParams`, `Connected`, 재동기화 실행 상태에서 통신 손실이 발생하면 빨간 간선을 따라 `CommTrouble`로 이동합니다. 이 레코드는 `Timeout`, `BrokenPipe`, `NetworkFailure`를 통신 손실의 세 유형으로 열거합니다. 수신 스레드가 정지하면 `Unconnected`로 돌아가 재연결을 준비합니다. `TearDown`, `StartingSyncS`, `StartingSyncT`는 그래프에 선언되어 있지만 이 파일에서는 연결된 전이 간선이 없습니다.

DRBD 연결 수립과 동기화 흐름
StandAlonedrbdadm connectUnconnectedreceiver thread is startedWFConnectionaccept() / connect()WFReportParamsdata identical / no sync neededConnected
WFReportParams동기화 소스WFBitMapS비트맵 교환SyncSource / PausedSyncSresync doneConnected
WFReportParams동기화 대상WFBitMapTWFSyncUUIDSyncTarget / PausedSyncTresync doneConnected

협상 결과에 따른 정상 연결, 소스 재동기화, 대상 재동기화 경로를 구조화해 보여 줍니다.

상태와 상태 그룹
상태·그룹표시한국어 해설
StandAlone회색 채움네트워크 연결이 없고 독립적으로 동작하는 상태
Unconnected연한 회색연결 시도 전후의 미연결 상태
WFConnection연결 시도 클러스터수신 스레드가 피어 연결을 기다리는 상태
WFReportParams연결 시도 클러스터핸드셰이크에서 피어 매개변수를 교환하는 상태
Connected녹색 채움정상 연결되어 데이터 처리가 가능한 상태
CommTrouble레코드Timeout, BrokenPipe, NetworkFailure로 분류되는 통신 손실
WFBitMapS빨간색동기화 소스가 비트맵 교환을 기다리는 상태
WFBitMapT빨간색동기화 대상이 비트맵 교환을 기다리는 상태
WFSyncUUID빨간색동기화 대상이 동기화 UUID를 기다리는 상태
cluster_resync파란색 레코드SyncSource·SyncTarget 및 PausedSyncS·PausedSyncT를 포함하는 재동기화 실행 그룹
TearDown회색선언되어 있으나 이 그래프에는 전이 간선이 없는 종료 처리 상태
StartingSyncS연한 파란색선언되어 있으나 이 그래프에는 전이 간선이 없는 소스 동기화 시작 상태
StartingSyncT연한 파란색선언되어 있으나 이 그래프에는 전이 간선이 없는 대상 동기화 시작 상태

원문에 선언된 모든 상태, 레코드 및 클러스터의 의미를 정리합니다.

상태 전이 전체
출발도착원문 조건·라벨의미
StandAloneUnconnecteddrbdadm connect관리 명령으로 연결 절차 시작
UnconnectedStandAlonedrbdadm disconnect / serious communication trouble명시적 연결 해제 또는 심각한 통신 장애로 독립 상태 복귀
UnconnectedWFConnectionreceiver thread is started수신 스레드 시작 후 피어 연결 대기
WFConnectionWFReportParamsaccept() and/or connect()전송 연결 성립 후 매개변수 보고 단계 진입
WFReportParamsStandAlonepeers do not agree about something essential필수 핸드셰이크 조건 불일치로 연결 포기
WFReportParamsConnecteddata identical / no sync needed데이터가 같아 동기화 없이 연결 완료
WFReportParamsWFBitMapS라벨 없음로컬이 동기화 소스인 비트맵 교환 경로
WFReportParamsWFBitMapT라벨 없음로컬이 동기화 대상인 비트맵 교환 경로
WFBitMapTWFSyncUUIDminlen=0.1, constraint=false대상 비트맵 단계 뒤 동기화 UUID 대기
WFBitMapScluster_resync:S라벨 없음소스 포트로 재동기화 실행 그룹 진입
WFSyncUUIDcluster_resync:T라벨 없음대상 포트로 재동기화 실행 그룹 진입
cluster_resync:anyConnectedresnyc done재동기화 완료 후 정상 연결 상태 전환
WFReportParamsCommTrouble빨간 간선매개변수 교환 중 통신 손실
ConnectedCommTrouble빨간 간선정상 연결 중 통신 손실
cluster_resync:anyCommTrouble빨간 간선재동기화 중 통신 손실
CommTroubleUnconnectedreceiver thread is stopped수신 스레드 종료 후 미연결 상태로 복귀

DOT 원문의 16개 방향 간선을 빠짐없이 한국어로 설명합니다.

// vim: set sw=2 sts=2 :
digraph {
  rankdir=BT
  bgcolor=white

  node [shape=plaintext]
  node [fontcolor=black]

  StandAlone     [ style=filled,fillcolor=gray,label=StandAlone ]

  node [fontcolor=lightgray]

  Unconnected    [ label=Unconnected ]

  CommTrouble [ shape=record,
    label="{communication loss|{Timeout|BrokenPipe|NetworkFailure}}" ]

  node [fontcolor=gray]

  subgraph cluster_try_connect {
    label="try to connect, handshake"
    rank=max
    WFConnection   [ label=WFConnection ]
    WFReportParams [ label=WFReportParams ]
  }

  TearDown       [ label=TearDown ]

  Connected      [ label=Connected,style=filled,fillcolor=green,fontcolor=black ]

  node [fontcolor=lightblue]

  StartingSyncS  [ label=StartingSyncS ]
  StartingSyncT  [ label=StartingSyncT ]

  subgraph cluster_bitmap_exchange {
    node [fontcolor=red]
    fontcolor=red
    label="new application (WRITE?) requests blocked\lwhile bitmap is exchanged"

    WFBitMapT      [ label=WFBitMapT ]
    WFSyncUUID     [ label=WFSyncUUID ]
    WFBitMapS      [ label=WFBitMapS ]
  }

  node [fontcolor=blue]

  cluster_resync [ shape=record,label="{<any>resynchronisation process running\l'concurrent' application requests allowed|{{<T>PausedSyncT\nSyncTarget}|{<S>PausedSyncS\nSyncSource}}}" ]

  node [shape=box,fontcolor=black]

  // drbdadm [label="drbdadm connect"]
  // handshake [label="drbd_connect()\ndrbd_do_handshake\ndrbd_sync_handshake() etc."]
  // comm_error [label="communication trouble"]

  //
  // edges
  // --------------------------------------

  StandAlone -> Unconnected [ label="drbdadm connect" ]
  Unconnected -> StandAlone  [ label="drbdadm disconnect\lor serious communication trouble" ]
  Unconnected -> WFConnection [ label="receiver thread is started" ]
  WFConnection -> WFReportParams [ headlabel="accept()\land/or                        \lconnect()\l" ]

  WFReportParams -> StandAlone [ label="during handshake\lpeers do not agree\labout something essential" ]
  WFReportParams -> Connected [ label="data identical\lno sync needed",color=green,fontcolor=green ]

    WFReportParams -> WFBitMapS
    WFReportParams -> WFBitMapT
    WFBitMapT -> WFSyncUUID [minlen=0.1,constraint=false]

      WFBitMapS -> cluster_resync:S
      WFSyncUUID -> cluster_resync:T

  edge [color=green]
  cluster_resync:any -> Connected [ label="resnyc done",fontcolor=green ]

  edge [color=red]
  WFReportParams -> CommTrouble
  Connected -> CommTrouble
  cluster_resync:any -> CommTrouble
  edge [color=black]
  CommTrouble -> Unconnected [label="receiver thread is stopped" ]

}