|
@@ -36,6 +36,7 @@ import (
|
|
|
|
|
|
|
|
"github.com/coreos/etcd/client"
|
|
"github.com/coreos/etcd/client"
|
|
|
"github.com/coreos/etcd/clientv3"
|
|
"github.com/coreos/etcd/clientv3"
|
|
|
|
|
+ "github.com/coreos/etcd/embed"
|
|
|
"github.com/coreos/etcd/etcdserver"
|
|
"github.com/coreos/etcd/etcdserver"
|
|
|
"github.com/coreos/etcd/etcdserver/api/v2http"
|
|
"github.com/coreos/etcd/etcdserver/api/v2http"
|
|
|
"github.com/coreos/etcd/etcdserver/api/v3client"
|
|
"github.com/coreos/etcd/etcdserver/api/v3client"
|
|
@@ -93,6 +94,7 @@ type ClusterConfig struct {
|
|
|
DiscoveryURL string
|
|
DiscoveryURL string
|
|
|
UseGRPC bool
|
|
UseGRPC bool
|
|
|
QuotaBackendBytes int64
|
|
QuotaBackendBytes int64
|
|
|
|
|
+ MaxTxnOps uint
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
type cluster struct {
|
|
type cluster struct {
|
|
@@ -224,6 +226,7 @@ func (c *cluster) mustNewMember(t *testing.T) *member {
|
|
|
peerTLS: c.cfg.PeerTLS,
|
|
peerTLS: c.cfg.PeerTLS,
|
|
|
clientTLS: c.cfg.ClientTLS,
|
|
clientTLS: c.cfg.ClientTLS,
|
|
|
quotaBackendBytes: c.cfg.QuotaBackendBytes,
|
|
quotaBackendBytes: c.cfg.QuotaBackendBytes,
|
|
|
|
|
+ maxTxnOps: c.cfg.MaxTxnOps,
|
|
|
})
|
|
})
|
|
|
m.DiscoveryURL = c.cfg.DiscoveryURL
|
|
m.DiscoveryURL = c.cfg.DiscoveryURL
|
|
|
if c.cfg.UseGRPC {
|
|
if c.cfg.UseGRPC {
|
|
@@ -490,6 +493,7 @@ type memberConfig struct {
|
|
|
peerTLS *transport.TLSInfo
|
|
peerTLS *transport.TLSInfo
|
|
|
clientTLS *transport.TLSInfo
|
|
clientTLS *transport.TLSInfo
|
|
|
quotaBackendBytes int64
|
|
quotaBackendBytes int64
|
|
|
|
|
+ maxTxnOps uint
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// mustNewMember return an inited member with the given name. If peerTLS is
|
|
// mustNewMember return an inited member with the given name. If peerTLS is
|
|
@@ -537,6 +541,10 @@ func mustNewMember(t *testing.T, mcfg memberConfig) *member {
|
|
|
m.ElectionTicks = electionTicks
|
|
m.ElectionTicks = electionTicks
|
|
|
m.TickMs = uint(tickDuration / time.Millisecond)
|
|
m.TickMs = uint(tickDuration / time.Millisecond)
|
|
|
m.QuotaBackendBytes = mcfg.quotaBackendBytes
|
|
m.QuotaBackendBytes = mcfg.quotaBackendBytes
|
|
|
|
|
+ m.MaxTxnOps = mcfg.maxTxnOps
|
|
|
|
|
+ if m.MaxTxnOps == 0 {
|
|
|
|
|
+ m.MaxTxnOps = embed.DefaultMaxTxnOps
|
|
|
|
|
+ }
|
|
|
m.AuthToken = "simple" // for the purpose of integration testing, simple token is enough
|
|
m.AuthToken = "simple" // for the purpose of integration testing, simple token is enough
|
|
|
return m
|
|
return m
|
|
|
}
|
|
}
|