Re: [PATCH 05/39] mds: send table request when peer is in proper state.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This and patch 6 are probably going to get dealt with as part of our conversation on patch 4 and restart of the TableServers. 

Software Engineer #42 @ http://inktank.com | http://ceph.com


On Sunday, March 17, 2013 at 7:51 AM, Yan, Zheng wrote:

> From: "Yan, Zheng" <zheng.z.yan@xxxxxxxxx (mailto:zheng.z.yan@xxxxxxxxx)>
> 
> Table client/server should send request/reply when the peer is active.
> Anchor query is an exception, because MDS in rejoin stage may need
> fetch files before sending rejoin ack, the anchor server can also be
> in rejoin stage.
> 
> Signed-off-by: Yan, Zheng <zheng.z.yan@xxxxxxxxx (mailto:zheng.z.yan@xxxxxxxxx)>
> ---
> src/mds/AnchorClient.cc (http://AnchorClient.cc) | 5 ++++-
> src/mds/MDSTableClient.cc (http://MDSTableClient.cc) | 9 ++++++---
> src/mds/MDSTableServer.cc (http://MDSTableServer.cc) | 3 ++-
> 3 files changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/src/mds/AnchorClient.cc (http://AnchorClient.cc) b/src/mds/AnchorClient.cc (http://AnchorClient.cc)
> index 455e97f..d7da9d1 100644
> --- a/src/mds/AnchorClient.cc (http://AnchorClient.cc)
> +++ b/src/mds/AnchorClient.cc (http://AnchorClient.cc)
> @@ -80,9 +80,12 @@ void AnchorClient::lookup(inodeno_t ino, vector<Anchor>& trace, Context *onfinis
> 
> void AnchorClient::_lookup(inodeno_t ino)
> {
> + int ts = mds->mdsmap->get_tableserver();
> + if (mds->mdsmap->get_state(ts) < MDSMap::STATE_REJOIN)
> + return;
> MMDSTableRequest *req = new MMDSTableRequest(table, TABLESERVER_OP_QUERY, 0, 0);
> ::encode(ino, req->bl);
> - mds->send_message_mds(req, mds->mdsmap->get_tableserver());
> + mds->send_message_mds(req, ts);
> }
> 
> 
> diff --git a/src/mds/MDSTableClient.cc (http://MDSTableClient.cc) b/src/mds/MDSTableClient.cc (http://MDSTableClient.cc)
> index beba0a3..df0131f 100644
> --- a/src/mds/MDSTableClient.cc (http://MDSTableClient.cc)
> +++ b/src/mds/MDSTableClient.cc (http://MDSTableClient.cc)
> @@ -149,9 +149,10 @@ void MDSTableClient::_prepare(bufferlist& mutation, version_t *ptid, bufferlist
> void MDSTableClient::send_to_tableserver(MMDSTableRequest *req)
> {
> int ts = mds->mdsmap->get_tableserver();
> - if (mds->mdsmap->get_state(ts) >= MDSMap::STATE_CLIENTREPLAY)
> + if (mds->mdsmap->get_state(ts) >= MDSMap::STATE_CLIENTREPLAY) {
> mds->send_message_mds(req, ts);
> - else {
> + } else {
> + req->put();
> dout(10) << " deferring request to not-yet-active tableserver mds." << ts << dendl;
> }
> }
> @@ -193,7 +194,9 @@ void MDSTableClient::got_journaled_ack(version_t tid)
> void MDSTableClient::finish_recovery()
> {
> dout(7) << "finish_recovery" << dendl;
> - resend_commits();
> + int ts = mds->mdsmap->get_tableserver();
> + if (mds->mdsmap->get_state(ts) >= MDSMap::STATE_CLIENTREPLAY)
> + resend_commits();
> }
> 
> void MDSTableClient::resend_commits()
> diff --git a/src/mds/MDSTableServer.cc (http://MDSTableServer.cc) b/src/mds/MDSTableServer.cc (http://MDSTableServer.cc)
> index 4f86ff1..07c7d26 100644
> --- a/src/mds/MDSTableServer.cc (http://MDSTableServer.cc)
> +++ b/src/mds/MDSTableServer.cc (http://MDSTableServer.cc)
> @@ -159,7 +159,8 @@ void MDSTableServer::handle_mds_recovery(int who)
> for (map<version_t,mds_table_pending_t>::iterator p = pending_for_mds.begin();
> p != pending_for_mds.end();
> ++p) {
> - if (who >= 0 && p->second.mds != who)
> + if ((who >= 0 && p->second.mds != who) ||
> + mds->mdsmap->get_state(p->second.mds) < MDSMap::STATE_CLIENTREPLAY)
> continue;
> MMDSTableRequest *reply = new MMDSTableRequest(table, TABLESERVER_OP_AGREE, p->second.reqid, p->second.tid);
> mds->send_message_mds(reply, p->second.mds);
> -- 
> 1.7.11.7



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


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux