dht[WIP]: Implement seek fop at dht level - #3792
Conversation
|
/run regression |
| int op_errno = EINVAL; | ||
| off_t offset = 0; | ||
|
|
||
| if (!frame || !frame->local) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Even frame->local cannot be NULL. Otherwise we should have returned an error in dht_seek().
|
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 Do we have this covered in all other places? |
The other xlators (afr/client/server/posix) already have seek fop. |
xhernandez
left a comment
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
This line is not needed anymore.
| int op_errno = EINVAL; | ||
| off_t offset = 0; | ||
|
|
||
| if (!frame || !frame->local) |
There was a problem hiding this comment.
Even frame->local cannot be NULL. Otherwise we should have returned an error in dht_seek().
| DHT_STACK_UNWIND(seek, frame, -1, local->op_errno, offset, | ||
| local->rebalance.xdata); |
There was a problem hiding this comment.
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.
| goto out; | ||
| } | ||
|
|
||
| if (!op_ret || (local->call_cnt != 1)) |
There was a problem hiding this comment.
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.
To create a test case I have to setup an environment where the kernel minor version is >= 24. The test case will not be |
1eeb5a7 to
11bd385
Compare
|
/run regression |
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Does this test really require more than 200 seconds (the default value) to complete ?
| return 0; | ||
|
|
||
| err: | ||
| op_errno = (op_errno == -1) ? errno : op_errno; |
There was a problem hiding this comment.
This line is not needed anymore.
| if (!frame || !this || !fd) | ||
| goto err; |
There was a problem hiding this comment.
Do we really need to check that ?
| goto out; | ||
| } | ||
|
|
||
| if ((op_errno == ENXIO) || (op_errno == EOVERFLOW)) |
There was a problem hiding this comment.
This can only be tested if op_ret is -1.
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>
11bd385 to
d7d85f3
Compare
|
/run regression |
2 similar comments
|
/run regression |
|
/run regression |
|
/run smoke |
|
/recheck smoke |
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
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
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
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
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
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
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
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
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
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
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