Re: ECC translator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Wednesday, December 5, 2007, 3:16:16 PM, Csibra Gergo wrote:

> So, I want to make an ECC translator...

Well, the working prototype of this translator is done. You can
download from http://www.csibra.hu/glusterfs/ecc.tar.gz

This code is GPLed, so feel free to put in glusterfs main source.

I've put this under features, so extract the ecc.tar.gz under
xlators/features.

cd ecc/src
make
make install

example config files located under ecc/src/config directory, one for
client (very simple) and one for server.

you can test with this config files if you make 3 directories:

/mnt/gluster1
/mnt/gluster2
/mnt/glusterclient

and start the server:

glusterfsd -f /etc/glusterfs/ecc-server.vol

and the client

glusterfs -f /etc/glusterfs/ecc-client /mnt/glusterclient

Server uses two subvolume, one for files (user files, data files) this
is the first subvolume and one for ecc files, this is the second
subvolume. All of the ecc file named as

.ORIGINALFILE.ecc

for example the if I copy the ecc.c file on ecc subvolume
(/mnt/glusterclient after mount) the file copied in the firs subvolume
(/mnt/gluster1) and another .ecc.c.ecc file will be created in
(/mnt/gluster2).

There are some restrictions:

because it makes 4 ecc bytes for 32 data bytes, this version only
works if the write offset is on 32 bytes bound, and data length is
multiple of 32 bytes.

with 4 ecc bytes this can correct 2-4 bit error in every 32 bytes
block (this is the same error correction as used in CD-s (there's 2048
data bytes and 256 ecc bytes for each block).

My first idea was to write the ecc datas to the same subvolume as the
data files, but I have some problems:

I can not create an other FD for writing in ecc file. I knew the ino
number, and I try to do this in ecc_create_cbk when callbacked after
the ecc file creation on subvolume:

inode_t *eccinode = update_inode(inode->table, inode, "eccinode", eccstbuf);
fd_t = fd_create(eccinode);

but I always get an error, "FD in invalid format" (or same, was in
hungarian :)).

Any idea?

My other question:
if somebody wants to write other than 32 bytes offset (for example
offset 48) I need to read the data from the 32 bytes block begining
(eg. from offset 32) and if I have the first 16 bytes, I can calculate
the ecc bytes. I think I need to do this in every writev calls. But
how can I do this? Must I call readv first, and calculate the ecc
bytes in readv callbacks (I think this is an other readv not the main
readv ofcourse). But what if the user opens the file in write only
(append) mode? I can't read from an write only FD...

So. If you think this translator is useful, try, test it, give
opinions, ask for features or something ;)

And Merry Christmas (it's a little late) and a Happy new year!

-- 
Best regards,
 Csibra Gergo                            mailto:gergo@xxxxxxxxx





[Index of Archives]     [Gluster Users]     [Ceph Users]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux