[sheepdog] [PATCH 0/4] variable vnodes specified by free space
levin li
levin108 at gmail.com
Fri Aug 3 08:09:07 CEST 2012
On 2012年08月03日 13:59, MORITA Kazutaka wrote:
> At Wed, 1 Aug 2012 10:56:12 +0800,
> levin li wrote:
>>
>> From: levin li <xingke.lwp at taobao.com>
>>
>> For sheep's first boot, we get the free disk space either by syscall
>> or by user's determination though command line argement, and then we
>> store the size into config file, and for later boot, we just read the
>> size from config file, the space size can never be changed after first
>> boot.
>>
>> The free space size of every node is notified to every other node though
>> join message, and stored in sd_node, every time a new node joins or an
>> old node leaves, we recalculate the vnodes number for every nodes.
>>
>> levin li (4):
>> sheep: get the free disk space and store it in the config file
>> sheep: add user-defined free disk space size
>> sheep: recalculate the vnodes number when epoch changes
>> sheep: remove command line argument --vnodes
>>
>> include/internal_proto.h | 1 +
>> sheep/group.c | 24 +++++++++++++
>> sheep/sheep.c | 22 +++++++-----
>> sheep/sheep_priv.h | 3 ++
>> sheep/store.c | 86 ++++++++++++++++++++++++++++++++++++++++++++++
>> 5 files changed, 127 insertions(+), 9 deletions(-)
>
> This patchset doesn't pass the following test:
>
> ==
> #!/bin/bash
>
> set -ex
>
> dd if=/dev/zero of=/tmp/0.img seek=$((2 * 1024 ** 3 - 1)) bs=1 count=1
> dd if=/dev/zero of=/tmp/1.img seek=$((4 * 1024 ** 3 - 1)) bs=1 count=1
> dd if=/dev/zero of=/tmp/2.img seek=$((8 * 1024 ** 3 - 1)) bs=1 count=1
>
> for i in 0 1 2; do
> mkfs.xfs /tmp/$i.img
> mkdir /store/$i
> mount -o loop /tmp/$i.img /store/$i
> sheep -d /store/$i/ -z $i -p 700$i
> done
>
> sleep 1
>
> for i in 0 1 2; do
> collie node list -p 700$i
> done
> ==
>
> The expected result is:
>
> + collie/collie node list -p 7000
> M Id Host:Port V-Nodes Zone
> - 0 127.0.0.1:7000 27 0
> - 1 127.0.0.1:7001 54 1
> - 2 127.0.0.1:7002 109 2
> + for i in 0 1 2
> + collie/collie node list -p 7001
> M Id Host:Port V-Nodes Zone
> - 0 127.0.0.1:7000 27 0
> - 1 127.0.0.1:7001 54 1
> - 2 127.0.0.1:7002 109 2
> + for i in 0 1 2
> + collie/collie node list -p 7002
> M Id Host:Port V-Nodes Zone
> - 0 127.0.0.1:7000 27 0
> - 1 127.0.0.1:7001 54 1
> - 2 127.0.0.1:7002 109 2
>
> But I got the following output:
>
> + collie/collie node list -p 7000
> M Id Host:Port V-Nodes Zone
> - 0 127.0.0.1:7000 42 0
> - 1 127.0.0.1:7001 85 1
> + for i in 0 1 2
> + collie/collie node list -p 7001
> M Id Host:Port V-Nodes Zone
> - 0 127.0.0.1:7000 42 0
> - 1 127.0.0.1:7001 85 1
> + for i in 0 1 2
> + collie/collie node list -p 7002
> M Id Host:Port V-Nodes Zone
> - 0 127.0.0.1:7002 64 2
>
>
> Thanks,
>
> Kazutaka
>
I'll dig into this problem
thanks,
levin
More information about the sheepdog
mailing list