From 94da4b9ee54a3919e27e542448ba2ca96a9127ed Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Tue, 22 Dec 2015 22:54:36 -0800 Subject: [PATCH] rafthttp: log before receiving snapshot Database snapshot can be as large as 5GB. It is reasonable to log before receiving it. Or the user might not know what is happening and why etcd starts to use IO intensively. --- rafthttp/http.go | 1 + 1 file changed, 1 insertion(+) diff --git a/rafthttp/http.go b/rafthttp/http.go index ec823820f..603a043a7 100644 --- a/rafthttp/http.go +++ b/rafthttp/http.go @@ -169,6 +169,7 @@ func (h *snapshotHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } + plog.Infof("receiving database snapshot [index:%d, from %s] ...", m.Snapshot.Metadata.Index, types.ID(m.From)) // save incoming database snapshot. if err := h.snapshotter.SaveDBFrom(r.Body, m.Snapshot.Metadata.Index); err != nil { msg := fmt.Sprintf("failed to save KV snapshot (%v)", err)