Project

General

Profile

Feature #619

objecter: optionally read from replicas

Added by Sage Weil over 13 years ago. Updated about 13 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
% Done:

0%

Source:
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

Add a read flag to allow reads to come from a random replica. If a replica replies with EAGAIN, retry the request, but always on the primary. (This may happen if the replica is missing the object due to a recovery in progress.)


Related issues

Related to Ceph - Feature #618: osd: allow reads from replicas Resolved 11/30/2010
Blocked by Ceph - Cleanup #650: objecter: refactor request tracking to be per-osd instead of per-pg Resolved 12/14/2010

History

#1 Updated by Sage Weil about 13 years ago

  • Assignee set to Colin McCabe

see objecter_balance_reads branch for untested client-side implementation

#2 Updated by Colin McCabe about 13 years ago

  • Status changed from New to Resolved

I ran test_rw.sh with the following patch:

diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h
index 37a23fb..84afa9d 100644
--- a/src/osdc/Objecter.h
++ b/src/osdc/Objecter.h
@ -309,6 +309,7 @ public:
tid(0), attempts(0),
paused(false), objver(ov) {
ops.swap(op);
flags |= CEPH_OSD_FLAG_BALANCE_READS;
}
};

It succeeded when reading from the replicas.

One thing to note. If an object is unfound on the OSD we try to fetch it from, we block until it becomes found on that OSD. We do not ask other OSDs if they already have a copy of that same object. This is probably acceptable because eventually, we will eliminate all unfound items on the different replicas through PG recovery.

#3 Updated by Colin McCabe about 13 years ago

Sigh. Reposting patch for clarity:

 --- a/src/osdc/Objecter.h
 +++ b/src/osdc/Objecter.h
 @@ -309,6 +309,7 @@ public:
        tid(0), attempts(0),
        paused(false), objver(ov) {
        ops.swap(op);
 +      flags |= CEPH_OSD_FLAG_BALANCE_READS;
     }
   };

Also available in: Atom PDF