Skip to content

Commit

Permalink
dragonboat: get ready for the v3.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
lni committed Jul 4, 2019
1 parent d260629 commit b275e9f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
## v3.1 (2019-07-04)

Dragonboat v3.1 is a maintenance release with breaking change. All v3.0.x users are recommended to upgrade. Please make sure to carefully read the CHANGELOG below before upgrading.

### Bug fixes

- Fixed ImportSnapshot.

### New features

- Added NodeHostConfig.RaftEventListener to allow user applications to be notified for certain Raft events.

### Improvements

- Made restarting an existing node faster.
- Immediately return ErrClusterNotReady when requests are dropped for not having a leader.

### Breaking changes

- When upgrading to v3.1.x from v3.0.x, dragonboat requires all streamed or imported snapshots to have been applied. github.com/lni/dragonboat/tools/upgrade310 has been provided to check that. See the godoc in github.com/lni/dragonboat/tools/upgrade310 for more details. For users who use NodeHost.RequestSnapshot to export snapshots for backup purposes, we recommend to re-generate all exported snapshots once upgraded to v3.1.

## v3.0 (2019-06-21)

Dragonboat v3.0 is a major release with breaking changes. Please make sure to carefully read the CHANGELOG below before upgrading.
Expand Down
5 changes: 4 additions & 1 deletion event.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,23 @@ package dragonboat

import (
"fmt"
"io"
"sync/atomic"

"github.com/VictoriaMetrics/metrics"
"github.com/lni/dragonboat/v3/internal/server"
"github.com/lni/dragonboat/v3/raftio"
)

// WriteHealthMetrics is disabled for v3.1

/*
// WriteHealthMetrics writes all health metrics in Prometheus format to the
// specified writer. This function is typically called by the metrics http
// handler.
func WriteHealthMetrics(w io.Writer) {
metrics.WritePrometheus(w, false)
}
*/

type raftEventListener struct {
clusterID uint64
Expand Down
8 changes: 4 additions & 4 deletions nodehost.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const (
// DragonboatPatch is the patch version number
DragonboatPatch = 0
// DEVVersion is a boolean flag indicating whether this is a dev version
DEVVersion = true
DEVVersion = false
)

var (
Expand Down Expand Up @@ -576,7 +576,7 @@ func (nh *NodeHost) SyncGetClusterMembership(ctx context.Context,
// its confirmed completion, failure or timeout.
//
// Deprecated: Use NodeHost.SyncGetClusterMembership instead.
// NodeHost.GetClusterMembership will be removed in v3.1.
// NodeHost.GetClusterMembership will be removed in v3.2.
func (nh *NodeHost) GetClusterMembership(ctx context.Context,
clusterID uint64) (*Membership, error) {
return nh.SyncGetClusterMembership(ctx, clusterID)
Expand Down Expand Up @@ -625,7 +625,7 @@ func (nh *NodeHost) GetNoOPSession(clusterID uint64) *client.Session {
// multiple client sessions when making concurrent proposals.
//
// Deprecated: Use NodeHost.SyncGetSession instead. NodeHost.GetNewSession will
// be removed in v3.1.
// be removed in v3.2.
func (nh *NodeHost) GetNewSession(ctx context.Context,
clusterID uint64) (*client.Session, error) {
return nh.SyncGetSession(ctx, clusterID)
Expand All @@ -639,7 +639,7 @@ func (nh *NodeHost) GetNewSession(ctx context.Context,
// Closed client session should no longer be used in future proposals.
//
// Deprecated: Use NodeHost.SyncCloseSession instead. NodeHost.CloseSession will
// be removed in v3.1.
// be removed in v3.2
func (nh *NodeHost) CloseSession(ctx context.Context,
session *client.Session) error {
return nh.SyncCloseSession(ctx, session)
Expand Down

0 comments on commit b275e9f

Please sign in to comment.