[Sheepdog] free space handling issues

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Jan 5 13:03:25 CET 2010


On 2010/01/03 16:40, Piavlo wrote:
> 1) First as you can see below the "Use%" field is not calculated correctly
> 
> fire-srv4 ~ # shepherd info -t sheep
> Id      Size    Used    Use%
>  0      5G      9G      181%
>  1      2G      12G     643%
>  2      8G      6G       83%
> fire-srv4 ~ #
> 
>  I think it is obvious from the output exactly how wrong the "Use%" gets
> calculated :)

Oops, the total size seems to be wrongly caluculated.
The folowing patch will fix the problem.

diff --git a/collie/store.c b/collie/store.c
index fce71ff..582b724 100644
--- a/collie/store.c
+++ b/collie/store.c
@@ -60,8 +60,8 @@ static int stat_sheep(uint64_t *store_size, uint64_t *store_free)
 		used += s.st_size;
 	}

-	*store_size = vs.f_frsize * vs.f_bfree;
-	*store_free = vs.f_frsize * vs.f_bfree - used;
+	*store_size = vs.f_frsize * vs.f_bfree + used;
+	*store_free = vs.f_frsize * vs.f_bfree;

 	return SD_RES_SUCCESS;
 }

> 2) I've created a 15G btrfs on 3 nodes and --copies=2 for the test and
> wanted to fully fill just one of the nodes  and see  how sheepdog 
> behaves then.
> I hoped that once one of the nodes gets out of space it would continue
> to allocate blocks on the other 2 remaining nodes, but it just
> got stuck with "aio_read_response 869: I/O error"

Thanks for log messages.
Sheepdog lacks a lot of error handling, and ENOSPC is also one of them.
I really think we should improve this soon.

> Also sheepdog show that  zopa4 vdi is in running state  in spite of that
> i've terminated the kvm-img process:
> fire-srv4 ~ # shepherd info -t vm
> Name            |Vdi size |Allocated| Shared  | Status
> ----------------+---------+---------+---------+------------
> zopa            |  5120 MB|  4068 MB|     0 MB| not running
> zopa2           |  5120 MB|  4068 MB|     0 MB| not running
> zopa3           |  5120 MB|  4068 MB|     0 MB| not running
> zopa4           |  5120 MB|  2848 MB|     0 MB| running on 192.1.1.4

You can mannually release the image from shepherd.
  $ shepherd debug -o release_vdi zopa4
But, of cource we should check whether client is alive or not.

Thanks,

Kazutaka Morita



More information about the sheepdog mailing list