← Documents Documentation/admin-guide/blockdev/drbd/data-structure-v9.rst GitHub 원문 ↗

Linux 6.18.37 · Administration / Block devices / DRBD

Kernel data structure for DRBD-9

Resource·device·connection matrix의 교차점인 peer_device, index·back pointer와 reference-counted lifetime을 설명합니다.

Source pathDocumentation/admin-guide/blockdev/drbd/data-structure-v9.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

Object model

data-structure-v9.rst:1-18

Resource가 volume device와 peer-node connection을 소유합니다.

Object matrix

data-structure-v9.rst:19-42

Volume과 connection 교차점, list·IDR indexing과 lifetime을 정리합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 ================================
2 kernel data structure for DRBD-9
3 ================================
4
5 This describes the in kernel data structure for DRBD-9. Starting with
6 Linux v3.14 we are reorganizing DRBD to use this data structure.
7
8 Basic Data Structure
9 ====================
10
11 A node has a number of DRBD resources. Each such resource has a number of
12 devices (aka volumes) and connections to other nodes ("peer nodes"). Each DRBD
13 device is represented by a block device locally.
14
15 The DRBD objects are interconnected to form a matrix as depicted below; a
16 drbd_peer_device object sits at each intersection between a drbd_device and a
17 drbd_connection::
18
19 /--------------+---------------+.....+---------------\
20 | resource | device | | device |
21 +--------------+---------------+.....+---------------+
22 | connection | peer_device | | peer_device |
23 +--------------+---------------+.....+---------------+
24 : : : : :
25 : : : : :
26 +--------------+---------------+.....+---------------+
27 | connection | peer_device | | peer_device |
28 \--------------+---------------+.....+---------------/
29
30 In this table, horizontally, devices can be accessed from resources by their
31 volume number. Likewise, peer_devices can be accessed from connections by
32 their volume number. Objects in the vertical direction are connected by double
33 linked lists. There are back pointers from peer_devices to their connections a
34 devices, and from connections and devices to their resource.
35
36 All resources are in the drbd_resources double-linked list. In addition, all
37 devices can be accessed by their minor device number via the drbd_devices idr.
38
39 The drbd_resource, drbd_connection, and drbd_device objects are reference
40 counted. The peer_device objects only serve to establish the links between
41 devices and connections; their lifetime is determined by the lifetime of the
42 device and connection which they reference.
43

3. 한국어 전문 번역

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

DRBD-9 기본 data structure

1-18

이 문서는 DRBD-9의 in-kernel data structure를 설명합니다. Linux v3.14부터 DRBD를 이 구조로 재구성했습니다.

Node에는 여러 DRBD resource가 있습니다. Resource마다 device(volume) 여러 개와 다른 node(peer node)에 대한 connection 여러 개가 있습니다. 각 DRBD device는 local block device 하나로 표현됩니다.

DRBD object는 matrix를 이루며 `drbd_peer_device` object가 `drbd_device`와 `drbd_connection`의 각 교차점에 놓입니다.

DRBD resource·device·connection matrix

19-42
  /--------------+---------------+.....+---------------\
  |   resource   |    device     |     |    device     |
  +--------------+---------------+.....+---------------+
  |  connection  |  peer_device  |     |  peer_device  |
  +--------------+---------------+.....+---------------+
  :              :               :     :               :
  :              :               :     :               :
  +--------------+---------------+.....+---------------+
  |  connection  |  peer_device  |     |  peer_device  |
  \--------------+---------------+.....+---------------/
DRBD object matrix
Row/columnResource axisDevice volume 0Device volume n
Resource rowdrbd_resourcedrbd_device[0]drbd_device[n]
Connection 0drbd_connection[0]drbd_peer_device[0,0]drbd_peer_device[0,n]
Connection mdrbd_connection[m]drbd_peer_device[m,0]drbd_peer_device[m,n]

Resource의 device column과 connection row가 만나는 곳마다 peer_device가 있습니다.

수평으로 resource에서 volume number로 device에 접근하고 connection에서도 volume number로 peer_device에 접근합니다. 수직 방향 object는 doubly linked list로 연결됩니다. Peer_device는 connection과 device를 가리키는 back pointer를 갖고, connection과 device는 resource를 가리킵니다.

모든 resource는 `drbd_resources` doubly-linked list에 있습니다. 모든 device는 minor device number를 key로 `drbd_devices` IDR에서도 접근할 수 있습니다.

`drbd_resource`, `drbd_connection`, `drbd_device` object는 reference-counted입니다. `peer_device`는 device와 connection 사이 link만 만들며 lifetime은 참조하는 device와 connection의 lifetime으로 결정됩니다.

DRBD references and lifetime
drbd_resourcevolume numberdrbd_device
drbd_connectionvolume numberdrbd_peer_deviceback pointer to device and connection
drbd_resources listall resources
drbd_devices IDRminor numberall devices
device + connection lifetimedetermines peer_device lifetime

Indexing, back pointer와 object lifetime 관계입니다.