1 @c Copyright (c) 2002 Kungliga Tekniska Högskolan
2 @c (Royal Institute of Technology, Stockholm, Sweden).
3 @c All rights reserved.
7 @cindex Disconected operation
9 @chapter Disco with arla
11 Disconnected operation of arla.
15 The binary log is written to a file. All entries are of variable size.
16 A entry is never removed from the log @pxref{Log entry optimization}.
18 @subsection One log entry
20 One log entry consists of a log header with magic cookie, opcode,
21 checksum, and length. The entry is is always 4 byte aligned in the
22 logfile. The checksum is a simple one, its just to verify that for
23 data corruption hasn't occured and to make sure the entry is a valid
26 @subsection Disconnected vs connected nodes
28 A FCacheNode is either a @dfn{disconnected node} or a @dfn{connected
29 node}. The later means that the node was created when arla was in
30 connected mode and thus (potentially) exist on the file server.
32 A disconnected node on the other hand was created when is disconnected
33 operation. A disconnected node always have one or more entries in the
36 @subsection Log entry offset
38 The offset of the entry, a unsigned 32 bit number, is called
39 @dfn{disco_id}. Its stored in the FCacheNode so it can be updated when
40 there is a operation on this node. All nodes for a FCacheEntry are
41 single linked list (from the newest log entry to the oldest), the
42 optimizer uses this to modify all previous entries from a FCacheNode.
44 A FCacheNode with disco_id equal to 0 is a connected node that there
45 have been no disconnected operation made on.
47 The first entry in the log is a nop entry to make sure not a
48 log-offset that is for a ``real'' entry.
50 The limit of number of entries in the log are 2^32 / the size of the
51 largest entry since the offset is a 32 bit number.
53 @c @subsection Dump log / Backup of log
55 @c It should be possible to extract a dump of the current state of
56 @c disconnected operation (all adding operations that is). This is to
57 @c make a backup of all changes before reitegration.
59 @section Log entry optimization
60 @anchor{Log entry optimization}
62 To try to preserve bandwith when reinterating there are dependencies
63 between entries. First we try to avoid storing data to the fileserver
64 that was never meant to got there. For example a file that was created
65 and then removed in disconnected mode, ie @code{DISCO_HEADER_NOP} is
66 set in the flags field in the header.
68 @subsection Removal operations
70 When a node is removed and the node is a disconnected node, the all
71 previous entries are optizmied away by setting a flags in their entry
72 headers. This make this entry/nodes be ignored by the reintergration
73 code and never commited to the fileserver.
75 @subsection Moveing a disconnected node
77 If a disconnected node is moved, it will be created in the target
78 directory instead of first being created and then moved.
80 @subsection Storestatus and storedata
82 Also, all entries for one node storestate/storestatus are compressed
83 to one createnode (and if needed storedata).
87 @subsection common data types
89 fid - VenusFid equivalent
90 storestatus - AFSStoreStatus equivalent
97 needs to be smaller or equal in size then the rest
107 (truncation is a storedata)
142 targetname[AFSNAMEMAX]
185 @section reintegration
187 @subsection Cook-book
193 make sure first entry in the log is a nop entry
197 if nop entry or @code{DISCO_HEADER_NOP} is set, continue to next
201 the parent fid is transformed to a connected fid (if needed)
202 it this failes, we are unhappy and save this node for collision
207 the fid is transformed to a connected fid (if needed)
208 it this failes, we are unhappy and save this node for collision
213 operation is performed
217 if there is change on a fid
231 update directory fid for this name (if needed)
235 transformed fids are stored in the transformation table