mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
37 KiB
37 KiB
Previous change logs can be found at CHANGELOG-3.3.
v3.4.0 (TBD 2018-08)
See code changes and v3.4 upgrade guide for any breaking changes. Again, before running upgrades from any previous release, please make sure to read change logs below and v3.4 upgrade guide.
Improved
- Rewrite client balancer with new gRPC balancer interface.
- Add jitter to watch progress notify to prevent spikes in
etcd_network_client_grpc_sent_bytes_total. - Improve slow requests warning logging.
- e.g.
etcdserver: read-only range request "key:\"\\000\" range_end:\"\\000\" " took too long [3.389041388s] to execute
- e.g.
- Improve TLS setup error logging to help debug TLS-enabled cluster configuring issues.
- Improve long-running concurrent read transactions under light write workloads.
- Previously, periodic commit on pending writes blocks incoming read transactions, even if there is no pending write.
- Now, periodic commit operation does not block concurrent read transactions, thus improves long-running read transaction performance.
- Adjust election timeout on server restart to reduce disruptive rejoining servers.
- Previously, etcd fast-forwards election ticks on server start, with only one tick left for leader election. This is to speed up start phase, without having to wait until all election ticks elapse. Advancing election ticks is useful for cross datacenter deployments with larger election timeouts. However, it was affecting cluster availability if the last tick elapses before leader contacts the restarted node.
- Now, when etcd restarts, it adjusts election ticks with more than one tick left, thus more time for leader to prevent disruptive restart.
- Add Raft Pre-Vote feature to reduce disruptive rejoining servers.
- For instance, a flaky(or rejoining) member may drop in and out, and start campaign. This member will end up with a higher term, and ignore all incoming messages with lower term. In this case, a new leader eventually need to get elected, thus disruptive to cluster availability. Raft implements Pre-Vote phase to prevent this kind of disruptions. If enabled, Raft runs an additional phase of election to check if pre-candidate can get enough votes to win an election.
- Adjust periodic compaction retention window.
- e.g.
--auto-compaction-mode=revision --auto-compaction-retention=1000automaticallyCompacton"latest revision" - 1000every 5-minute (when latest revision is 30000, compact on revision 29000). - e.g. Previously,
--auto-compaction-mode=periodic --auto-compaction-retention=24hautomaticallyCompactwith 24-hour retention windown for every 2.4-hour. Now,Compacthappens for every 1-hour. - e.g. Previously,
--auto-compaction-mode=periodic --auto-compaction-retention=30mautomaticallyCompactwith 30-minute retention windown for every 3-minute. Now,Compacthappens for every 30-minute. - Periodic compactor keeps recording latest revisions for every compaction period when given period is less than 1-hour, or for every 1-hour when given compaction period is greater than 1-hour (e.g. 1-hour when
--auto-compaction-mode=periodic --auto-compaction-retention=24h). - For every compaction period or 1-hour, compactor uses the last revision that was fetched before compaction period, to discard historical data.
- The retention window of compaction period moves for every given compaction period or hour.
- For instance, when hourly writes are 100 and
--auto-compaction-mode=periodic --auto-compaction-retention=24h,v3.2.x,v3.3.0,v3.3.1, andv3.3.2compact revision 2400, 2640, and 2880 for every 2.4-hour, whilev3.3.3or later compacts revision 2400, 2500, 2600 for every 1-hour. - Futhermore, when
--auto-compaction-mode=periodic --auto-compaction-retention=30mand writes per minute are about 1000,v3.3.0,v3.3.1, andv3.3.2compact revision 30000, 33000, and 36000, for every 3-minute, whilev3.3.3or later compacts revision 30000, 60000, and 90000, for every 30-minute.
- e.g.
- Improve lease expire/revoke operation performance, address lease scalability issue.
- Make Lease
Lookupnon-blocking with concurrentGrant/Revoke. - Make etcd server return
raft.ErrProposalDroppedon internal Raft proposal drop in v3 applier and v2 applier.- e.g. a node is removed from cluster, or
raftpb.MsgProparrives at current leader while there is an ongoing leadership transfer.
- e.g. a node is removed from cluster, or
- Add
snapshotpackage for easier snapshot workflow (seegodoc.org/github.com/etcd/clientv3/snapshotfor more). - Improve functional tester coverage: proxy layer to run network fault tests in CI, TLS is enabled both for server and client, liveness mode, shuffle test sequence, membership reconfiguration failure cases, disastrous quorum loss and snapshot recover from a seed member, embedded etcd.
- Improve index compaction blocking by using a copy on write clone to avoid holding the lock for the traversal of the entire index.
Breaking Changes
- Remove
etcd --ca-fileflag, instead use--trusted-ca-file(--ca-filehas been deprecated since v2.1). - Remove
etcd --peer-ca-fileflag, instead use--peer-trusted-ca-file(--peer-ca-filehas been deprecated since v2.1). - Remove
pkg/transport.TLSInfo.CAFilefield, instead usepkg/transport.TLSInfo.TrustedCAFile(CAFilehas been deprecated since v2.1). - Drop ACIs from official release.
- AppC was officially suspended, as of late 2016.
acbuildis not maintained anymore.*.acifiles are not available fromv3.4release.
- Exit on empty hosts in advertise URLs.
- Address advertise client URLs accepts empty hosts.
- e.g. exit with error on
--advertise-client-urls=http://:2379. - e.g. exit with error on
--initial-advertise-peer-urls=http://:2380.
- Exit on shadowed environment variables.
- Address error on shadowed environment variables.
- e.g. exit with error on
ETCD_NAME=abc etcd --name=def. - e.g. exit with error on
ETCD_INITIAL_CLUSTER_TOKEN=abc etcd --initial-cluster-token=def. - e.g. exit with error on
ETCDCTL_ENDPOINTS=abc.com ETCDCTL_API=3 etcdctl endpoint health --endpoints=def.com.
- Change
etcdserverpb.AuthRoleRevokePermissionRequest/key,range_endfields type fromstringtobytes. - Rename
etcdserver.ServerConfig.SnapCountfield toetcdserver.ServerConfig.SnapshotCount, to be consistent with the flag nameetcd --snapshot-count. - Rename
embed.Config.SnapCountfield toembed.Config.SnapshotCount, to be consistent with the flag nameetcd --snapshot-count. - Change
embed.Config.CorsInfoin*cors.CORSInfotype toembed.Config.CORSinmap[string]struct{}type. - Remove
embed.Config.SetupLogging.- Now logger is set up automatically based on
embed.Config.Logger,embed.Config.LogOutputs,embed.Config.Debugfields.
- Now logger is set up automatically based on
- Rename
etcd --log-outputto--log-outputsto support multiple log outputs.etcd --log-outputwill be deprecated in v3.5.
- Rename
embed.Config.LogOutputtoembed.Config.LogOutputsto support multiple log outputs. - Change
embed.Config.LogOutputstype fromstringto[]stringto support multiple log outputs.- Now that
--log-outputsaccepts multiple writers, etcd configuration YAML filelog-outputsfield must be changed to[]stringtype. - Previously,
--config-file etcd.config.yamlcan havelog-outputs: defaultfield, now must belog-outputs: [default].
- Now that
- Change v3
etcdctl snapshotexit codes withsnapshotpackage.- Exit on error with exit code 1 (no more exit code 5 or 6 on
snapshot save/restorecommands).
- Exit on error with exit code 1 (no more exit code 5 or 6 on
- Migrate dependency management tool from
glidetogolang/dep.- <= 3.3 puts
vendordirectory undercmd/vendordirectory to prevent conflicting transitive dependencies. - 3.4 moves
cmd/vendordirectory tovendorat repository root. - Remove recursive symlinks in
cmddirectory. - Now
go get/install/buildonetcdpackages (e.g.clientv3,tools/benchmark) enforce builds with etcdvendordirectory.
- <= 3.3 puts
- Replace gRPC gateway endpoint
/v3betawith/v3.- Deprecated
/v3alpha. - To deprecate
/v3betain v3.5. - In v3.4,
curl -L http://localhost:2379/v3beta/kv/put -X POST -d '{"key": "Zm9v", "value": "YmFy"}'still works as a fallback tocurl -L http://localhost:2379/v3/kv/put -X POST -d '{"key": "Zm9v", "value": "YmFy"}', butcurl -L http://localhost:2379/v3beta/kv/put -X POST -d '{"key": "Zm9v", "value": "YmFy"}'won't work in v3.5. Usecurl -L http://localhost:2379/v3/kv/put -X POST -d '{"key": "Zm9v", "value": "YmFy"}'instead.
- Deprecated
- Change
walpackage function signatures to support structured logger and logging to file in server-side.- Previously,
Open(dirpath string, snap walpb.Snapshot) (*WAL, error), nowOpen(lg *zap.Logger, dirpath string, snap walpb.Snapshot) (*WAL, error). - Previously,
OpenForRead(dirpath string, snap walpb.Snapshot) (*WAL, error), nowOpenForRead(lg *zap.Logger, dirpath string, snap walpb.Snapshot) (*WAL, error). - Previously,
Repair(dirpath string) bool, nowRepair(lg *zap.Logger, dirpath string) bool. - Previously,
Create(dirpath string, metadata []byte) (*WAL, error), nowCreate(lg *zap.Logger, dirpath string, metadata []byte) (*WAL, error).
- Previously,
- Remove
pkg/corspackage. - Change
--experimental-enable-v2v3flag to--enable-v2v3; v2 storage emulation is now stable. - Move internal packages to
etcdserver."github.com/coreos/etcd/alarm"to"github.com/coreos/etcd/etcdserver/api/v3alarm"."github.com/coreos/etcd/compactor"to"github.com/coreos/etcd/etcdserver/api/v3compactor"."github.com/coreos/etcd/discovery"to"github.com/coreos/etcd/etcdserver/api/v2discovery"."github.com/coreos/etcd/etcdserver/auth"to"github.com/coreos/etcd/etcdserver/api/v2auth"."github.com/coreos/etcd/etcdserver/membership"to"github.com/coreos/etcd/etcdserver/api/membership"."github.com/coreos/etcd/etcdserver/stats"to"github.com/coreos/etcd/etcdserver/api/v2stats"."github.com/coreos/etcd/error"to"github.com/coreos/etcd/etcdserver/api/v2error"."github.com/coreos/etcd/rafthttp"to"github.com/coreos/etcd/etcdserver/api/rafthttp"."github.com/coreos/etcd/snap"to"github.com/coreos/etcd/etcdserver/api/snap"."github.com/coreos/etcd/store"to"github.com/coreos/etcd/etcdserver/api/v2store".
Dependency
- Upgrade
google.golang.org/grpcfromv1.7.5tov1.12.0. - Upgrade
github.com/ugorji/go/codectov1.1.1, and regenerate v2client. - Upgrade
github.com/soheilhy/cmuxfromv0.1.3tov0.1.4. - Upgrade
github.com/google/btreefromgoogle/btree@925471ac9togoogle/btree@e89373fe6. - Upgrade
github.com/spf13/cobrafromspf13/cobra@1c44ec8d3tospf13/cobra@cd30c2a7e. - Upgrade
github.com/spf13/pflagfromv1.0.0tospf13/pflag@1ce0cc6db. - Upgrade
github.com/coreos/go-systemdfromv15tov17.
Metrics, Monitoring
- Add
etcd_server_is_leaderPrometheus metric. - Add
etcd_debugging_mvcc_db_total_size_in_use_in_bytesPrometheus metric. - Add missing
etcd_network_peer_sent_failures_totalcount. - Fix
etcd_debugging_server_lease_expired_totalPrometheus metric. - Fix race conditions in v2 server stat collecting.
Security, Authentication
See security doc for more details.
- Add
etcd --host-whitelistflag,etcdserver.Config.HostWhitelist, andembed.Config.HostWhitelist, to prevent "DNS Rebinding" attack.- Any website can simply create an authorized DNS name, and direct DNS to
"localhost"(or any other address). Then, all HTTP endpoints of etcd server listening on"localhost"becomes accessible, thus vulnerable to DNS rebinding attacks (CVE-2018-5702). - Client origin enforce policy works as follow:
- If client connection is secure via HTTPS, allow any hostnames..
- If client connection is not secure and
"HostWhitelist"is not empty, only allow HTTP requests whose Host field is listed in whitelist.
- By default,
"HostWhitelist"is"*", which means insecure server allows all client HTTP requests. - Note that the client origin policy is enforced whether authentication is enabled or not, for tighter controls.
- When specifying hostnames, loopback addresses are not added automatically. To allow loopback interfaces, add them to whitelist manually (e.g.
"localhost","127.0.0.1", etc.). - e.g.
etcd --host-whitelist example.com, then the server will reject all HTTP requests whose Host field is notexample.com(also rejects requests to"localhost").
- Any website can simply create an authorized DNS name, and direct DNS to
- Support
etcd --corsin v3 HTTP requests (gRPC gateway). - Support TLS cipher suite lists.
- Support
ttlfield foretcdAuthentication JWT token.- e.g.
etcd --auth-token jwt,pub-key=<pub key path>,priv-key=<priv key path>,sign-method=<sign method>,ttl=5m.
- e.g.
- Allow empty token provider in
etcdserver.ServerConfig.AuthToken. - Fix TLS reload when certificate SAN field only includes IP addresses but no domain names.
- In Go, server calls
(*tls.Config).GetCertificatefor TLS reload if and only if server's(*tls.Config).Certificatesfield is not empty, or(*tls.ClientHelloInfo).ServerNameis not empty with a valid SNI from the client. Previously, etcd always populates(*tls.Config).Certificateson the initial client TLS handshake, as non-empty. Thus, client was always expected to supply a matching SNI in order to pass the TLS verification and to trigger(*tls.Config).GetCertificateto reload TLS assets. - However, a certificate whose SAN field does not include any domain names but only IP addresses would request
*tls.ClientHelloInfowith an emptyServerNamefield, thus failing to trigger the TLS reload on initial TLS handshake; this becomes a problem when expired certificates need to be replaced online. - Now,
(*tls.Config).Certificatesis created empty on initial TLS client handshake, first to trigger(*tls.Config).GetCertificate, and then to populate rest of the certificates on every new TLS connection, even when client SNI is empty (e.g. cert only includes IPs).
- In Go, server calls
etcd server
- Add
--initial-election-tick-advanceflag to configure initial election tick fast-forward.- By default,
--initial-election-tick-advance=true, then local member fast-forwards election ticks to speed up "initial" leader election trigger. - This benefits the case of larger election ticks. For instance, cross datacenter deployment may require longer election timeout of 10-second. If true, local node does not need wait up to 10-second. Instead, forwards its election ticks to 8-second, and have only 2-second left before leader election.
- Major assumptions are that: cluster has no active leader thus advancing ticks enables faster leader election. Or cluster already has an established leader, and rejoining follower is likely to receive heartbeats from the leader after tick advance and before election timeout.
- However, when network from leader to rejoining follower is congested, and the follower does not receive leader heartbeat within left election ticks, disruptive election has to happen thus affecting cluster availabilities.
- Now, this can be disabled by setting
--initial-election-tick-advance=false. - Disabling this would slow down initial bootstrap process for cross datacenter deployments. Make tradeoffs by configuring
--initial-election-tick-advanceat the cost of slow initial bootstrap. - If single-node, it advances ticks regardless.
- Address disruptive rejoining follower node.
- By default,
- Add
--pre-voteflag to enable to run an additional Raft election phase.- For instance, a flaky(or rejoining) member may drop in and out, and start campaign. This member will end up with a higher term, and ignore all incoming messages with lower term. In this case, a new leader eventually need to get elected, thus disruptive to cluster availability. Raft implements Pre-Vote phase to prevent this kind of disruptions. If enabled, Raft runs an additional phase of election to check if pre-candidate can get enough votes to win an election.
--pre-vote=falseby default.- v3.5 will enable
--pre-vote=trueby default.
--initial-corrupt-checkflag is now stable (--experimental-initial-corrupt-checkhaisbeen deprecated).--initial-corrupt-check=trueby default, to check cluster database hashes before serving client/peer traffic.
--corrupt-check-timeflag is now stable (--experimental-corrupt-check-timehaisbeen deprecated).--corrupt-check-time=12hby default, to check cluster database hashes for every 12-hour.
--enable-v2v3flag is now stable.--experimental-enable-v2v3has been deprecated.- Added more v2v3 integration tests.
--enable-v2=true --enable-v2v3=''by default, to enable v2 API server that is backed by v2 store.--enable-v2=true --enable-v2v3=/aaato enable v2 API server that is backed by v3 storage.--enable-v2=false --enable-v2v3=''to disable v2 API server.--enable-v2=false --enable-v2v3=/aaato disable v2 API server. TODO: error?- Automatically create parent directory if it does not exist (fix issue#9609).
- v4.0 will configure
--enable-v2=true --enable-v2v3=/aaato enable v2 API server that is backed by v3 storage.
- Add
--discovery-srv-nameflag to support custom DNS SRV name with discovery.- If not given, etcd queries
_etcd-server-ssl._tcp.[YOUR_HOST]and_etcd-server._tcp.[YOUR_HOST]. - If
--discovery-srv-name="foo", then query_etcd-server-ssl-foo._tcp.[YOUR_HOST]and_etcd-server-foo._tcp.[YOUR_HOST]. - Useful for operating multiple etcd clusters under the same domain.
- If not given, etcd queries
- Support
etcd --corsin v3 HTTP requests (gRPC gateway). - Rename
etcd --log-outputto--log-outputsto support multiple log outputs.etcd --log-outputwill be deprecated in v3.5.
- Add
--loggerflag to support structured logger and multiple log outputs in server-side.etcd --logger=capnslogwill be deprecated in v3.5.- Main motivation is to promote automated etcd monitoring, rather than looking back server logs when it starts breaking. Future development will make etcd log as few as possible, and make etcd easier to monitor with metrics and alerts.
etcd --logger=capnslog --log-outputs=defaultis the default setting and same as previous etcd server logging format.etcd --logger=zap --log-outputs=defaultis not supported when--logger=zap.- Instead, use
--logger=zap --log-outputs=stderr. - Or, use
etcd --logger=zap --log-outputs=systemd/journalto send logs to the local systemd journal. - Previously, if etcd parent process ID (PPID) is 1 (e.g. run with systemd),
etcd --logger=capnslog --log-outputs=defaultredirects server logs to local systemd journal. And if write to journald fails, it writes toos.Stderras a fallback. - However, even with PPID 1, it can fail to dial systemd journal (e.g. run embedded etcd with Docker container). Then, every single log write will fail and fall back to
os.Stderr, which is inefficient. - To avoid this problem, systemd journal logging must be configured manually.
- Instead, use
etcd --logger=zap --log-outputs=stderrwill log server operations in JSON-encoded format and writes logs toos.Stderr. Use this to override journald log redirects.etcd --logger=zap --log-outputs=stdoutwill log server operations in JSON-encoded format and writes logs toos.StdoutUse this to override journald log redirects.etcd --logger=zap --log-outputs=a.logwill log server operations in JSON-encoded format and writes logs to the specified filea.log.etcd --logger=zap --log-outputs=a.log,b.log,c.log,stdoutwrites server logs to multiple filesa.log,b.logandc.logat the same time and outputs toos.Stderr, in JSON-encoded format.etcd --logger=zap --log-outputs=/dev/nullwill discard all server logs.
- Fix
mvcc"unsynced" watcher restore operation.- "unsynced" watcher is watcher that needs to be in sync with events that have happened.
- That is, "unsynced" watcher is the slow watcher that was requested on old revision.
- "unsynced" watcher restore operation was not correctly populating its underlying watcher group.
- Which possibly causes missing events from "unsynced" watchers.
- A node gets network partitioned with a watcher on a future revision, and falls behind receiving a leader snapshot after partition gets removed. When applying this snapshot, etcd watch storage moves current synced watchers to unsynced since sync watchers might have become stale during network partition. And reset synced watcher group to restart watcher routines. Previously, there was a bug when moving from synced watcher group to unsynced, thus client would miss events when the watcher was requested to the network-partitioned node.
- Fix server panic on invalid Election Proclaim/Resign HTTP(S) requests.
- Previously, wrong-formatted HTTP requests to Election API could trigger panic in etcd server.
- e.g.
curl -L http://localhost:2379/v3/election/proclaim -X POST -d '{"value":""}',curl -L http://localhost:2379/v3/election/resign -X POST -d '{"value":""}'.
- Fix revision-based compaction retention parsing.
- Previously,
etcd --auto-compaction-mode revision --auto-compaction-retention 1was translated to revision retention 3600000000000. - Now,
etcd --auto-compaction-mode revision --auto-compaction-retention 1is correctly parsed as revision retention 1.
- Previously,
- Prevent overflow by large
TTLvalues forLeaseGrant.TTLparameter toGrantrequest is unit of second.- Leases with too large
TTLvalues exceedingmath.MaxInt64expire in unexpected ways. - Server now returns
rpctypes.ErrLeaseTTLTooLargeto client, when the requestedTTLis larger than 9,000,000,000 seconds (which is >285 years). - Again, etcd
Leaseis meant for short-periodic keepalives or sessions, in the range of seconds or minutes. Not for hours or days!
- Enable etcd server
raft.Config.CheckQuorumwhen starting withForceNewCluster. - Allow non-WAL files in
--wal-dirdirectory.- Previously, existing files such as
lost+foundin WAL directory prevent etcd server boot. - Now, WAL directory that contains only
lost+foundor a file that's not suffixed with.walis considered non-initialized.
- Previously, existing files such as
API
- Add
snapshotpackage for snapshot restore/save operations (seegodoc.org/github.com/etcd/clientv3/snapshotfor more). - Add
watch_idfield toetcdserverpb.WatchCreateRequestto allow user-provided watch ID tomvcc.- Corresponding
watch_idis returned viaetcdserverpb.WatchResponse, if any.
- Corresponding
- Add
fragmentfield toetcdserverpb.WatchCreateRequestto request etcd server to split watch events when the total size of events exceeds--max-request-bytesflag value plus gRPC-overhead 512 bytes.- The default server-side request bytes limit is
embed.DefaultMaxRequestByteswhich is 1.5 MiB plus gRPC-overhead 512 bytes. - If watch response events exceed this server-side request limit and watch request is created with
fragmentfieldtrue, the server will split watch events into a set of chunks, each of which is a subset of watch events below server-side request limit. - For example, watch response contains 10 events, where each event is 1 MiB. And server
--max-request-bytesflag value is 1 MiB. Then, server will send 10 separate fragmented events to the client. - For example, watch response contains 5 events, where each event is 2 MiB. And server
--max-request-bytesflag value is 1 MiB andclientv3.Config.MaxCallRecvMsgSizeis 1 MiB. Then, server will try to send 5 separate fragmented events to the client, and the client will error with"code = ResourceExhausted desc = grpc: received message larger than max (...)". - Client must implement fragmented watch event merge (which
clientv3does in etcd v3.4).
- The default server-side request bytes limit is
- Add
raftAppliedIndexfield toetcdserverpb.StatusResponsefor current Raft applied index. - Add
errorsfield toetcdserverpb.StatusResponsefor server-side error.- e.g.
"etcdserver: no leader", "NOSPACE", "CORRUPT"
- e.g.
- Add
dbSizeInUsefield toetcdserverpb.StatusResponsefor actual DB size after compaction.
Note: v3.5 will deprecate etcd --log-package-levels flag for capnslog; etcd --logger=zap --log-outputs=stderr will the default. v3.5 will deprecate [CLIENT-URL]/config/local/log endpoint.
Package embed
- Add
embed.Config.InitialElectionTickAdvanceto enable/disable initial election tick fast-forward.embed.NewConfig()would return*embed.ConfigwithInitialElectionTickAdvanceas true by default.
- Define
embed.CompactorModePeriodicforcompactor.ModePeriodic. - Define
embed.CompactorModeRevisionforcompactor.ModeRevision. - Change
embed.Config.CorsInfoin*cors.CORSInfotype toembed.Config.CORSinmap[string]struct{}type. - Remove
embed.Config.SetupLogging.- Now logger is set up automatically based on
embed.Config.Logger,embed.Config.LogOutputs,embed.Config.Debugfields.
- Now logger is set up automatically based on
- Add
embed.Config.Loggerto support structured loggerzapin server-side. - Rename
embed.Config.SnapCountfield toembed.Config.SnapshotCount, to be consistent with the flag nameetcd --snapshot-count. - Rename
embed.Config.LogOutputtoembed.Config.LogOutputsto support multiple log outputs. - Change
embed.Config.LogOutputstype fromstringto[]stringto support multiple log outputs.
Package integration
- Add
CLUSTER_DEBUGto enable test cluster logging.- Deprecated
capnslogin integration tests.
- Deprecated
client v3
- Add
WithFragmentOpOptionto support watch events fragmentation when the total size of events exceeds--max-request-bytesflag value plus gRPC-overhead 512 bytes.- Watch fragmentation is disabled by default.
- The default server-side request bytes limit is
embed.DefaultMaxRequestByteswhich is 1.5 MiB plus gRPC-overhead 512 bytes. - If watch response events exceed this server-side request limit and watch request is created with
fragmentfieldtrue, the server will split watch events into a set of chunks, each of which is a subset of watch events below server-side request limit. - For example, watch response contains 10 events, where each event is 1 MiB. And server
--max-request-bytesflag value is 1 MiB. Then, server will send 10 separate fragmented events to the client. - For example, watch response contains 5 events, where each event is 2 MiB. And server
--max-request-bytesflag value is 1 MiB andclientv3.Config.MaxCallRecvMsgSizeis 1 MiB. Then, server will try to send 5 separate fragmented events to the client, and the client will error with"code = ResourceExhausted desc = grpc: received message larger than max (...)".
etcdctl v3
- Add
check datascalecommand. - Add
check datascale --auto-compact, --auto-defragflags. - Add
check perf --auto-compact, --auto-defragflags. - Add
defrag --clusterflag. - Add "raft applied index" field to
endpoint status. - Add "errors" field to
endpoint status. - Add
endpoint health --write-outsupport.- Previously,
endpoint health --write-out jsondid not work.
- Previously,
- Fix
watch [key] [range_end] -- [exec-command…]parsing.- Previously,
ETCDCTL_API=3 ./bin/etcdctl watch foo -- echo watch event receivedpanicked.
- Previously,
gRPC gateway
- Replace gRPC gateway endpoint
/v3betawith/v3.- Deprecated
/v3alpha. - To deprecate
/v3betain v3.5. - In v3.4,
curl -L http://localhost:2379/v3beta/kv/put -X POST -d '{"key": "Zm9v", "value": "YmFy"}'still works as a fallback tocurl -L http://localhost:2379/v3/kv/put -X POST -d '{"key": "Zm9v", "value": "YmFy"}', butcurl -L http://localhost:2379/v3beta/kv/put -X POST -d '{"key": "Zm9v", "value": "YmFy"}'won't work in v3.5. Usecurl -L http://localhost:2379/v3/kv/put -X POST -d '{"key": "Zm9v", "value": "YmFy"}'instead.
- Deprecated
- Add API endpoints
/{v3beta,v3}/lease/leases, /{v3beta,v3}/lease/revoke, /{v3beta,v3}/lease/timetolive. - Support
etcd --corsin v3 HTTP requests (gRPC gateway).
Package raft
- Fix deadlock during PreVote migration process.
- Add
raft.ErrProposalDropped.- Now
(r *raft) Stepreturnsraft.ErrProposalDroppedif a proposal has been ignored. - e.g. a node is removed from cluster, or
raftpb.MsgProparrives at current leader while there is an ongoing leadership transfer.
- Now
- Improve Raft
becomeLeaderandstepLeaderby keeping track of latestpb.EntryConfChangeindex.- Previously record
pendingConfboolean field scanning the entire tail of the log, which can delay hearbeat send.
- Previously record
- Fix missing learner nodes on
(n *node) ApplyConfChange.
Tooling
- Add
etcd-dump-logs --entry-typeflag to support WAL log filtering by entry type.
Go
- Require Go 1.10+.
- Compile with Go 1.10.2.