[AFS3-std] first draft: ubik update proposal

Derrick Brashear shadow@gmail.com
Fri, 4 Feb 2011 09:32:53 -0500


This is not a complete refresh of all Ubik RPCs. It would allow
capability for IPv6, 64 bit times, multiple files in a database,
beacon returns not precluding errors. Comments welcome, I will refine
further into a draft.

New structures:

struct ubik_nversion {
    afs_int64 epoch;
    afs_int64 counter;
};

struct ubik_ntid {
    afs_int64 epoch;
    afs_int64 counter;
};

struct UbikInterfaceInfo {
        afsUUID uuid;
	struct sockaddr_storage hostAddr[UBIK_MAX_INTERFACE_ADDR];
};

typedef afs_uint32 UbikCapabilities<UBIKCAPABILITIESMAX>;

New RPC in the VOTE package:

package VOTE_
BeaconV2 (IN afs_int32 state,
          afs_int64 voteStartTime,
	  ubik_nversion *Version,
          ubik_ntid *tid,
	  afs_int32 nfiles,
	  OUT afs_int64 vote) multi = XXX;

Notes:
addresses issue where vote is returned, instead of an error, which can
be confusing. vote is a time, as before. a vote of no is a 0 time, as
before. RPC return would be 0 for success, or an error. the number of
files in the database is included.

GetSyncSiteV2 (struct UbikInterfaceInfo *uuid)



New package DISK2, would supercede DISK.

new package DISK2_
Begin           (IN ubik_ntid *tid)

Commit          (IN ubik_ntid *tid)

Lock            (IN ubik_ntid *tid,
                afs_int32 file,
                afs_int64 position,
                afs_int64 length,
                afs_int32 type) = DISK_LOCK;

Write           (IN ubik_ntid *tid,
                afs_int32 file,
                afs_int64 position,
                bulkdata *data) = DISK_WRITE;

GetVersion      (OUT ubik_nversion *Version)

SnapVersion     (OUT ubik_nversion *Version)

GetFile         (IN afs_int32 file,
		IN ubik_nversion *haveVersion,
		OUT ubik_nversion *gotVersion)

GetFileDiff    (IN afs_int32 file,
		ubik_nversion *fromVersion,
                ubik_nversion *toVersion)

SendFile        (IN afs_int32 file,
                afs_int64 length,
                ubik_nversion *Version)

SendFileDiff    (IN afs_int32 file,
                afs_int64 length,
		ubik_nversion *fromVersion,
                ubik_nversion *toVersion)

DropSnap       (IN ubik_nversion *Version)

Abort           (IN ubik_ntid *tid)

ReleaseLocks    (IN ubik_ntid *tid)

Truncate        (IN ubik_ntid *tid,
                afs_int32 file,
                afs_int64 length)

GetCapabilities           (UbikCapabilities *ucapabilities)

UpdateInterfaceAddr(IN  UbikInterfaceInfo* inInfo,
                    OUT UbikInterfaceInfo* outInfo)

Notes:

when using sendfile or getfile, all files need to be gotten (to the
same version) before any are moved into place. snapversion should do a
copy-on-write snapshot of the current files; dropsnap will drop them
when done. the *filediff can use the snapshot plus locks to do an
incremental "finish" after transferring all files, in much the same
way as a volume release is performed.



-- 
Derrick