From 2942a8044ddc4dd40d7fe9ce0d481d4d3bea2d9b Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Wed, 11 Apr 2018 13:14:41 -0700 Subject: [PATCH] functional/agent: add "handle_FETCH_SNAPSHOT" Signed-off-by: Gyuho Lee --- functional/agent/handler.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/functional/agent/handler.go b/functional/agent/handler.go index e8eb4af70..c38faa3b7 100644 --- a/functional/agent/handler.go +++ b/functional/agent/handler.go @@ -57,6 +57,9 @@ func (srv *Server) handleTesterRequest(req *rpcpb.Request) (resp *rpcpb.Response case rpcpb.Operation_SIGQUIT_ETCD_AND_REMOVE_DATA: return srv.handle_SIGQUIT_ETCD_AND_REMOVE_DATA() + case rpcpb.Operation_FETCH_SNAPSHOT: + return srv.handle_FETCH_SNAPSHOT() + case rpcpb.Operation_SIGQUIT_ETCD_AND_ARCHIVE_DATA: return srv.handle_SIGQUIT_ETCD_AND_ARCHIVE_DATA() case rpcpb.Operation_SIGQUIT_ETCD_AND_REMOVE_DATA_AND_STOP_AGENT: @@ -502,6 +505,17 @@ func (srv *Server) handle_SIGQUIT_ETCD_AND_REMOVE_DATA() (*rpcpb.Response, error }, nil } +func (srv *Server) handle_FETCH_SNAPSHOT() (*rpcpb.Response, error) { + err := srv.Member.FetchSnapshot(srv.lg) + if err != nil { + return nil, err + } + return &rpcpb.Response{ + Success: true, + Status: "downloaded snapshot", + }, nil +} + func (srv *Server) handle_SIGQUIT_ETCD_AND_ARCHIVE_DATA() (*rpcpb.Response, error) { srv.stopProxy()