RFC: RAIF (Redundant Array of Independant Filesystems)
Hi all: To solve some problems with data backup, I propose a RAIF (analogue to RAID) which stands for 'redundant array of independant filesystems' allowing transparent handling of identical files on two different filesystems. A nice feature would be that 'compressing file systems', 'remote file systems' etc can be neatly reused. Please comment this first draft critically, or improve directly the proposed implementation (which compiles, but is untested): Some features are not yet done (finalize, copy etc). MODULE RAIF ; (** AUTHOR "Patrick Hunziker"; PURPOSE "RAIF=Redundant Array of Independent Filesystems"; **) IMPORT AosFS; TYPE RAID5FS=OBJECT (AosFS.FileSystem); (*similar to RAID5 concept offering redundant data storage*) VAR FSA-,FSB-: AosFS.FileSystem; (*may also be archive-based, remote, etc; this will need decoupling of the slow remote FS in separate process*) incremental*:BOOLEAN; (*adds new file version without deleting old one, which is renamed ('somename.N.Bak'*) PROCEDURE &Init*(FSA,FSB: AosFS.FileSystem; incremental:BOOLEAN); BEGIN SELF.FSA:=FSA; SELF.FSB:=FSB; SELF.incremental:=incremental; END Init; PROCEDURE Old*(name:ARRAY OF CHAR):AosFS.File; (*todo: if file in both file systems, rather choose the newer one ?*) VAR f:AosFS.File; name0,fullname: ARRAY AosFS.PrefixLength+AosFS.NameLength OF CHAR; prefix: ARRAY AosFS.PrefixLength OF CHAR; BEGIN AosFS.SplitName(name,prefix, name0); AosFS.JoinName(FSA.prefix,name0,fullname); f:=AosFS.Old(fullname); IF f=NIL THEN AosFS.JoinName(FSA.prefix,name0,fullname); f:=AosFS.Old(fullname); END; RETURN f END Old; PROCEDURE New*(name:ARRAY OF CHAR):AosFS.File; VAR f:AosFS.File; name0,fullname: ARRAY AosFS.PrefixLength+AosFS.NameLength OF CHAR; prefix: ARRAY AosFS.PrefixLength OF CHAR; BEGIN AosFS.SplitName(name,prefix,name0); AosFS.JoinName(FSA.prefix,name0,fullname); (*default*) f:=AosFS.New(fullname); RETURN f END New; PROCEDURE Delete*(name: ARRAY OF CHAR; res: LONGINT); VAR f:AosFS.File; name0,fullname: ARRAY AosFS.PrefixLength+AosFS.NameLength OF CHAR; prefix: ARRAY AosFS.PrefixLength OF CHAR; resA,resB:LONGINT; BEGIN AosFS.SplitName(name,prefix,name0); AosFS.JoinName(FSA.prefix,name0,fullname); AosFS.Delete(fullname,resA); AosFS.JoinName(FSA.prefix,name0,fullname); AosFS.Delete(fullname,resB); (*ToDo: what is the correct return value (or are 2 return values needed?)*) END Delete; PROCEDURE Register*(f:AosFS.File); VAR name, name1,name2: ARRAY AosFS.PrefixLength+AosFS.NameLength OF CHAR; prefix: ARRAY AosFS.PrefixLength OF CHAR; res:LONGINT; overwrite:BOOLEAN; BEGIN AosFS.Register(f); f.GetName(name); AosFS.SplitName(name, prefix, name1); IF prefix=FSA.prefix THEN AosFS.JoinName(FSB.prefix, name1, name2); ELSIF prefix=FSB.prefix THEN AosFS.JoinName(FSA.prefix, name1, name2); ELSE HALT(100); END; IF incremental THEN overwrite:=FALSE; HALT(101); (*incomplete implementation: ToDo: check for identity, dates; avoid name clashes*) ELSE overwrite:=FALSE END; AosFS.CopyFile(name,name2,overwrite, res); END Register; END RAID5FS; END RAIF. ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
Patrick.Hunziker@unibas.ch wrote:
Hi all: To solve some problems with data backup, I propose a RAIF (analogue to RAID) which stands for 'redundant array of independant filesystems' allowing transparent handling of identical files on two different filesystems. A nice feature would be that 'compressing file systems', 'remote file systems' etc can be neatly reused. Please comment this first draft critically, or improve directly the proposed implementation (which compiles, but is untested): Some features are not yet done (finalize, copy etc).
Excellent idea Patrik! A RAID, or RAIF as you call it, is what Bluebottle needs. You intend RAIF more like a backup FS then a RAID, but it could be an important step too. Some criticism: 1. The copy solution: Coping the file at any Register could be useful for a versioning system, but not for the AosFS. I have a customer database file of 1.3Gb and many others between 10-100 Mb, and they grow every day. The usually new added record is about 200-800 bytes for data records, and more for attached document files. Coping a 1.3Gb file for 800 bytes added will make the FS unusable. I think the solution is not as simple, but you have to go deeper inside the I/O system. 2. Opening the most recent file of the two FS: I should like to define witch FS is the main and with is the backup. All reading operations must be done from the main FS, otherwise we enter RAID territory and more other tasks must be implemented. If a file in the main FS is older then the backup one, an administrative error message must be triggered and an optional recovery/synchronization task could be started. 3. Incremental backup: Could have sense in a daily backup procedure, but not at FS level (same reason as for point 1). Conclusion: RAIF could be a very important first step to a real Bluebottle RAID implementation. If ETH intends to embrace such a solution, to define and coordinates it, but has no human resources for implementation, I am interested to participate to an open project. Best regards, Dan Parnete
participants (2)
-
Dan Parnete -
Patrick.Hunziker@unibas.ch