[sheepdog] [PATCH 2/3] sheep: allow operating when nr_zones >= nr_data_strip
Liu Yuan
namei.unix at gmail.com
Sat Oct 26 13:44:02 CEST 2013
On Sat, Oct 26, 2013 at 03:25:28AM +0900, MORITA Kazutaka wrote:
> At Wed, 23 Oct 2013 15:59:12 +0800,
> Liu Yuan wrote:
> >
> > For erasure coding with x:y scheme, we can still promise the data reliability
> > with x nodes alive and provide services. There is no reason we don't do it in
> > sheepdog.
> >
> > Signed-off-by: Liu Yuan <namei.unix at gmail.com>
> > ---
> > sheep/plain_store.c | 13 -------------
> > sheep/recovery.c | 19 ++++++-------------
> > 2 files changed, 6 insertions(+), 26 deletions(-)
> >
> > diff --git a/sheep/plain_store.c b/sheep/plain_store.c
> > index fde7c9f..02db25e 100644
> > --- a/sheep/plain_store.c
> > +++ b/sheep/plain_store.c
> > @@ -463,19 +463,6 @@ static bool oid_stale(uint64_t oid)
> > const struct sd_vnode *obj_vnodes[SD_MAX_COPIES];
> > vinfo = get_vnode_info();
> >
> > - /*
> > - * If vinfo->nr_zones < SD_EC_DP, we might not get the idx, so we don't
> > - * know it is stale or not. In this case, we keep it stay in the working
> > - * directory in order to recover it when we get enough zones
> > - */
> > - if (is_erasure_oid(oid)) {
> > - uint8_t policy = get_vdi_copy_policy(oid_to_vid(oid));
> > - int edp = ec_policy_to_dp(policy, NULL, NULL);
> > -
> > - if (unlikely(vinfo->nr_zones < edp))
> > - return false;
> > - }
> > -
> > nr_copies = get_obj_copy_number(oid, vinfo->nr_zones);
> > oid_to_vnodes(oid, &vinfo->vroot, nr_copies, obj_vnodes);
> > for (i = 0; i < nr_copies; i++) {
> > diff --git a/sheep/recovery.c b/sheep/recovery.c
> > index 39ca2b1..3c59756 100644
> > --- a/sheep/recovery.c
> > +++ b/sheep/recovery.c
> > @@ -431,17 +431,15 @@ out:
> > return lost;
> > }
> >
> > -static uint8_t local_node_copy_index(struct rb_root *vroot, uint64_t oid)
> > +static uint8_t local_node_copy_index(struct vnode_info *vinfo, uint64_t oid)
>
> I think we can make vinfo a constant variable.
This is just a simple helper function and if make vinfo as const, need some
manual convensions. So I'll keep it as non-const.
Thanks
Yuan
More information about the sheepdog
mailing list