Skip to content

Commit 2a9e6cd

Browse files
authored
Merge pull request #65 from RealFax/dev
[Server::patch] stash
2 parents ce5cc06 + 75c46fc commit 2a9e6cd

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

raft.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func RaftWithBoltLogStore(path string) RaftServerOption {
8585
return func(r *Raft) (err error) {
8686
r.logStore, err = raftboltdb.NewBoltStore(path)
8787
if err != nil {
88-
return errors.Wrap(err, "bolt-log-Store")
88+
return errors.Wrap(err, "bolt-log-store")
8989
}
9090
return
9191
}
@@ -95,7 +95,7 @@ func RaftWithStdStableStore(store store.Store) RaftServerOption {
9595
return func(r *Raft) (err error) {
9696
r.stableStore, err = NewStableStore(store)
9797
if err != nil {
98-
return errors.Wrap(err, "std-stable-Store")
98+
return errors.Wrap(err, "std-stable-store")
9999
}
100100
return
101101
}
@@ -105,7 +105,7 @@ func RaftWithFileSnapshotStore(path string, retain int, logOut io.Writer) RaftSe
105105
return func(r *Raft) (err error) {
106106
r.snapshotStore, err = raft.NewFileSnapshotStore(path, retain, logOut)
107107
if err != nil {
108-
return errors.Wrap(err, "file-snapshot-Store")
108+
return errors.Wrap(err, "file-snapshot-store")
109109
}
110110
return
111111
}

server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func NewServer(cfg *config.Config) (*Server, error) {
123123
go server.pprofServer.Run()
124124
}
125125

126-
// init server Store backend
126+
// init server store backend
127127
if server.store, err = newStoreBackend(cfg.Store, cfg.Node.DataDir); err != nil {
128128
return nil, err
129129
}

v1_server.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"github.com/hashicorp/raft"
88
"google.golang.org/protobuf/types/known/emptypb"
99
"io"
10-
"sync/atomic"
1110
"time"
1211

1312
"google.golang.org/grpc/codes"
@@ -43,7 +42,7 @@ type Internal interface {
4342
func (s *Server) responseHeader() *serverpb.ResponseHeader {
4443
return &serverpb.ResponseHeader{
4544
ClusterId: s.clusterID,
46-
RaftTerm: atomic.LoadUint64(&s.term),
45+
RaftTerm: s.raft.Term(),
4746
}
4847
}
4948

0 commit comments

Comments
 (0)