Feature #619
closed
objecter: optionally read from replicas
Added by Sage Weil over 13 years ago.
Updated over 13 years ago.
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.)
- Assignee set to Colin McCabe
see objecter_balance_reads branch for untested client-side implementation
- 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.
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