diff mbox

ReplicatedPG: For async-read, set the real result after completing read.

Message ID 6AA21C22F0A5DA478922644AD2EC308C88781F@SHSMSX101.ccr.corp.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ma, Jianpeng July 10, 2014, 9:23 a.m. UTC
When reading an object from replicated pool, ceph uses sync mode, so it can set the results in execute_ctx correctly. 
However, For the async-read in EC Pool, current code didn't set the real results after read in complete_read_ctx.

Signed-off-by: Ma Jianpeng <jianpeng.ma@intel.com>
---
 src/osd/ReplicatedPG.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Samuel Just July 11, 2014, 5:21 p.m. UTC | #1
Looks about right, file a pull request?
-Sam

On Thu, Jul 10, 2014 at 2:23 AM, Ma, Jianpeng <jianpeng.ma@intel.com> wrote:
> When reading an object from replicated pool, ceph uses sync mode, so it can set the results in execute_ctx correctly.
> However, For the async-read in EC Pool, current code didn't set the real results after read in complete_read_ctx.
>
> Signed-off-by: Ma Jianpeng <jianpeng.ma@intel.com>
> ---
>  src/osd/ReplicatedPG.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
> index cab3fde..ac0e8ad 100644
> --- a/src/osd/ReplicatedPG.cc
> +++ b/src/osd/ReplicatedPG.cc
> @@ -5318,7 +5318,7 @@ void ReplicatedPG::complete_read_ctx(int result, OpContext *ctx)
>      // on ENOENT, set a floor for what the next user version will be.
>      reply->set_enoent_reply_versions(info.last_update, info.last_user_version);
>    }
> -
> +  reply->set_result(result);
>    reply->add_flags(CEPH_OSD_FLAG_ACK | CEPH_OSD_FLAG_ONDISK);
>    osd->send_message_osd_client(reply, m->get_connection());
>    close_op_ctx(ctx, 0);
> --
> 1.9.1
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ma, Jianpeng July 14, 2014, 3:22 a.m. UTC | #2
Hi Sam,
   I'm a newbie and I don’t have my ceph repo in github. So I can't send a full request.

Jianpeng Ma
Thanks!

-----Original Message-----
From: Samuel Just [mailto:sam.just@inktank.com] 

Sent: Saturday, July 12, 2014 1:21 AM
To: Ma, Jianpeng
Cc: ceph-devel@vger.kernel.org
Subject: Re: [PATCH] ReplicatedPG: For async-read, set the real result after completing read.

Looks about right, file a pull request?
-Sam

On Thu, Jul 10, 2014 at 2:23 AM, Ma, Jianpeng <jianpeng.ma@intel.com> wrote:
> When reading an object from replicated pool, ceph uses sync mode, so it can set the results in execute_ctx correctly.

> However, For the async-read in EC Pool, current code didn't set the real results after read in complete_read_ctx.

>

> Signed-off-by: Ma Jianpeng <jianpeng.ma@intel.com>

> ---

>  src/osd/ReplicatedPG.cc | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

>

> diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 

> cab3fde..ac0e8ad 100644

> --- a/src/osd/ReplicatedPG.cc

> +++ b/src/osd/ReplicatedPG.cc

> @@ -5318,7 +5318,7 @@ void ReplicatedPG::complete_read_ctx(int result, OpContext *ctx)

>      // on ENOENT, set a floor for what the next user version will be.

>      reply->set_enoent_reply_versions(info.last_update, info.last_user_version);

>    }

> -

> +  reply->set_result(result);

>    reply->add_flags(CEPH_OSD_FLAG_ACK | CEPH_OSD_FLAG_ONDISK);

>    osd->send_message_osd_client(reply, m->get_connection());

>    close_op_ctx(ctx, 0);

> --

> 1.9.1
diff mbox

Patch

diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index cab3fde..ac0e8ad 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -5318,7 +5318,7 @@  void ReplicatedPG::complete_read_ctx(int result, OpContext *ctx)
     // on ENOENT, set a floor for what the next user version will be.
     reply->set_enoent_reply_versions(info.last_update, info.last_user_version);
   }
-
+  reply->set_result(result);
   reply->add_flags(CEPH_OSD_FLAG_ACK | CEPH_OSD_FLAG_ONDISK);
   osd->send_message_osd_client(reply, m->get_connection());
   close_op_ctx(ctx, 0);