File: PROTOCOL

package info (click to toggle)
clsync 0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 724 kB
  • ctags: 998
  • sloc: ansic: 7,463; sh: 227; makefile: 72; xml: 22
file content (53 lines) | stat: -rw-r--r-- 1,843 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Unfortunetaly, on L2 all messages are sending to all members of the cluster.

unicast:	dst_node_id == node_id
broadcast:	dst_node_id == NOID

session example of two nodes (A and B):

A appears (getting node_id):

A -> getmyid	(serial: 0;	src: NOID	; dst: NOID;	name: A)		| cluster_init()
A -> register	(serial: 1;	src: 0		; dst: NOID;	name: A)		|

Trying to sync with somebody:

A -> updtree	(serial: 2;	src: 0		; dst: NOID;	[A modtree])

B appears (getting node_id):

B -> getmyid	(serial: 0;	src: NOID	; dst: NOID;	name: B)		| cluster_init()
A -> setid	(serial: 3;	src: 0		; dst: NOID;	name: A; updatets: 100)	
B -> register	(serial: 1;	src: 1		: dst: NOID;	name: B)		|
A -> ack	(serial: 4;	src: 0		; dst: 1;	ack_serial: 1)

Initial syncing A <-> B:

B -> updtree	(serial: 2;	src: 1		; dst: NOID;	[B modtree])
A -> updtree	(serial: 5;	src: 0		; dst: NOID;	[A modtree])
A -> lock	(serial: 6:	src: 0		; dst: NOID;	[paths list])
B -> ack	(serial: 2;	src: 1		; dst: 0;	ack_serial: 6)
B -> lock	(serial: 3:	src: 1		; dst: NOID;	[paths list])
A -> ack	(serial: 7;	src: 0		; dst: 1;	ack_serial: 3)
A -> unlockall	(serial: 8:	src: 0		; dst: NOID)
B -> ack	(serial: 4;	src: 1		; dst: 0;	ack_serial: 8)
B -> unlockall	(serial: 5:	src: 1		; dst: NOID)
A -> ack	(serial: 9;	src: 0		; dst: 1;	ack_serial: 5)

Just syncing A -> B:

A -> lock	(serial: 10:	src: 0		; dst: NOID;	[paths list])
B -> ack	(serial: 6;	src: 1		; dst: 0;	ack_serial: 10)
A -> unlockall	(serial: 11:	src: 0		; dst: NOID)
B -> ack	(serial: 7;	src: 1		; dst: 0;	ack_serial: 11)

A disappers (shutdown)
A appears (registering with old node_id)

A -> getmyid	(serial: 0;	src: NOID	; dst: NOID;	name: A)
B -> setid	(serial: 4;	src: 1		; dst: 0;	name: A; updatets: 200)
A -> register	(serial: 1;	src: 0		; dst: NOID;	name: A)
B -> ack	(serial: 5;	src: 1		; dst: 0;	ack_serial: 1)

[...]