Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dht[WIP]: Implement seek fop at dht level #3792

Merged
merged 2 commits into from
Sep 13, 2022

Conversation

mohit84
Copy link
Contributor

@mohit84 mohit84 commented Sep 7, 2022

Before kernel minor version (.24) fuse does not
wind a seek fop but after that fuse winds a seek
fop so implement the fop at dht level.

Fixes: #3373
Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
Signed-off-by: Mohit Agrawal moagrawa@redhat.com

@mohit84
Copy link
Contributor Author

mohit84 commented Sep 7, 2022

/run regression

int op_errno = EINVAL;
off_t offset = 0;

if (!frame || !frame->local)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without frame you'll hit

gf_msg("stack", GF_LOG_CRITICAL, 0, LG_MSG_FRAME_ERROR, "!frame"); \

on STACK_UNWIND_STRICT macro.

So I assume this check is not needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even frame->local cannot be NULL. Otherwise we should have returned an error in dht_seek().

@amarts
Copy link
Member

amarts commented Sep 7, 2022

This is tricky! ie, if a new fop is added to list, shouldn't we be handling it in all the places its required? ie, even in other cluster/ xlators at least?

Do we have this covered in all other places?

@mohit84
Copy link
Contributor Author

mohit84 commented Sep 7, 2022

This is tricky! ie, if a new fop is added to list, shouldn't we be handling it in all the places its required? ie, even in other cluster/ xlators at least?

Do we have this covered in all other places?

The other xlators (afr/client/server/posix) already have seek fop.

Copy link
Contributor

@xhernandez xhernandez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, also add a test case to check that seeks go to the right subvolume and without this patch fail.

return 0;

err:
op_errno = (op_errno == -1) ? errno : op_errno;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to not depend anymore on errno if it's not strictly necessary because it can be easily misused. In this particular case, the macro VALIDATE_OR_GOTO() sets errno before logging a message, which could change errno value or clear it making it completely useless.

Why not just initialize op_errno = EINVAL at line 1743 ? it seems easier and cleaner to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is not needed anymore.

int op_errno = EINVAL;
off_t offset = 0;

if (!frame || !frame->local)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even frame->local cannot be NULL. Otherwise we should have returned an error in dht_seek().

Comment on lines 1685 to 1686
DHT_STACK_UNWIND(seek, frame, -1, local->op_errno, offset,
local->rebalance.xdata);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an error, so offset is irrelevant. We normally pass 0 in this case. Also, local->rebalance.xdata doesn't seem to be initialized anywhere. In any case it should be NULL, not the xdata from the request.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

goto out;
}

if (!op_ret || (local->call_cnt != 1))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some error codes that seek can return (for example ENXIO) that I don't think could be related to rebalance. Shouldn't we filter them to avoid the overhead of a synctask and additional fops when it's not really necessary ?

Even better, if we know which error a rebalance can cause, then we could call dht_rebalance_complete_check() just in that case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@mohit84
Copy link
Contributor Author

mohit84 commented Sep 7, 2022

Please, also add a test case to check that seeks go to the right subvolume and without this patch fail.

To create a test case I have to setup an environment where the kernel minor version is >= 24. The test case will not be
useful for the current test server because the minor version is less than 24.

@mohit84
Copy link
Contributor Author

mohit84 commented Sep 9, 2022

/run regression

@xhernandez
Copy link
Contributor

Please, also add a test case to check that seeks go to the right subvolume and without this patch fail.

To create a test case I have to setup an environment where the kernel minor version is >= 24. The test case will not be useful for the current test server because the minor version is less than 24.

I would write the test anyway, and make sure it works with the proper kernel version. Eventually the test servers will be updated and this test will be useful. Meanwhile it will just pass, which is fine.

@mohit84
Copy link
Contributor Author

mohit84 commented Sep 9, 2022

Please, also add a test case to check that seeks go to the right subvolume and without this patch fail.

To create a test case I have to setup an environment where the kernel minor version is >= 24. The test case will not be useful for the current test server because the minor version is less than 24.

I would write the test anyway, and make sure it works with the proper kernel version. Eventually the test servers will be updated and this test will be useful. Meanwhile it will just pass, which is fine.

I have already attached a test case and the test case is tested on fedora 37.


for i in {1..20}; do
TEST dd if=/dev/urandom of=${M0}/file.${i} bs=1k count=1
TEST dd if=/dev/urandom of=${M0}/file.${i} bs=1k count=1 seek=128
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless you add conv=notrunc the file will be overwritten, so the previous dd will be lost.

. $(dirname $0)/../../volume.rc
. $(dirname $0)/../../dht.rc

SCRIPT_TIMEOUT=300
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this test really require more than 200 seconds (the default value) to complete ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

return 0;

err:
op_errno = (op_errno == -1) ? errno : op_errno;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is not needed anymore.

Comment on lines 1756 to 1757
if (!frame || !this || !fd)
goto err;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need to check that ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

goto out;
}

if ((op_errno == ENXIO) || (op_errno == EOVERFLOW))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can only be tested if op_ret is -1.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Before kernel minor version (.24) fuse does not
wind a seek fop but after that fuse winds a seek
fop so implement the fop at dht level.

Fixes: gluster#3373
Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
Fixes: gluster#3373
Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
@mohit84
Copy link
Contributor Author

mohit84 commented Sep 9, 2022

/run regression

2 similar comments
@mohit84
Copy link
Contributor Author

mohit84 commented Sep 9, 2022

/run regression

@mohit84
Copy link
Contributor Author

