Browse Source

etcdserver: fix TODO and change to base 16

Jonathan Boulle 11 years ago
parent
commit
fedb67a71a
3 changed files with 5 additions and 5 deletions
  1. 1 1
      etcdserver/cluster_store.go
  2. 2 2
      etcdserver/etcdhttp/http.go
  3. 2 2
      etcdserver/server.go

+ 1 - 1
etcdserver/cluster_store.go

@@ -148,7 +148,7 @@ func send(c *http.Client, cls ClusterStore, m raftpb.Message, ss *stats.ServerSt
 		if m.Type == raftpb.MsgApp {
 			ss.SendAppendReq(len(data))
 		}
-		to := strconv.FormatUint(m.To, 10)
+		to := strconv.FormatUint(m.To, 16)
 		fs, ok := ls.Followers[to]
 		if !ok {
 			fs = &stats.FollowerStats{}

+ 2 - 2
etcdserver/etcdhttp/http.go

@@ -225,8 +225,8 @@ func (h serverHandler) serveRaft(w http.ResponseWriter, r *http.Request) {
 	}
 	log.Printf("etcdhttp: raft recv message from %#x: %+v", m.From, m)
 	if m.Type == raftpb.MsgApp {
-		// TODO(jonboulle):
-		h.stats.ServerStats().RecvAppendReq(strconv.FormatUint(m.From, 10), int(r.ContentLength))
+		// TODO(jonboulle): standardize id uint-->string process: always base 16?
+		h.stats.ServerStats().RecvAppendReq(strconv.FormatUint(m.From, 16), int(r.ContentLength))
 	}
 	if err := h.server.Process(context.TODO(), m); err != nil {
 		log.Println("etcdhttp: error processing raft message:", err)

+ 2 - 2
etcdserver/server.go

@@ -190,9 +190,9 @@ func NewServer(cfg *ServerConfig) *EtcdServer {
 
 	sstats := &stats.ServerStats{
 		Name: cfg.Name,
-		ID:   strconv.FormatUint(cfg.ID(), 10),
+		ID:   strconv.FormatUint(cfg.ID(), 16),
 	}
-	lstats := stats.NewLeaderStats(strconv.FormatUint(cfg.ID(), 10))
+	lstats := stats.NewLeaderStats(strconv.FormatUint(cfg.ID(), 16))
 
 	s := &EtcdServer{
 		store:      st,