Re: Questions about healing

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

 



Well it's not magic, there is an algorithm that is documented and it is trivial script the recreation of the file from the shards if gluster was truly unavailable:

#!/bin/bash
#
# quick and dirty reconstruct file from shards
# takes brick path and file name as arguments
# Copyright May 20th 2016 A. Neil
#
brick=$1
filen=$2
file=`find $brick -name $filen`
inode=`ls -i $file | cut -d' ' -f1`
pushd $brick/.glusterfs
gfid=`find . -inum $inode | cut -d'/' -f4`
popd
nshard=`ls -1  $brick/.shard/${gfid}.* | wc -l`
cp $file ./${filen}.restored
for i in `seq 1 $nshard`; do cat $brick/.shard/${gfid}.$i >> ./${filen}.restored; done

 Admittedly this is not as easy as pulling the image for from the brick file system, but then the advantages are pretty big.

The point is that each shard is small and healing of them is fast.  The majority of the time when you need to heal a vm it's is only a few blocks that have changed and without sharding you might have to heal 10 , 20 or 100GB.  In my experience if you have 30 or 40 VMs it can take hours to heal.  With the limited testing I have done I have found  that yes some VMs will experience IO timeouts, freeze, and then need to be restarted.  However, at least you don't need to wait hours before you can do that.  






On 20 May 2016 at 15:20, Gandalf Corvotempesta <gandalf.corvotempesta@xxxxxxxxx> wrote:

Il 20 mag 2016 20:14, "Alastair Neil" <ajneil.tech@xxxxxxxxx> ha scritto:
>
> I think you are confused about what sharding does.   In a sharded replica 3 volume all the shards exist on all the replicas so there is no distribution.  Might you be getting confused with erasure coding?  The upshot of sharding is that if you have a failure, instead of healing multiple gigabyte vm files for example, you only heal the shards that have changed. This generally shortens the heal time dramatically.

I know what sharding is.
it split each file in multiple, smaller,  chunks

But if all is gonna bad, how can i reconstruct a file from each shard without gluster? It would be a pain.
Let's assume tens of terabytes of shards to be manually reconstructed ...

Anyway how is possible to keep VM up and running when healing is happening on a shard? That part of disk image is not accessible and thus the VM could have some issue on a filesystem.


_______________________________________________
Gluster-users mailing list
Gluster-users@xxxxxxxxxxx
http://www.gluster.org/mailman/listinfo/gluster-users

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

  Powered by Linux