mohit84 commented Sep 9, 2022

/run regression

@mohit84
Copy link
Contributor Author

mohit84 commented Sep 13, 2022

/run smoke

@mohit84
Copy link
Contributor Author

mohit84 commented Sep 13, 2022

/recheck smoke

@mohit84 mohit84 merged commit ab255a8 into gluster:devel Sep 13, 2022
mohit84 added a commit to mohit84/glusterfs that referenced this pull request Sep 13, 2022
Before kernel minor version (.24) fuse does not
wind a seek fop but after that fuse winds a seek
fop so implement the fop at dht level.

> Fixes: gluster#3373
> Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
> Signed-off-by: Mohit Agrawal moagrawa@redhat.com
> (Reviewed on upstream link gluster#3792)

Fixes: gluster#3373
Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
Signed-off-by: Mohit Agrawal moagrawa@redhat.com
mohit84 added a commit to mohit84/glusterfs that referenced this pull request Sep 13, 2022
Before kernel minor version (.24) fuse does not
wind a seek fop but after that fuse winds a seek
fop so implement the fop at dht level.

> Fixes: gluster#3373
> Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
> Signed-off-by: Mohit Agrawal moagrawa@redhat.com
> (Reviewed on upstream link gluster#3792)

Fixes: gluster#3373
Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
Signed-off-by: Mohit Agrawal moagrawa@redhat.com
mohit84 added a commit to mohit84/glusterfs that referenced this pull request Sep 14, 2022
Before kernel minor version (.24) fuse does not
wind a seek fop but after that fuse winds a seek
fop so implement the fop at dht level.

> Fixes: gluster#3373
> Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
> Signed-off-by: Mohit Agrawal moagrawa@redhat.com
> (Reviewed on upstream link gluster#3792)

Fixes: gluster#3373
Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
Signed-off-by: Mohit Agrawal moagrawa@redhat.com
mohit84 added a commit to mohit84/glusterfs that referenced this pull request Sep 14, 2022
Before kernel minor version (.24) fuse does not
wind a seek fop but after that fuse winds a seek
fop so implement the fop at dht level.

> Fixes: gluster#3373
> Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
> Signed-off-by: Mohit Agrawal moagrawa@redhat.com
> (Reviewed on upstream link gluster#3792)

Fixes: gluster#3373
Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
Signed-off-by: Mohit Agrawal moagrawa@redhat.com
mohit84 added a commit to mohit84/glusterfs that referenced this pull request Sep 14, 2022
Before kernel minor version (.24) fuse does not
wind a seek fop but after that fuse winds a seek
fop so implement the fop at dht level.

> Fixes: gluster#3373
> Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
> Signed-off-by: Mohit Agrawal moagrawa@redhat.com
> (Reviewed on upstream link gluster#3792)

Fixes: gluster#3373
Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
Signed-off-by: Mohit Agrawal moagrawa@redhat.com
mohit84 added a commit to mohit84/glusterfs that referenced this pull request Sep 15, 2022
Before kernel minor version (.24) fuse does not
wind a seek fop but after that fuse winds a seek
fop so implement the fop at dht level.

> Fixes: gluster#3373
> Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
> Signed-off-by: Mohit Agrawal moagrawa@redhat.com
> (Reviewed on upstream link gluster#3792)

Fixes: gluster#3373
Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
Signed-off-by: Mohit Agrawal moagrawa@redhat.com
mohit84 added a commit to mohit84/glusterfs that referenced this pull request Sep 15, 2022
Before kernel minor version (.24) fuse does not
wind a seek fop but after that fuse winds a seek
fop so implement the fop at dht level.

> Fixes: gluster#3373
> Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
> Signed-off-by: Mohit Agrawal moagrawa@redhat.com
> (Reviewed on upstream link gluster#3792)

Fixes: gluster#3373
Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
Signed-off-by: Mohit Agrawal moagrawa@redhat.com
mohit84 added a commit to mohit84/glusterfs that referenced this pull request Sep 15, 2022
Before kernel minor version (.24) fuse does not
wind a seek fop but after that fuse winds a seek
fop so implement the fop at dht level.

> Fixes: gluster#3373
> Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
> Signed-off-by: Mohit Agrawal moagrawa@redhat.com
> (Reviewed on upstream link gluster#3792)

Fixes: gluster#3373
Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
Signed-off-by: Mohit Agrawal moagrawa@redhat.com
Shwetha-Acharya pushed a commit that referenced this pull request Sep 16, 2022
Before kernel minor version (.24) fuse does not
wind a seek fop but after that fuse winds a seek
fop so implement the fop at dht level.

> Fixes: #3373
> Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
> Signed-off-by: Mohit Agrawal moagrawa@redhat.com
> (Reviewed on upstream link #3792)

Fixes: #3373
Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
Signed-off-by: Mohit Agrawal moagrawa@redhat.com

Signed-off-by: Mohit Agrawal moagrawa@redhat.com
Shwetha-Acharya pushed a commit that referenced this pull request Sep 16, 2022
Before kernel minor version (.24) fuse does not
wind a seek fop but after that fuse winds a seek
fop so implement the fop at dht level.

> Fixes: #3373
> Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
> Signed-off-by: Mohit Agrawal moagrawa@redhat.com
> (Reviewed on upstream link #3792)

Fixes: #3373
Change-Id: Ie9ef2f941099157996ab353fc4dc208a28fa8fc6
Signed-off-by: Mohit Agrawal moagrawa@redhat.com

Signed-off-by: Mohit Agrawal moagrawa@redhat.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DHT doesn't implement seek fop and causes failures
4 participants