Skip to content

Commit

Permalink
Merge pull request #65 from RealFax/dev
Browse files Browse the repository at this point in the history
[Server::patch] stash
  • Loading branch information
PotatoCloud authored Jan 3, 2024
2 parents ce5cc06 + 75c46fc commit 2a9e6cd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func RaftWithBoltLogStore(path string) RaftServerOption {
return func(r *Raft) (err error) {
r.logStore, err = raftboltdb.NewBoltStore(path)
if err != nil {
return errors.Wrap(err, "bolt-log-Store")
return errors.Wrap(err, "bolt-log-store")
}
return
}
Expand All @@ -95,7 +95,7 @@ func RaftWithStdStableStore(store store.Store) RaftServerOption {
return func(r *Raft) (err error) {
r.stableStore, err = NewStableStore(store)
if err != nil {
return errors.Wrap(err, "std-stable-Store")
return errors.Wrap(err, "std-stable-store")
}
return
}
Expand All @@ -105,7 +105,7 @@ func RaftWithFileSnapshotStore(path string, retain int, logOut io.Writer) RaftSe
return func(r *Raft) (err error) {
r.snapshotStore, err = raft.NewFileSnapshotStore(path, retain, logOut)
if err != nil {
return errors.Wrap(err, "file-snapshot-Store")
return errors.Wrap(err, "file-snapshot-store")
}
return
}
Expand Down
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func NewServer(cfg *config.Config) (*Server, error) {
go server.pprofServer.Run()
}

// init server Store backend
// init server store backend
if server.store, err = newStoreBackend(cfg.Store, cfg.Node.DataDir); err != nil {
return nil, err
}
Expand Down
3 changes: 1 addition & 2 deletions v1_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/hashicorp/raft"
"google.golang.org/protobuf/types/known/emptypb"
"io"
"sync/atomic"
"time"

"google.golang.org/grpc/codes"
Expand Down Expand Up @@ -43,7 +42,7 @@ type Internal interface {
func (s *Server) responseHeader() *serverpb.ResponseHeader {
return &serverpb.ResponseHeader{
ClusterId: s.clusterID,
RaftTerm: atomic.LoadUint64(&s.term),
RaftTerm: s.raft.Term(),
}
}

Expand Down

0 comments on commit 2a9e6cd

Please sign in to comment.