Revision 8fa74099

b/Makefile.am
581 581
# has to exist in order for the sphinx module to be loaded
582 582
# successfully, but we certainly don't want the docs to be rebuilt if
583 583
# it changes
584
doc/html/index.html: $(docrst) $(docdot) doc/conf.py configure.ac \
584
doc/html/index.html: $(docrst) doc/conf.py configure.ac \
585 585
	$(RUN_IN_TEMPDIR) lib/build/sphinx_ext.py \
586 586
	lib/build/shell_example_lexer.py lib/opcodes.py lib/ht.py \
587 587
	| $(BUILT_PYTHON_SOURCES)
......
611 611
	  cat $<; \
612 612
	} > $@
613 613

  
614
docdot = \
615
	doc/arch-2.0.dot \
616
	doc/design-2.1-lock-acquire.dot \
617
	doc/design-2.1-lock-release.dot
618

  
619 614
# Things to build but not to install (add it to EXTRA_DIST if it should be
620 615
# distributed)
621 616
noinst_DATA = \
......
815 810
	devel/webserver \
816 811
	tools/kvm-ifup.in \
817 812
	tools/vcluster-setup.in \
818
	$(docdot) \
819 813
	$(docrst) \
820 814
	doc/conf.py \
821 815
	doc/html \
/dev/null
1
digraph "ganeti-2.0-architecture" {
2
  compound=false
3
  concentrate=true
4
  mclimit=100.0
5
  nslimit=100.0
6
  edge[fontsize="8" fontname="Helvetica-Oblique"]
7
  node[width="0" height="0" fontsize="12" fontcolor="black" shape=rect]
8

  
9
  subgraph outside {
10
    rclient[label="external clients"]
11
    label="Outside the cluster"
12
  }
13

  
14
  subgraph cluster_inside {
15
    label="ganeti cluster"
16
    labeljust=l
17
    subgraph cluster_master_node {
18
      label="master node"
19
      rapi[label="RAPI daemon"]
20
      cli[label="CLI"]
21
      watcher[label="Watcher"]
22
      burnin[label="Burnin"]
23
      masterd[shape=record style=filled label="{ <luxi> luxi endpoint | master I/O thread | job queue | {<w1> worker| <w2> worker | <w3> worker }}"]
24
      {rapi;cli;watcher;burnin} -> masterd:luxi [label="LUXI" labelpos=100]
25
    }
26

  
27
    subgraph cluster_nodes {
28
        label="nodes"
29
        noded1 [shape=record label="{ RPC listener | Disk management | Network management | Hypervisor } "]
30
        noded2 [shape=record label="{ RPC listener | Disk management | Network management | Hypervisor } "]
31
        noded3 [shape=record label="{ RPC listener | Disk management | Network management | Hypervisor } "]
32
    }
33
    masterd:w2 -> {noded1;noded2;noded3} [label="node RPC"]
34
    cli -> {noded1;noded2;noded3} [label="SSH"]
35
  }
36

  
37
  rclient -> rapi [label="RAPI protocol"]
38
}
b/doc/design-2.0.rst
102 102

  
103 103
The new design will change the cluster architecture to:
104 104

  
105
.. graphviz:: arch-2.0.dot
105
.. digraph:: "ganeti-2.0-architecture"
106

  
107
  compound=false
108
  concentrate=true
109
  mclimit=100.0
110
  nslimit=100.0
111
  edge[fontsize="8" fontname="Helvetica-Oblique"]
112
  node[width="0" height="0" fontsize="12" fontcolor="black" shape=rect]
113

  
114
  subgraph outside {
115
    rclient[label="external clients"]
116
    label="Outside the cluster"
117
  }
118

  
119
  subgraph cluster_inside {
120
    label="ganeti cluster"
121
    labeljust=l
122
    subgraph cluster_master_node {
123
      label="master node"
124
      rapi[label="RAPI daemon"]
125
      cli[label="CLI"]
126
      watcher[label="Watcher"]
127
      burnin[label="Burnin"]
128
      masterd[shape=record style=filled label="{ <luxi> luxi endpoint | master I/O thread | job queue | {<w1> worker| <w2> worker | <w3> worker }}"]
129
      {rapi;cli;watcher;burnin} -> masterd:luxi [label="LUXI" labelpos=100]
130
    }
131

  
132
    subgraph cluster_nodes {
133
        label="nodes"
134
        noded1 [shape=record label="{ RPC listener | Disk management | Network management | Hypervisor } "]
135
        noded2 [shape=record label="{ RPC listener | Disk management | Network management | Hypervisor } "]
136
        noded3 [shape=record label="{ RPC listener | Disk management | Network management | Hypervisor } "]
137
    }
138
    masterd:w2 -> {noded1;noded2;noded3} [label="node RPC"]
139
    cli -> {noded1;noded2;noded3} [label="SSH"]
140
  }
141

  
142
  rclient -> rapi [label="RAPI protocol"]
