glusterfs icon indicating copy to clipboard operation
glusterfs copied to clipboard

EC statvfs should return minimum total inodes in the disperse group in statfs output

Open pranithk opened this issue 10 months ago • 2 comments

ec_statvfs_combine(struct statvfs *dst, struct statvfs *src)
{
...

    if (dst->f_files < src->f_files) {
        dst->f_files = src->f_files;
    }
    if (dst->f_ffree > src->f_ffree) {
        dst->f_ffree = src->f_ffree;
    }
    if (dst->f_favail > src->f_favail) {
        dst->f_favail = src->f_favail;
    }
...

In one disperse/ec group, max(available nodes) is taken as total inodes and min(free inodes) is taken as free inodes It makes more sense to do min in both cases as per my understanding. @xhernandez What do you think?

pranithk avatar Feb 10 '25 10:02 pranithk

I think the correct solution is to consider it only for the bricks that are not undergoing heal, but one can create a situation where heals are happening on all the bricks, so in a steady state at least this should be min() for both total and free inodes.

pranithk avatar Feb 10 '25 10:02 pranithk

ec_statvfs_combine(struct statvfs *dst, struct statvfs *src)
{
...

    if (dst->f_files < src->f_files) {
        dst->f_files = src->f_files;
    }
    if (dst->f_ffree > src->f_ffree) {
        dst->f_ffree = src->f_ffree;
    }
    if (dst->f_favail > src->f_favail) {
        dst->f_favail = src->f_favail;
    }
...

In one disperse/ec group, max(available nodes) is taken as total inodes and min(free inodes) is taken as free inodes It makes more sense to do min in both cases as per my understanding. @xhernandez What do you think?

Yes. It seems better.

xhernandez avatar Feb 11 '25 08:02 xhernandez