Skip to content

Commit

Permalink
Merge branch 'lni:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerwilliams authored Feb 24, 2022
2 parents b0a5970 + 44ce200 commit 240ba62
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 17 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@ jobs:
run: |
make actions-test
bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN
arm64-unit-test:
runs-on: self-hosted
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
- name: Checkout code
uses: actions/checkout@v2
- name: Test
run: make test
race-unit-test:
runs-on: ubuntu-18.04
steps:
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Dragonboat v3.4 comes with many improvements. All v3.3.x users are recommended t

### New features

- Raft Pre-Vote support.
- Experimental Raft Pre-Vote support.

### Improvements

Expand Down
1 change: 0 additions & 1 deletion README.CHS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

## 项目新闻 ##
* 2021-01-20 Dragonboat v3.3 已发布,请查看[CHANGELOG](CHANGELOG.md)获知所有更新情况。
* 2020-03-05 Dragonboat v3.2 已发布,请查看[CHANGELOG](CHANGELOG.md)获知详情。

## 关于 ##
Dragonboat是一个高性能纯[Go](https://golang.org)语言实现的多组[Raft](https://raft.github.io/) [共识算法](https://en.wikipedia.org/wiki/Consensus_(computer_science))库。
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

## News ##
* 2021-01-20 Dragonboat v3.3 has been released, please check [CHANGELOG](CHANGELOG.md) for all changes.
* 2020-03-05 Dragonboat v3.2 has been released, please check [CHANGELOG](CHANGELOG.md) for details.

## About ##
Dragonboat is a high performance multi-group [Raft](https://raft.github.io/) [consensus](https://en.wikipedia.org/wiki/Consensus_(computer_science)) library in pure [Go](https://golang.org/).
Expand Down
4 changes: 2 additions & 2 deletions internal/raft/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ func (r *raft) timeForElection() bool {
return r.electionTick >= r.randomizedElectionTimeout
}

func (r *raft) timeForHearbeat() bool {
func (r *raft) timeForHeartbeat() bool {
return r.heartbeatTick >= r.heartbeatTimeout
}

Expand Down Expand Up @@ -629,7 +629,7 @@ func (r *raft) leaderTick() error {
r.abortLeaderTransfer()
}
r.heartbeatTick++
if r.timeForHearbeat() {
if r.timeForHeartbeat() {
r.heartbeatTick = 0
if err := r.Handle(pb.Message{
From: r.nodeID,
Expand Down
5 changes: 4 additions & 1 deletion internal/transport/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,14 @@ func (t *Transport) send(req pb.Message) (bool, failedSend) {
if sq.rateLimited() {
return false, rateLimited
}

sq.increase(req)

select {
case sq.ch <- req:
sq.increase(req)
return true, success
default:
sq.decrease(req)
return false, chanIsFull
}
}
Expand Down

0 comments on commit 240ba62

Please sign in to comment.