106 143

  
107 144
This differs from the 1.2 architecture by the addition of the master
108 145
daemon, which will be the only entity to talk to the node daemons.
/dev/null
1
digraph "design-2.1-lock-acquire" {
2
  graph[fontsize=8, fontname="Helvetica"]
3
  node[fontsize=8, fontname="Helvetica", width="0", height="0"]
4
  edge[fontsize=8, fontname="Helvetica"]
5

  
6
  /* Actions */
7
  abort[label="Abort\n(couldn't acquire)"]
8
  acquire[label="Acquire lock"]
9
  add_to_queue[label="Add condition to queue"]
10
  wait[label="Wait for notification"]
11
  remove_from_queue[label="Remove from queue"]
12

  
13
  /* Conditions */
14
  alone[label="Empty queue\nand can acquire?", shape=diamond]
15
  have_timeout[label="Do I have\ntimeout?", shape=diamond]
16
  top_of_queue_and_can_acquire[
17
    label="On top of queue and\ncan acquire lock?",
18
    shape=diamond,
19
    ]
20

  
21
  /* Lines */
22
  alone->acquire[label="Yes"]
23
  alone->add_to_queue[label="No"]
24

  
25
  have_timeout->abort[label="Yes"]
26
  have_timeout->wait[label="No"]
27

  
28
  top_of_queue_and_can_acquire->acquire[label="Yes"]
29
  top_of_queue_and_can_acquire->have_timeout[label="No"]
30

  
31
  add_to_queue->wait
32
  wait->top_of_queue_and_can_acquire
33
  acquire->remove_from_queue
34
}
/dev/null
1
digraph "design-2.1-lock-release" {
2
  graph[fontsize=8, fontname="Helvetica"]
3
  node[fontsize=8, fontname="Helvetica", width="0", height="0"]
4
  edge[fontsize=8, fontname="Helvetica"]
5

  
6
  /* Actions */
7
  remove_from_owners[label="Remove from owner list"]
8
  notify[label="Notify topmost"]
9
  swap_shared[label="Swap shared conditions"]
10
  success[label="Success"]
11

  
12
  /* Conditions */
13
  have_pending[label="Any pending\nacquires?", shape=diamond]
14
  was_active_queue[
15
    label="Was active condition\nfor shared acquires?",
16
    shape=diamond,
17
    ]
18

  
19
  /* Lines */
20
  remove_from_owners->have_pending
21

  
22
  have_pending->notify[label="Yes"]
23
  have_pending->success[label="No"]
24

  
25
  notify->was_active_queue
26

  
27
  was_active_queue->swap_shared[label="Yes"]
28
  was_active_queue->success[label="No"]
29

  
30
  swap_shared->success
31
}
b/doc/design-2.1.rst
229 229
acquires and no current holders. The caller can have the lock
230 230
immediately.
231 231

  
232
.. graphviz:: design-2.1-lock-acquire.dot
232
.. digraph:: "design-2.1-lock-acquire"
233 233

  
234
  graph[fontsize=8, fontname="Helvetica"]
235
  node[fontsize=8, fontname="Helvetica", width="0", height="0"]
236
  edge[fontsize=8, fontname="Helvetica"]
237

  
238
  /* Actions */
239
  abort[label="Abort\n(couldn't acquire)"]
240
  acquire[label="Acquire lock"]
241
  add_to_queue[label="Add condition to queue"]
242
  wait[label="Wait for notification"]
243
  remove_from_queue[label="Remove from queue"]
244

  
245
  /* Conditions */
246
  alone[label="Empty queue\nand can acquire?", shape=diamond]
247
  have_timeout[label="Do I have\ntimeout?", shape=diamond]
248
  top_of_queue_and_can_acquire[
249
    label="On top of queue and\ncan acquire lock?",
250
    shape=diamond,
251
    ]
252

  
253
  /* Lines */
254
  alone->acquire[label="Yes"]
255
  alone->add_to_queue[label="No"]
256

  
257
  have_timeout->abort[label="Yes"]
258
  have_timeout->wait[label="No"]
259

  
260
  top_of_queue_and_can_acquire->acquire[label="Yes"]
261
  top_of_queue_and_can_acquire->have_timeout[label="No"]
262

  
263
  add_to_queue->wait
264
  wait->top_of_queue_and_can_acquire
265
  acquire->remove_from_queue
234 266

  
235 267
Release
236 268
*******
......
244 276
exclusive locks by forcing consecutive shared acquires to wait in the
245 277
queue.
246 278

  
247
.. graphviz:: design-2.1-lock-release.dot
279
.. digraph:: "design-2.1-lock-release"
280

  
281
  graph[fontsize=8, fontname="Helvetica"]
282
  node[fontsize=8, fontname="Helvetica", width="0", height="0"]
283
  edge[fontsize=8, fontname="Helvetica"]
284

  
285
  /* Actions */
286
  remove_from_owners[label="Remove from owner list"]
287
  notify[label="Notify topmost"]
288
  swap_shared[label="Swap shared conditions"]
289
  success[label="Success"]
290

  
291
  /* Conditions */
292
  have_pending[label="Any pending\nacquires?", shape=diamond]
293
  was_active_queue[
294
    label="Was active condition\nfor shared acquires?",
295
    shape=diamond,
296
    ]
297

  
298
  /* Lines */
299
  remove_from_owners->have_pending
300

  
301
  have_pending->notify[label="Yes"]
302
  have_pending->success[label="No"]
303

  
304
  notify->was_active_queue
305

  
306
  was_active_queue->swap_shared[label="Yes"]
307
  was_active_queue->success[label="No"]
308

  
309
  swap_shared->success
248 310

  
249 311

  
250 312
Delete

Also available in: Unified diff