Commit 5ca44288 authored by Jay Guo's avatar Jay Guo Committed by yacovm
Browse files

[FAB-11919] Towards etcdraft snapshotting 3/4



This CR wires BlockPuller to chain and adds SnapshotInterval
to etcdraft config options.

Change-Id: Ib8420f94d70bd36fc2ab3c66450926a574c4f69d
Signed-off-by: default avatarJay Guo <guojiannan1101@gmail.com>
parent 9b8827b8
......@@ -91,6 +91,7 @@ Debug:
DeliverTraceDir:
Consensus:
WALDir: {{ .OrdererDir Orderer }}/etcdraft/wal
SnapDir: {{ .OrdererDir Orderer }}/etcdraft/snapshot
Operations:
ListenAddress: 127.0.0.1:{{ .OrdererPort Orderer "Operations" }}
TLS:
......
......@@ -38,20 +38,22 @@ type ChainGetter interface {
GetChain(chainID string) *multichannel.ChainSupport
}
// Config contains etcdraft configurations
type Config struct {
// EtcdRaftConfig contains etcdraft configurations
type EtcdRaftConfig struct {
WALDir string // WAL data of <my-channel> is stored in WALDir/<my-channel>
SnapDir string // Snapshots of <my-channel> are stored in SnapDir/<my-channel>
}
// Consenter implements etddraft consenter
type Consenter struct {
Dialer *cluster.PredicateDialer
Communication cluster.Communicator
*Dispatcher
Chains ChainGetter
Logger *flogging.FabricLogger
Config Config
Cert []byte
Chains ChainGetter
Logger *flogging.FabricLogger
EtcdRaftConfig EtcdRaftConfig
OrdererConfig localconfig.TopLevel
Cert []byte
}
// TargetChannel extracts the channel from the given proto.Message.
......@@ -121,6 +123,11 @@ func (c *Consenter) HandleChain(support consensus.ConsenterSupport, metadata *co
return nil, errors.WithStack(err)
}
bp, err := newBlockPuller(support, c.Dialer, c.OrdererConfig.General.Cluster)
if err != nil {
return nil, errors.WithStack(err)
}
opts := Options{
RaftID: id,
Clock: clock.NewClock(),
......@@ -132,15 +139,16 @@ func (c *Consenter) HandleChain(support consensus.ConsenterSupport, metadata *co
HeartbeatTick: int(m.Options.HeartbeatTick),
MaxInflightMsgs: int(m.Options.MaxInflightMsgs),
MaxSizePerMsg: m.Options.MaxSizePerMsg,
SnapInterval: m.Options.SnapshotInterval,
RaftMetadata: raftMetadata,
WALDir: path.Join(c.Config.WALDir, support.ChainID()),
SnapDir: path.Join(c.Config.SnapDir, support.ChainID()),
WALDir: path.Join(c.EtcdRaftConfig.WALDir, support.ChainID()),
SnapDir: path.Join(c.EtcdRaftConfig.SnapDir, support.ChainID()),
}
rpc := &cluster.RPC{Channel: support.ChainID(), Comm: c.Communication}
return NewChain(support, opts, c.Communication, rpc, nil, nil)
return NewChain(support, opts, c.Communication, rpc, bp, nil)
}
func raftMetadata(blockMetadata *common.Metadata, configMetadata *etcdraft.Metadata) (*etcdraft.RaftMetadata, error) {
......@@ -169,16 +177,18 @@ func New(clusterDialer *cluster.PredicateDialer, conf *localconfig.TopLevel,
srvConf comm.ServerConfig, srv *comm.GRPCServer, r *multichannel.Registrar) *Consenter {
logger := flogging.MustGetLogger("orderer.consensus.etcdraft")
var config Config
if err := viperutil.Decode(conf.Consensus, &config); err != nil {
var cfg EtcdRaftConfig
if err := viperutil.Decode(conf.Consensus, &cfg); err != nil {
logger.Panicf("Failed to decode etcdraft configuration: %s", err)
}
consenter := &Consenter{
Cert: srvConf.SecOpts.Certificate,
Logger: logger,
Chains: r,
Config: config,
Cert: srvConf.SecOpts.Certificate,
Logger: logger,
Chains: r,
EtcdRaftConfig: cfg,
OrdererConfig: *conf,
Dialer: clusterDialer,
}
consenter.Dispatcher = &Dispatcher{
Logger: logger,
......
......@@ -11,8 +11,12 @@ import (
"os"
"path"
"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric/common/crypto/tlsgen"
"github.com/hyperledger/fabric/common/flogging"
mockconfig "github.com/hyperledger/fabric/common/mocks/config"
"github.com/hyperledger/fabric/core/comm"
"github.com/hyperledger/fabric/orderer/common/cluster"
clustermocks "github.com/hyperledger/fabric/orderer/common/cluster/mocks"
"github.com/hyperledger/fabric/orderer/common/multichannel"
"github.com/hyperledger/fabric/orderer/consensus/etcdraft"
......@@ -44,6 +48,23 @@ var _ = Describe("Consenter", func() {
Expect(err).NotTo(HaveOccurred())
walDir = path.Join(dataDir, "wal-")
snapDir = path.Join(dataDir, "snap-")
blockBytes, err := ioutil.ReadFile("testdata/mychannel.block")
Expect(err).NotTo(HaveOccurred())
goodConfigBlock := &common.Block{}
proto.Unmarshal(blockBytes, goodConfigBlock)
lastBlock := &common.Block{
Data: goodConfigBlock.Data,
Metadata: &common.BlockMetadata{
Metadata: [][]byte{{}, utils.MarshalOrPanic(&common.Metadata{
Value: utils.MarshalOrPanic(&common.LastConfig{Index: 0}),
})},
},
}
support.BlockReturns(lastBlock)
})
AfterEach(func() {
......@@ -131,8 +152,8 @@ var _ = Describe("Consenter", func() {
support.SharedConfigReturns(&mockconfig.Orderer{ConsensusMetadataVal: metadata})
consenter := newConsenter(chainGetter)
consenter.Config.WALDir = walDir
consenter.Config.SnapDir = snapDir
consenter.EtcdRaftConfig.WALDir = walDir
consenter.EtcdRaftConfig.SnapDir = snapDir
chain, err := consenter.HandleChain(support, nil)
Expect(err).NotTo(HaveOccurred())
......@@ -184,8 +205,8 @@ var _ = Describe("Consenter", func() {
defer os.RemoveAll(dir)
consenter := newConsenter(chainGetter)
consenter.Config.WALDir = walDir
consenter.Config.SnapDir = snapDir
consenter.EtcdRaftConfig.WALDir = walDir
consenter.EtcdRaftConfig.SnapDir = snapDir
d := &etcdraftproto.RaftMetadata{
Consenters: map[uint64]*etcdraftproto.Consenter{1: c},
......@@ -216,10 +237,12 @@ var _ = Describe("Consenter", func() {
})
func newConsenter(chainGetter *mocks.ChainGetter) *etcdraft.Consenter {
comm := &clustermocks.Communicator{}
comm.On("Configure", mock.Anything, mock.Anything)
communicator := &clustermocks.Communicator{}
ca, err := tlsgen.NewCA()
Expect(err).NotTo(HaveOccurred())
communicator.On("Configure", mock.Anything, mock.Anything)
consenter := &etcdraft.Consenter{
Communication: comm,
Communication: communicator,
Cert: []byte("cert.orderer0.org0"),
Logger: flogging.MustGetLogger("test"),
Chains: chainGetter,
......@@ -227,6 +250,11 @@ func newConsenter(chainGetter *mocks.ChainGetter) *etcdraft.Consenter {
Logger: flogging.MustGetLogger("test"),
ChainSelector: &mocks.ReceiverGetter{},
},
Dialer: cluster.NewTLSPinningDialer(comm.ClientConfig{
SecOpts: &comm.SecureOptions{
Certificate: ca.CertBytes(),
},
}),
}
return consenter
}
......@@ -32,7 +32,7 @@ func (m *Metadata) Reset() { *m = Metadata{} }
func (m *Metadata) String() string { return proto.CompactTextString(m) }
func (*Metadata) ProtoMessage() {}
func (*Metadata) Descriptor() ([]byte, []int) {
return fileDescriptor_configuration_ba740eac6f67e7c7, []int{0}
return fileDescriptor_configuration_7f128e6e8996db94, []int{0}
}
func (m *Metadata) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Metadata.Unmarshal(m, b)
......@@ -81,7 +81,7 @@ func (m *Consenter) Reset() { *m = Consenter{} }
func (m *Consenter) String() string { return proto.CompactTextString(m) }
func (*Consenter) ProtoMessage() {}
func (*Consenter) Descriptor() ([]byte, []int) {
return fileDescriptor_configuration_ba740eac6f67e7c7, []int{1}
return fileDescriptor_configuration_7f128e6e8996db94, []int{1}
}
func (m *Consenter) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Consenter.Unmarshal(m, b)
......@@ -137,6 +137,7 @@ type Options struct {
HeartbeatTick uint32 `protobuf:"varint,3,opt,name=heartbeat_tick,json=heartbeatTick,proto3" json:"heartbeat_tick,omitempty"`
MaxInflightMsgs uint32 `protobuf:"varint,4,opt,name=max_inflight_msgs,json=maxInflightMsgs,proto3" json:"max_inflight_msgs,omitempty"`
MaxSizePerMsg uint64 `protobuf:"varint,5,opt,name=max_size_per_msg,json=maxSizePerMsg,proto3" json:"max_size_per_msg,omitempty"`
SnapshotInterval uint64 `protobuf:"varint,6,opt,name=snapshot_interval,json=snapshotInterval,proto3" json:"snapshot_interval,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
......@@ -146,7 +147,7 @@ func (m *Options) Reset() { *m = Options{} }
func (m *Options) String() string { return proto.CompactTextString(m) }
func (*Options) ProtoMessage() {}
func (*Options) Descriptor() ([]byte, []int) {
return fileDescriptor_configuration_ba740eac6f67e7c7, []int{2}
return fileDescriptor_configuration_7f128e6e8996db94, []int{2}
}
func (m *Options) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Options.Unmarshal(m, b)
......@@ -201,6 +202,13 @@ func (m *Options) GetMaxSizePerMsg() uint64 {
return 0
}
func (m *Options) GetSnapshotInterval() uint64 {
if m != nil {
return m.SnapshotInterval
}
return 0
}
// RaftMetadata stores data used by the Raft OSNs when
// coordinating with each other, to be serialized into
// block meta dta field and used after failres and restarts.
......@@ -222,7 +230,7 @@ func (m *RaftMetadata) Reset() { *m = RaftMetadata{} }
func (m *RaftMetadata) String() string { return proto.CompactTextString(m) }
func (*RaftMetadata) ProtoMessage() {}
func (*RaftMetadata) Descriptor() ([]byte, []int) {
return fileDescriptor_configuration_ba740eac6f67e7c7, []int{3}
return fileDescriptor_configuration_7f128e6e8996db94, []int{3}
}
func (m *RaftMetadata) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RaftMetadata.Unmarshal(m, b)
......@@ -272,40 +280,41 @@ func init() {
}
func init() {
proto.RegisterFile("orderer/etcdraft/configuration.proto", fileDescriptor_configuration_ba740eac6f67e7c7)
}
var fileDescriptor_configuration_ba740eac6f67e7c7 = []byte{
// 484 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0xc1, 0x6e, 0x13, 0x31,
0x10, 0x86, 0xb5, 0x4d, 0x4a, 0x9b, 0x69, 0x96, 0xb4, 0xe6, 0x12, 0x21, 0x0e, 0x51, 0x80, 0x12,
0x40, 0xda, 0x95, 0x5a, 0x21, 0x21, 0x8e, 0x14, 0x90, 0x72, 0x88, 0x40, 0xa6, 0x27, 0x2e, 0x2b,
0xc7, 0x99, 0x6c, 0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x39, 0x87, 0x44, 0x9b, 0x3c, 0x99, 0x6d, 0x97, 0x68, 0x0a, 0x9c, 0xe4, 0x68,
0x92, 0xa9, 0x18, 0x1b, 0x25, 0xc3, 0x92, 0xdb, 0xa4, 0x7a, 0x0a, 0xfb, 0x31, 0xbf, 0x3e, 0xe4,
0x8a, 0x66, 0xab, 0x71, 0x22, 0xf5, 0x22, 0x3d, 0x68, 0x4b, 0x43, 0x5b, 0x1a, 0xda, 0xd2, 0xe3,
0x17, 0x34, 0x7e, 0xe2, 0x0b, 0xb7, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x65, 0x55, 0xbd, 0x7e,
0x5c, 0x03, 0x00, 0x00,
proto.RegisterFile("orderer/etcdraft/configuration.proto", fileDescriptor_configuration_7f128e6e8996db94)
}
var fileDescriptor_configuration_7f128e6e8996db94 = []byte{
// 500 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0x4f, 0x8f, 0xd3, 0x30,
0x10, 0xc5, 0x95, 0x6d, 0xf7, 0xdf, 0x6c, 0x43, 0x5b, 0x73, 0xa9, 0x10, 0x87, 0xaa, 0xc0, 0x52,
0x58, 0x29, 0x91, 0x76, 0x85, 0x84, 0x38, 0xb2, 0x80, 0xd4, 0x43, 0x05, 0x32, 0x7b, 0xe2, 0x12,
0xb9, 0xe9, 0x34, 0xb1, 0x9a, 0xc6, 0x91, 0x3d, 0xad, 0xda, 0xbd, 0xf2, 0x8d, 0x39, 0x73, 0x40,
0x76, 0x92, 0xa6, 0x54, 0x7b, 0xb3, 0xde, 0xfb, 0xcd, 0xe4, 0xc5, 0x33, 0x86, 0xd7, 0x4a, 0xcf,
0x51, 0xa3, 0x0e, 0x91, 0xe2, 0xb9, 0x16, 0x0b, 0x0a, 0x63, 0x95, 0x2f, 0x64, 0xb2, 0xd6, 0x82,
0xa4, 0xca, 0x83, 0x42, 0x2b, 0x52, 0xec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, 0x58, 0xad, 0xc2, 0x83, 0xb2, 0xb0, 0x2c, 0x0b, 0xcb, 0xb2, 0xf0,
0xf8, 0xb9, 0xcd, 0xce, 0x9c, 0x71, 0xf7, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x4b, 0x4b, 0x2a, 0x56,
0x89, 0x03, 0x00, 0x00,
}
......@@ -29,11 +29,12 @@ message Consenter {
// Options to be specified for all the etcd/raft nodes. These can be modified on a
// per-channel basis.
message Options {
uint64 tick_interval = 1; // specified in miliseconds
uint32 election_tick = 2;
uint32 heartbeat_tick = 3;
uint32 max_inflight_msgs = 4;
uint64 max_size_per_msg = 5;
uint64 tick_interval = 1; // specified in miliseconds
uint32 election_tick = 2;
uint32 heartbeat_tick = 3;
uint32 max_inflight_msgs = 4;
uint64 max_size_per_msg = 5;
uint64 snapshot_interval = 6; // take snapshot every n blocks
}
// RaftMetadata stores data used by the Raft OSNs when
......
......@@ -314,6 +314,7 @@ Orderer: &OrdererDefaults
Options:
# TickInterval is the time interval between two Node.Tick
# invocations.
# Unit: millisecond
TickInterval: 100
# ElectionTick is the number of Node.Tick invocations that must pass
......@@ -338,6 +339,9 @@ Orderer: &OrdererDefaults
# the throughput during normal replication.
MaxSizePerMsg: 1048576
# SnapshotInterval defines number of blocks per which a snapshot is taken
SnapshotInterval: 500
# Organizations lists the orgs participating on the orderer side of the
# network.
Organizations:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment