107 KiB
Previous change logs can be found at CHANGELOG-3.3.
v3.4.33 (TBD)
etcd grpc-proxy
Dependencies
- Compile binaries using go 1.21.10.
- Upgrade bbolt to 1.3.10.
v3.4.32 (2024-04-25)
etcd server
- Fix LeaseTimeToLive returns error if leader changed.
- Fix ignore raft messages if member id mismatch.
- Update the compaction log when bootstrap.
- Allow new server to join 3.5 cluster if
next-cluster-version-compatible=true - Allow updating the cluster version when downgrading from 3.5.
- Fix Revision decreasing after panic during compaction
Package clientv3
- Add requests retry when receiving ErrGPRCNotSupportedForLearner and endpoints > 1.
- Fix initialization for epMu in client context.
Dependencies
- Compile binaries using go 1.21.9.
v3.4.31 (2024-03-21)
etcd server
- Add mvcc: print backend database size and size in use in compaction logs.
- Fix leases wrongly revoked by the leader by ignoring old leader's leases revoking request.
- Fix no progress notification being sent for watch that doesn't get any events.
- Fix watch event loss after compaction.
- Add
next-cluster-version-compatibleflag to allow downgrade from 3.5.
Package clientv3
Dependencies
- Upgrade bbolt to 1.3.9.
- Compile binaries using go 1.21.8.
- Upgrade google.golang.org/protobuf to v1.33.0 to address CVE-2024-24786.
- Upgrade github.com/sirupsen/logrus to v1.9.3 to address PRISMA-2023-0056.
Others
v3.4.30 (2024-01-31)
etcd server
Dependencies
- Compile binaries using go 1.20.13.
- Upgrade golang.org/x/crypto to v0.17+ to address CVE-2023-48795.
v3.4.29 (2024-01-09)
etcd server
- Disable following HTTP redirects in peer communication
- Add livez/readyz HTTP endpoints
- Fix Check if be is nil to avoid panic when be is overriden with nil
- Fix Add missing experimental-enable-lease-checkpoint-persist flag in etcd help
- Fix Don't flock snapshot files
Dependencies
- Compile binaries using go 1.20.12.
v3.4.28 (2023-11-23)
etcd server
- Improve Skip getting authInfo from incoming context when auth is disabled
- Use the default write scheduler since golang.org/x/net@v0.11.0 started using round-robin scheduler.
- Add cluster ID check during data corruption detection to prevent false alarm.
- Add Learner support Snapshot RPC.
Package clientv3
- Fix Reset auth token when failing to authenticate due to auth being disabled.
- Simplify grpc dialer usage.
- Replace balancer with upstream grpc solution.
- Fix race condition when accessing cfg.Endpoints in dial().
- Fix invalid authority header issue in single endpoint scenario.
Dependencies
- Compile binaries using go 1.20.11.
- Upgrade bbolt to 1.3.8.
- Upgrade gRPC to 1.58.3 in https://github.com/etcd-io/etcd/pull/16997 and https://github.com/etcd-io/etcd/pull/16999. Note that gRPC server will reject requests with connection header (refer to https://github.com/grpc/grpc-go/pull/4803).
v3.4.27 (2023-07-11)
etcd server
- Fix corruption check may get a
ErrCompactederror when server has just been compacted - Improve Lease put performance for the case that auth is disabled or the user is admin
- Fix embed: nil pointer dereference when stopServer
etcdctl v3
Dependencies
- Compile binaries using go 1.19.10.
v3.4.26 (2023-05-12)
etcd server
Dependencies
- Compile binaries using go 1.19.9
v3.4.25 (2023-04-14)
etcd server
- Add
etcd --tls-min-version --tls-max-versionto enable support for TLS 1.3. - Add
etcd --listen-client-http-urlsflag to support separating http server from grpc one, thus giving full immunity to watch stream starvation under high read load. - Change http2 frame scheduler to random algorithm
- Fix server/embed: fix data race when starting both secure & insecure gRPC servers on the same address
- Fix server/auth: disallow creating empty permission ranges
- Fix wsproxy did not print log in JSON format.
- Fix CVE-2021-28235 by clearing password after authenticating the user.
- Fix etcdserver may panic when parsing a JWT token without username or revision.
- Fix Watch response traveling back in time when reconnecting member downloads snapshot from the leader.
- Fix Requested watcher progress notifications are not synchronised with stream.
Package clientv3
- Reverted the fix to auth invalid token and old revision errors in watch.
Dependencies
- Recommend Go 1.19+.
- Compile binaries using Go 1.19.8.
- Upgrade golang.org/x/net to v0.7.0.
Docker image
v3.4.24 (2023-02-16)
etcd server
- Fix etcdserver might promote a non-started learner.
- Improve mvcc: reduce count-only range overhead
- Improve mvcc: push down RangeOptions.limit argv into index tree to reduce memory overhead
- Improve server: set multiple concurrentReadTx instances share one txReadBuffer
- Fix aligning zap log timestamp resolution to microseconds. Etcd now uses zap timestamp format:
2006-01-02T15:04:05.999999Z0700(microsecond instead of milliseconds precision). - Fix consistently format IPv6 addresses for comparison
Package clientv3
Dependencies
- Upgrade bbolt to v1.3.7.
- Upgrade github.com/grpc-ecosystem/grpc-gateway from v1.9.5 to v1.11.0.
Docker image
v3.4.23 (2022-12-21)
etcd server
- Fix Remove memberID from data corrupt alarm.
- Fix nil pointer panic for readonly txn due to nil response.
- Bumped some dependencies to address some HIGH Vulnerabilities.
Package clientv3
Dependencies
- Recommend Go 1.17+.
- Compile binaries using Go 1.17.13.
Docker image
- Use distroless base image to address critical Vulnerabilities.
v3.4.22 (2022-11-02)
etcd server
- Fix memberID equals zero in corruption alarm
- Fix auth invalid token and old revision errors in watch
- Fix avoid closing a watch with ID 0 incorrectly
- Fix auth: fix data consistency issue caused by recovery from snapshot
Package netutil
Package clientv3
etcd grpc-proxy
- Add
etcd grpc-proxy start --listen-cipher-suitesflag to support adding configurable cipher list.
v3.4.21 (2022-09-15)
etcd server
- Fix Durability API guarantee broken in single node cluster
- Fix Panic due to nil log object
- Fix authentication data not loaded on member startup
etcdctl v3
v3.4.20 (2022-08-06)
Package clientv3
etcd server
- Add
etcd --max-concurrent-streamsflag to configure the max concurrent streams each client can open at a time, and defaults to math.MaxUint32. - Add
etcd --experimental-enable-lease-checkpoint-persistflag to enable checkpoint persisting. - Fix Lease checkpoints don't prevent to reset ttl on leader change, requires enabling checkpoint persisting.
- Fix Protect rangePermCache with a RW lock correctly
- Fix raft: postpone MsgReadIndex until first commit in the term
- Fix etcdserver: resend ReadIndex request on empty apply request
- Fix remove temp files in snap dir when etcdserver starting
- Fix Etcdserver is still in progress of processing LeaseGrantRequest when it receives a LeaseKeepAliveRequest on the same leaseID
- Fix Grant lease with negative ID can possibly cause db out of sync
- Fix Allow non mutating requests pass through quotaKVServer when NOSPACE
v3.4.19 (2022-07-12)
See code changes and v3.4 upgrade guide for any breaking changes.
etcd server
- Fix exclude the same alarm type activated by multiple peers.
- Fix Defrag unsets backend options.
- Fix lease leak issue due to tokenProvider isn't enabled when restoring auth store from a snapshot.
- Fix the race condition between goroutine and channel on the same leases to be revoked.
- Fix lessor may continue to schedule checkpoint after stepping down leader role.
Package clientv3
Dependency
- Upgrade go.etcd.io/bbolt from v1.3.3 to v1.3.6.
Security
- Upgrade golang.org/x/crypto to v0.0.0-20220411220226-7b82a4e95df4 to address CVE-2022-27191 .
- Upgrade gopkg.in/yaml.v2 to v2.4.0 to address CVE-2019-11254.
Go
- Require Go 1.16+.
- Compile with Go 1.16+.
- etcd uses go modules (instead of vendor dir) to track dependencies.
v3.4.18 (2021-10-15)
See code changes and v3.4 upgrade guide for any breaking changes.
Metrics, Monitoring
See List of metrics for all metrics per release.
Other
- Updated base image from
debian:buster-v1.4.0todebian:bullseye-20210927to fix the following critical CVEs:- CVE-2021-3711: miscalculation of a buffer size in openssl's SM2 decryption
- CVE-2021-35942: integer overflow flaw in glibc
- CVE-2019-9893: incorrect syscall argument generation in libseccomp
- CVE-2021-36159: libfetch in apk-tools mishandles numeric strings in FTP and HTTP protocols to allow out of bound reads.
v3.4.17 (2021-10-03)
See code changes and v3.4 upgrade guide for any breaking changes.
etcdctl
- Fix etcdctl check datascale command to work with https endpoints.
gRPC gateway
- Add
MaxCallRecvMsgSizesupport for http client.
Dependency
Go
- Compile with Go 1.12.17.
v3.4.16 (2021-05-11)
See code changes and v3.4 upgrade guide for any breaking changes.
etcd server
- Add
--experimental-warning-apply-durationflag which allows apply duration threshold to be configurable. - Fix
--unsafe-no-fsyncto still write-out data avoiding corruption (most of the time). - Reduce around 30% memory allocation by logging range response size without marshal.
- Add exclude alarms from health check conditionally.
Metrics
- Fix incorrect metrics generated when clients cancel watches back-ported from (https://github.com/etcd-io/etcd/pull/12196).
Go
- Compile with Go 1.12.17.
v3.4.15 (2021-02-26)
See code changes and v3.4 upgrade guide for any breaking changes.
etcd server
- Log successful etcd server-side health check in debug level.
- Fix 64 KB websocket notification message limit.
Package fileutil
- Fix
F_OFD_constants.
Dependency
- Bump up
gorilla/websocketto v1.4.2.
Go
- Compile with Go 1.12.17.
v3.4.14 (2020-11-25)
See code changes and v3.4 upgrade guide for any breaking changes.
Package clientv3
- Fix auth token invalid after watch reconnects. Get AuthToken automatically when clientConn is ready.
etcd server
- Fix server panic when force-new-cluster flag is enabled in a cluster which had learner node.
Package netutil
- Remove
netutil.DropPort/RecoverPort/SetLatency/RemoveLatency.- These are not used anymore. They were only used for older versions of functional testing.
- Removed to adhere to best security practices, minimize arbitrary shell invocation.
tools/etcd-dump-metrics
Go
- Compile with Go 1.12.17.
v3.4.13 (2020-8-24)
See code changes and v3.4 upgrade guide for any breaking changes.
Security
- A log warning is added when etcd use any existing directory that has a permission different than 700 on Linux and 777 on Windows.
Go
- Compile with Go 1.12.17.
v3.4.12 (2020-08-19)
See code changes and v3.4 upgrade guide for any breaking changes.
etcd server
- Fix server panic in slow writes warnings.
- Fixed via PR#12238.
Go
- Compile with Go 1.12.17.
v3.4.11 (2020-08-18)
See code changes and v3.4 upgrade guide for any breaking changes.
etcd server
- Improve
runtime.FDUsagecall pattern to reduce objects malloc of Memory Usage and CPU Usage. - Add
etcd --experimental-watch-progress-notify-intervalflag to make watch progress notify interval configurable.
Package clientv3
Package runtime
Metrics, Monitoring
- Add
os_fd_usedandos_fd_limitto monitor current OS file descriptors. - Add
etcd_disk_defrag_inflight.
Go
- Compile with Go 1.12.17.
v3.4.10 (2020-07-16)
See code changes and v3.4 upgrade guide for any breaking changes.
Package etcd server
- Add
--unsafe-no-fsyncflag.- Setting the flag disables all uses of fsync, which is unsafe and will cause data loss. This flag makes it possible to run an etcd node for testing and development without placing lots of load on the file system.
- Add etcd --auth-token-ttl flag to customize
simpleTokenTTLsettings. - Improve runtime.FDUsage objects malloc of Memory Usage and CPU Usage.
- Improve mvcc.watchResponse channel Memory Usage.
- Fix
int64convert panic in raft logger.
Breaking Changes
- Changed behavior on existing dir permission.
- Previously, the permission was not checked on existing data directory and the directory used for automatically generating self-signed certificates for TLS connections with clients. Now a check is added to make sure those directories, if already exist, has a desired permission of 700 on Linux and 777 on Windows.
Go
- Compile with Go 1.12.17.
v3.4.9 (2020-05-20)
See code changes and v3.4 upgrade guide for any breaking changes.
Package wal
Go
- Compile with Go 1.12.17.
v3.4.8 (2020-05-18)
See code changes and v3.4 upgrade guide for any breaking changes.
etcdctl
Package clientv3
etcd server
- Improve logging around snapshot send and receive.
- Add log when etcdserver failed to apply command.
- Fix deadlock bug in mvcc.
- Fix inconsistency between WAL and server snapshot.
- Previously, server restore fails if it had crashed after persisting raft hard state but before saving snapshot.
- See https://github.com/etcd-io/etcd/issues/10219 for more.
Package Auth
Metrics, Monitoring
Go
- Compile with Go 1.12.17.
v3.4.7 (2020-04-01)
See code changes and v3.4 upgrade guide for any breaking changes.
etcd server
Package wal
Metrics, Monitoring
Go
- Compile with Go 1.12.17.
v3.4.6 (2020-03-29)
See code changes and v3.4 upgrade guide for any breaking changes.
Package lease
Go
- Compile with Go 1.12.17.
v3.4.5 (2020-03-18)
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.
etcd server
client v3
- Fix
"hasleader"metadata embedding.- Previously,
clientv3.WithRequireLeader(ctx)was overwriting existing context keys.
- Previously,
etcdctl v3
- Fix
etcdctl member addcommand to prevent potential timeout.
Metrics, Monitoring
See List of metrics for all metrics per release.
gRPC Proxy
- Fix
panic on errorfor metrics handler.
Go
- Compile with Go 1.12.17.
v3.4.4 (2020-02-24)
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.
etcd server
- Fix
wait purge file loop during shutdown.- Previously, during shutdown etcd could accidentally remove needed wal files, resulting in catastrophic error
etcdserver: open wal error: wal: file not found.during startup. - Now, etcd makes sure the purge file loop exits before server signals stop of the raft node.
- Previously, during shutdown etcd could accidentally remove needed wal files, resulting in catastrophic error
- Fix corruption bug in defrag.
- Fix quorum protection logic when promoting a learner.
- Improve peer corruption checker to work when peer mTLS is enabled.
Metrics, Monitoring
See List of metrics for all metrics per release.
Note that any etcd_debugging_* metrics are experimental and subject to change.
- Add
etcd_debugging_mvcc_total_put_size_in_bytesPrometheus metric. - Fix bug where etcd_debugging_mvcc_db_compaction_keys_total is always 0.
Auth
- Fix NoPassword check when adding user through GRPC gateway (issue#11414)
- Fix bug where some auth related messages are logged at wrong level
v3.4.3 (2019-10-24)
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.
Metrics, Monitoring
See List of metrics for all metrics per release.
Note that any etcd_debugging_* metrics are experimental and subject to change.
- Change
etcd_cluster_versionPrometheus metrics to include only major and minor version.
Go
- Compile with Go 1.12.12.
v3.4.2 (2019-10-11)
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.
etcdctl v3
- Fix
etcdctl member addcommand to prevent potential timeout.
etcdserver
- Add
tracingto range, put and compact requests in etcdserver.
Go
client v3
v3.4.1 (2019-09-17)
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.
Metrics, Monitoring
See List of metrics for all metrics per release.
Note that any etcd_debugging_* metrics are experimental and subject to change.
- Add
etcd_debugging_mvcc_current_revisionPrometheus metric. - Add
etcd_debugging_mvcc_compact_revisionPrometheus metric.
etcd server
- Fix secure server logging message.
- Remove redundant
%characters in file descriptor warning message.
Package embed
- Add
embed.Config.ZapLoggerBuilderto allow creating a custom zap logger.
Dependency
- Upgrade
google.golang.org/grpcfromv1.23.0tov1.23.1.
Go
v3.4.0 (2019-08-30)
See code changes and v3.4 upgrade guide for any breaking changes.
- v3.4.0 (2019-08-30), see code changes.
- v3.4.0-rc.4 (2019-08-29), see code changes.
- v3.4.0-rc.3 (2019-08-27), see code changes.
- v3.4.0-rc.2 (2019-08-23), see code changes.
- v3.4.0-rc.1 (2019-08-15), see code changes.
- v3.4.0-rc.0 (2019-08-12), see code changes.
Again, before running upgrades from any previous release, please make sure to read change logs below and v3.4 upgrade guide.
Documentation
- etcd now has a new website! Please visit https://etcd.io.
Improved
- Add Raft learner: etcd#10725, etcd#10727, etcd#10730.
- User guide: runtime-configuration document.
- API change: API reference document.
- More details on implementation: learner design document and implementation task list.
- Rewrite client balancer with new gRPC balancer interface.
- Upgrade gRPC to v1.23.0.
- Improve client balancer failover against secure endpoints.
- Fix gRPC panic "send on closed channel.
- The new client balancer uses an asynchronous resolver to pass endpoints to the gRPC dial function. To block until the underlying connection is up, pass
grpc.WithBlock()toclientv3.Config.DialOptions.
- Add backoff on watch retries on transient errors.
- Add jitter to watch progress notify to prevent spikes in
etcd_network_client_grpc_sent_bytes_total. - Improve read index wait timeout warning log, which indicates that local node might have slow network.
- Improve slow request apply warning log.
- e.g.
read-only range request "key:\"/a\" range_end:\"/b\" " with result "range_response_count:3 size:96" took too long (97.966µs) to execute. - Redact request value field.
- Provide response size.
- e.g.
- Improve "became inactive" warning log, which indicates message send to a peer failed.
- 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.
- Make backend read transactions fully concurrent.
- Previously, ongoing long-running read transactions block writes and future reads.
- With this change, write throughput is increased by 70% and P99 write latency is reduced by 90% in the presence of long-running reads.
- Improve Raft Read Index timeout warning messages.
- 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.
etcd --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,
etcd --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,
etcd --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
etcd --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
etcd --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. - Furthermore, when
etcd --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.
- Update JWT methods to allow for use of any supported signature method/algorithm.
- Add Lease checkpointing to persist remaining TTLs to the consensus log periodically so that long lived leases progress toward expiry in the presence of leader elections and server restarts.
- Enabled by experimental flag "--experimental-enable-lease-checkpoint".
- Add gRPC interceptor for debugging logs; enable
etcd --debugflag to see per-request debug information. - Add consistency check in snapshot status. If consistency check on snapshot file fails,
snapshot statusreturns"snapshot file integrity check failed..."error. - Add
Verifyfunction to perform corruption check on WAL contents. - Improve heartbeat send failure logging.
- Support users with no password for reducing security risk introduced by leaked password. The users can only be authenticated with
CommonNamebased auth. - Add
etcd --experimental-peer-skip-client-san-verificationto skip verification of peer client address. - Add
etcd --experimental-compaction-batch-limitto sets the maximum revisions deleted in each compaction batch. - Reduced default compaction batch size from 10k revisions to 1k revisions to improve p99 latency during compactions and reduced wait between compactions from 100ms to 10ms.
Breaking Changes
- Rewrite client balancer with new gRPC balancer interface.
- Upgrade gRPC to v1.23.0.
- Improve client balancer failover against secure endpoints.
- Fix gRPC panic "send on closed channel.
- The new client balancer uses an asynchronous resolver to pass endpoints to the gRPC dial function. To block until the underlying connection is up, pass
grpc.WithBlock()toclientv3.Config.DialOptions.
- Require Go 1.12+.
- Migrate dependency management tool from
glideto Go module.- <= 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
- Deprecated
latestrelease container tag.docker pull gcr.io/etcd-development/etcd:latestwould not be up-to-date.
- Deprecated minor version release container tags.
docker pull gcr.io/etcd-development/etcd:v3.3would still work.docker pull gcr.io/etcd-development/etcd:v3.4would not work.- Use
docker pull gcr.io/etcd-development/etcd:v3.4.xinstead, with the exact patch version.
- Deprecated ACIs from official release.
- AppC was officially suspended, as of late 2016.
acbuildis not maintained anymore.*.acifiles are not available fromv3.4release.
- Move
"github.com/coreos/etcd"to"github.com/etcd-io/etcd".- Change import path to
"go.etcd.io/etcd". - e.g.
import "go.etcd.io/etcd/raft".
- Change import path to
- Make
ETCDCTL_API=3 etcdctldefault.- Now,
etcdctl set foo barmust beETCDCTL_API=2 etcdctl set foo bar. - Now,
ETCDCTL_API=3 etcdctl put foo barcould be justetcdctl put foo bar.
- Now,
- Make
etcd --enable-v2=falsedefault. - Make
embed.DefaultEnableV2falsedefault. - Deprecated
etcd --ca-fileflag. Useetcd --trusted-ca-fileinstead (etcd --ca-fileflag has been marked deprecated since v2.1). - Deprecated
etcd --peer-ca-fileflag. Useetcd --peer-trusted-ca-fileinstead (etcd --peer-ca-fileflag has been marked deprecated since v2.1). - Deprecated
pkg/transport.TLSInfo.CAFilefield. Usepkg/transport.TLSInfo.TrustedCAFileinstead (CAFilefield has been marked deprecated since v2.1). - 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. - Deprecating
etcd_debugging_mvcc_db_total_size_in_bytesPrometheus metric (to be removed in v3.5). Useetcd_mvcc_db_total_size_in_bytesinstead. - Deprecating
etcd_debugging_mvcc_put_totalPrometheus metric (to be removed in v3.5). Useetcd_mvcc_put_totalinstead. - Deprecating
etcd_debugging_mvcc_delete_totalPrometheus metric (to be removed in v3.5). Useetcd_mvcc_delete_totalinstead. - Deprecating
etcd_debugging_mvcc_range_totalPrometheus metric (to be removed in v3.5). Useetcd_mvcc_range_totalinstead. - Deprecating
etcd_debugging_mvcc_txn_totalPrometheus metric (to be removed in v3.5). Useetcd_mvcc_txn_totalinstead. - 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. - Deprecated
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-outputtoetcd --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
etcd --log-outputsaccepts multiple writers, etcd configuration YAML filelog-outputsfield must be changed to[]stringtype. - Previously,
etcd --config-file etcd.config.yamlcan havelog-outputs: defaultfield, now must belog-outputs: [default].
- Now that
- Deprecating
etcd --debugflag. Useetcd --log-level=debugflag instead.- v3.5 will deprecate
etcd --debugflag in favor ofetcd --log-level=debug.
- v3.5 will deprecate
- 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
- Deprecated
grpc.ErrClientConnClosing.clientv3andproxy/grpcproxynow does not returngrpc.ErrClientConnClosing.grpc.ErrClientConnClosinghas been deprecated in gRPC >= 1.10.- Use
clientv3.IsConnCanceled(error)orgoogle.golang.org/grpc/status.FromError(error)instead.
- Deprecated 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. - Move internal packages to
etcdserver."github.com/coreos/etcd/alarm"to"go.etcd.io/etcd/etcdserver/api/v3alarm"."github.com/coreos/etcd/compactor"to"go.etcd.io/etcd/etcdserver/api/v3compactor"."github.com/coreos/etcd/discovery"to"go.etcd.io/etcd/etcdserver/api/v2discovery"."github.com/coreos/etcd/etcdserver/auth"to"go.etcd.io/etcd/etcdserver/api/v2auth"."github.com/coreos/etcd/etcdserver/membership"to"go.etcd.io/etcd/etcdserver/api/membership"."github.com/coreos/etcd/etcdserver/stats"to"go.etcd.io/etcd/etcdserver/api/v2stats"."github.com/coreos/etcd/error"to"go.etcd.io/etcd/etcdserver/api/v2error"."github.com/coreos/etcd/rafthttp"to"go.etcd.io/etcd/etcdserver/api/rafthttp"."github.com/coreos/etcd/snap"to"go.etcd.io/etcd/etcdserver/api/snap"."github.com/coreos/etcd/store"to"go.etcd.io/etcd/etcdserver/api/v2store".
- Change snapshot file permissions: On Linux, the snapshot file changes from readable by all (mode 0644) to readable by the user only (mode 0600).
- Change
pkg/adt.IntervalTreefromstructtointerface.- See
pkg/adtREADME andpkg/adtgodoc.
- See
- Release branch
/versiondefines version3.4.x-pre, instead of3.4.y+git.- Use
3.4.5-pre, instead of3.4.4+git.
- Use
Dependency
- Upgrade
github.com/coreos/bboltfromv1.3.1-coreos.6togo.etcd.io/bboltv1.3.3. - Upgrade
google.golang.org/grpcfromv1.7.5tov1.23.0. - Migrate
github.com/ugorji/go/codectogithub.com/json-iterator/go, to regenerate v2client(See #10667 for more). - Migrate
github.com/ghodss/yamltosigs.k8s.io/yaml(See #10687 for more). - Upgrade
golang.org/x/cryptofromcrypto@9419663f5tocrypto@0709b304e793. - Upgrade
golang.org/x/netfromnet@66aacef3dtonet@adae6a3d119a. - Upgrade
golang.org/x/sysfromsys@ebfc5b463tosys@c7b8b68b1456. - Upgrade
golang.org/x/textfromtext@b19bf474dtov0.3.0. - Upgrade
golang.org/x/timefromtime@c06e80d93totime@fbb02b229. - Upgrade
github.com/golang/protobuffromgolang/protobuf@1e59b77b5tov1.3.2. - Upgrade
gopkg.in/yaml.v2fromyaml@cd8b52f82toyaml@5420a8b67. - Upgrade
github.com/dgrijalva/jwt-gofromv3.0.0tov3.2.0. - Upgrade
github.com/soheilhy/cmuxfromv0.1.3tov0.1.4. - Upgrade
github.com/google/btreefromgoogle/btree@925471ac9tov1.0.0. - Upgrade
github.com/spf13/cobrafromspf13/cobra@1c44ec8d3tov0.0.3. - Upgrade
github.com/spf13/pflagfromv1.0.0tospf13/pflag@1ce0cc6db. - Upgrade
github.com/coreos/go-systemdfromv15tov17. - Upgrade
github.com/prometheus/client_golangfromprometheus/client_golang@5cec1d042tov1.0.0. - Upgrade
github.com/grpc-ecosystem/go-grpc-prometheusfromgrpc-ecosystem/go-grpc-prometheus@0dafe0d49tov1.2.0. - Upgrade
github.com/grpc-ecosystem/grpc-gatewayfromv1.3.1tov1.4.1. - Migrate
github.com/kr/ptytogithub.com/creack/pty, as the later has replaced the original module. - Upgrade
github.com/gogo/protobuffromv1.0.0tov1.2.1.
Metrics, Monitoring
See List of metrics for all metrics per release.
Note that any etcd_debugging_* metrics are experimental and subject to change.
- Add
etcd_snap_db_fsync_duration_seconds_countPrometheus metric. - Add
etcd_snap_db_save_total_duration_seconds_bucketPrometheus metric. - Add
etcd_network_snapshot_send_successPrometheus metric. - Add
etcd_network_snapshot_send_failuresPrometheus metric. - Add
etcd_network_snapshot_send_total_duration_secondsPrometheus metric. - Add
etcd_network_snapshot_receive_successPrometheus metric. - Add
etcd_network_snapshot_receive_failuresPrometheus metric. - Add
etcd_network_snapshot_receive_total_duration_secondsPrometheus metric. - Add
etcd_network_active_peersPrometheus metric.- Let's say
"7339c4e5e833c029"server/metricsreturnsetcd_network_active_peers{Local="7339c4e5e833c029",Remote="729934363faa4a24"} 1andetcd_network_active_peers{Local="7339c4e5e833c029",Remote="b548c2511513015"} 1. This indicates that the local node"7339c4e5e833c029"currently has two active remote peers"729934363faa4a24"and"b548c2511513015"in a 3-node cluster. If the node"b548c2511513015"is down, the local node"7339c4e5e833c029"will showetcd_network_active_peers{Local="7339c4e5e833c029",Remote="729934363faa4a24"} 1andetcd_network_active_peers{Local="7339c4e5e833c029",Remote="b548c2511513015"} 0.
- Let's say
- Add
etcd_network_disconnected_peers_totalPrometheus metric.- If a remote peer
"b548c2511513015"is down, the local node"7339c4e5e833c029"server/metricswould returnetcd_network_disconnected_peers_total{Local="7339c4e5e833c029",Remote="b548c2511513015"} 1, while active peer metrics will showetcd_network_active_peers{Local="7339c4e5e833c029",Remote="729934363faa4a24"} 1andetcd_network_active_peers{Local="7339c4e5e833c029",Remote="b548c2511513015"} 0.
- If a remote peer
- Add
etcd_network_server_stream_failures_totalPrometheus metric.- e.g.
etcd_network_server_stream_failures_total{API="lease-keepalive",Type="receive"} 1 - e.g.
etcd_network_server_stream_failures_total{API="watch",Type="receive"} 1
- e.g.
- Improve
etcd_network_peer_round_trip_time_secondsPrometheus metric to track leader heartbeats.- Previously, it only samples the TCP connection for snapshot messages.
- Increase
etcd_network_peer_round_trip_time_secondsPrometheus metric histogram upper-bound.- Previously, highest bucket only collects requests taking 0.8192 seconds or more.
- Now, highest buckets collect 0.8192 seconds, 1.6384 seconds, and 3.2768 seconds or more.
- Add
etcd_server_is_leaderPrometheus metric. - Add
etcd_server_idPrometheus metric. - Add
etcd_cluster_versionPrometheus metric. - Add
etcd_server_versionPrometheus metric.- To replace Kubernetes
etcd-version-monitor.
- To replace Kubernetes
- Add
etcd_server_go_versionPrometheus metric. - Add
etcd_server_health_successPrometheus metric. - Add
etcd_server_health_failuresPrometheus metric. - Add
etcd_server_read_indexes_failed_totalPrometheus metric. - Add
etcd_server_heartbeat_send_failures_totalPrometheus metric. - Add
etcd_server_slow_apply_totalPrometheus metric. - Add
etcd_server_slow_read_indexes_totalPrometheus metric. - Add
etcd_server_quota_backend_bytesPrometheus metric.- Use it with
etcd_mvcc_db_total_size_in_bytesandetcd_mvcc_db_total_size_in_use_in_bytes. etcd_server_quota_backend_bytes 2.147483648e+09means current quota size is 2 GB.etcd_mvcc_db_total_size_in_bytes 20480means current physically allocated DB size is 20 KB.etcd_mvcc_db_total_size_in_use_in_bytes 16384means future DB size if defragment operation is complete.etcd_mvcc_db_total_size_in_bytes - etcd_mvcc_db_total_size_in_use_in_bytesis the number of bytes that can be saved on disk with defragment operation.
- Use it with
- Add
etcd_mvcc_db_total_size_in_use_in_bytesPrometheus metric.- Use it with
etcd_mvcc_db_total_size_in_bytesandetcd_mvcc_db_total_size_in_use_in_bytes. etcd_server_quota_backend_bytes 2.147483648e+09means current quota size is 2 GB.etcd_mvcc_db_total_size_in_bytes 20480means current physically allocated DB size is 20 KB.etcd_mvcc_db_total_size_in_use_in_bytes 16384means future DB size if defragment operation is complete.etcd_mvcc_db_total_size_in_bytes - etcd_mvcc_db_total_size_in_use_in_bytesis the number of bytes that can be saved on disk with defragment operation.
- Use it with
- Add
etcd_mvcc_db_open_read_transactionsPrometheus metric. - Add
etcd_snap_fsync_duration_secondsPrometheus metric. - Add
etcd_disk_backend_defrag_duration_secondsPrometheus metric. - Add
etcd_mvcc_hash_duration_secondsPrometheus metric. - Add
etcd_mvcc_hash_rev_duration_secondsPrometheus metric. - Add
etcd_debugging_disk_backend_commit_rebalance_duration_secondsPrometheus metric. - Add
etcd_debugging_disk_backend_commit_spill_duration_secondsPrometheus metric. - Add
etcd_debugging_disk_backend_commit_write_duration_secondsPrometheus metric. - Add
etcd_debugging_lease_granted_totalPrometheus metric. - Add
etcd_debugging_lease_revoked_totalPrometheus metric. - Add
etcd_debugging_lease_renewed_totalPrometheus metric. - Add
etcd_debugging_lease_ttl_totalPrometheus metric. - Add
etcd_network_snapshot_send_inflights_totalPrometheus metric. - Add
etcd_network_snapshot_receive_inflights_totalPrometheus metric. - Add
etcd_server_snapshot_apply_in_progress_totalPrometheus metric. - Add
etcd_server_is_learnerPrometheus metric. - Add
etcd_server_learner_promote_failuresPrometheus metric. - Add
etcd_server_learner_promote_successesPrometheus metric. - Increase
etcd_debugging_mvcc_index_compaction_pause_duration_millisecondsPrometheus metric histogram upper-bound.- Previously, highest bucket only collects requests taking 1.024 seconds or more.
- Now, highest buckets collect 1.024 seconds, 2.048 seconds, and 4.096 seconds or more.
- Fix missing
etcd_network_peer_sent_failures_totalPrometheus metric count. - Fix
etcd_debugging_server_lease_expired_totalPrometheus metric. - Fix race conditions in v2 server stat collecting.
- Change gRPC proxy to expose etcd server endpoint /metrics.
- The metrics that were exposed via the proxy were not etcd server members but instead the proxy itself.
- Fix bug where db_compaction_total_duration_milliseconds metric incorrectly measured duration as 0.
- Deprecating
etcd_debugging_mvcc_db_total_size_in_bytesPrometheus metric (to be removed in v3.5). Useetcd_mvcc_db_total_size_in_bytesinstead. - Deprecating
etcd_debugging_mvcc_put_totalPrometheus metric (to be removed in v3.5). Useetcd_mvcc_put_totalinstead. - Deprecating
etcd_debugging_mvcc_delete_totalPrometheus metric (to be removed in v3.5). Useetcd_mvcc_delete_totalinstead. - Deprecating
etcd_debugging_mvcc_range_totalPrometheus metric (to be removed in v3.5). Useetcd_mvcc_range_totalinstead. - Deprecating
etcd_debugging_mvcc_txn_totalPrometheus metric (to be removed in v3.5). Useetcd_mvcc_txn_totalinstead.
Security, Authentication
See security doc for more details.
- Support TLS cipher suite whitelisting.
- To block weak cipher suites.
- TLS handshake fails when client hello is requested with invalid cipher suites.
- Add
etcd --cipher-suitesflag. - If empty, Go auto-populates the list.
- 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
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
rpctypes.ErrLeaderChanged.- Now linearizable requests with read index would fail fast when there is a leadership change, instead of waiting until context timeout.
- Add
etcd --initial-election-tick-advanceflag to configure initial election tick fast-forward.- By default,
etcd --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
etcd --initial-election-tick-advance=false. - Disabling this would slow down initial bootstrap process for cross datacenter deployments. Make tradeoffs by configuring
etcd --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
etcd --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.
etcd --pre-vote=falseby default.- v3.5 will enable
etcd --pre-vote=trueby default.
- Add
etcd --experimental-compaction-batch-limitto sets the maximum revisions deleted in each compaction batch. - Reduced default compaction batch size from 10k revisions to 1k revisions to improve p99 latency during compactions and reduced wait between compactions from 100ms to 10ms.
- Add
etcd --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
etcd --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 TLS cipher suite whitelisting.
- To block weak cipher suites.
- TLS handshake fails when client hello is requested with invalid cipher suites.
- Add
etcd --cipher-suitesflag. - If empty, Go auto-populates the list.
- Support
etcd --corsin v3 HTTP requests (gRPC gateway). - Rename
etcd --log-outputtoetcd --log-outputsto support multiple log outputs.etcd --log-outputwill be deprecated in v3.5.
- Add
etcd --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 whenetcd --logger=zap.- Use
etcd --logger=zap --log-outputs=stderrinstead. - 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.
- 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.
- Add
etcd --log-levelflag to support log level.- v3.5 will deprecate
etcd --debugflag in favor ofetcd --log-level=debug.
- v3.5 will deprecate
- Add
etcd --backend-batch-limitflag. - Add
etcd --backend-batch-intervalflag. - 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
mvccserver panic from restore operation.- Let's assume that a watcher had been requested with a future revision X and sent to node A that became network-partitioned thereafter. Meanwhile, cluster makes progress. Then when the partition gets removed, the leader sends a snapshot to node A. Previously if the snapshot's latest revision is still lower than the watch revision X, etcd server panicked during snapshot restore operation.
- Now, this server-side panic has been fixed.
- 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!
- Fix expired lease revoke.
- Enable etcd server
raft.Config.CheckQuorumwhen starting withForceNewCluster. - Allow non-WAL files in
etcd --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
- Fix
ETCD_CONFIG_FILEenv variable parsing inetcd. - Fix race condition in
rafthttptransport pause/resume. - Fix server crash from creating an empty role.
- Previously, creating a role with an empty name crashed etcd server with an error code
Unavailable. - Now, creating a role with an empty name is not allowed with an error code
InvalidArgument.
- Previously, creating a role with an empty name crashed etcd server with an error code
API
- Add
isLearnerfield toetcdserverpb.Member,etcdserverpb.MemberAddRequestandetcdserverpb.StatusResponseas part of raft learner implementation. - Add
MemberPromoterpc toetcdserverpb.Clusterinterface and the correspondingMemberPromoteRequestandMemberPromoteResponseas part of raft learner implementation. - 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 exceedsetcd --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. - Useful when client-side has limited bandwidths.
- For example, watch response contains 10 events, where each event is 1 MiB. And server
etcd --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
etcd --max-recv-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. - Add
WatchRequest.WatchProgressRequest.- To manually trigger broadcasting watch progress event (empty watch response with latest header) to all associated watch streams.
- Think of it as
WithProgressNotifythat can be triggered manually.
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.CipherSuitesto specify a list of supported cipher suites for TLS handshake between client/server and peers.- If empty, Go auto-populates the list.
- Both
embed.Config.ClientTLSInfo.CipherSuitesandembed.Config.CipherSuitescannot be non-empty at the same time. - If not empty, specify either
embed.Config.ClientTLSInfo.CipherSuitesorembed.Config.CipherSuites.
- 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. - Add
embed.Config.LogLevel. - 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. - Add
embed.Config.BackendBatchLimitfield. - Add
embed.Config.BackendBatchIntervalfield. - Make
embed.DefaultEnableV2falsedefault.
Package pkg/adt
- Change
pkg/adt.IntervalTreefromstructtointerface.- See
pkg/adtREADME andpkg/adtgodoc.
- See
- Improve
pkg/adt.IntervalTreetest coverage.- See
pkg/adtREADME andpkg/adtgodoc.
- See
- Fix Red-Black tree to maintain black-height property.
- Previously, delete operation violates black-height property.
Package integration
- Add
CLUSTER_DEBUGto enable test cluster logging.- Deprecated
capnslogin integration tests.
- Deprecated
client v3
- Add
MemberAddAsLearnertoClientv3.Clusterinterface. This API is used to add a learner member to etcd cluster. - Add
MemberPromotetoClientv3.Clusterinterface. This API is used to promote a learner member in etcd cluster. - Client may receive
rpctypes.ErrLeaderChangedfrom server.- Now linearizable requests with read index would fail fast when there is a leadership change, instead of waiting until context timeout.
- Add
WithFragmentOpOptionto support watch events fragmentation when the total size of events exceedsetcd --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. - Useful when client-side has limited bandwidths.
- For example, watch response contains 10 events, where each event is 1 MiB. And server
etcd --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
etcd --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 (...)".
- Add
Watcher.RequestProgressmethod.- To manually trigger broadcasting watch progress event (empty watch response with latest header) to all associated watch streams.
- Think of it as
WithProgressNotifythat can be triggered manually.
- Fix lease keepalive interval updates when response queue is full.
- If
<-chan *clientv3LeaseKeepAliveResponsefromclientv3.Lease.KeepAlivewas never consumed or channel is full, client was sending keepalive request every 500ms instead of expected rate of every "TTL / 3" duration.
- If
- Change snapshot file permissions: On Linux, the snapshot file changes from readable by all (mode 0644) to readable by the user only (mode 0600).
- Client may choose to send keepalive pings to server using
PermitWithoutStream.- By setting
PermitWithoutStreamto true, client can send keepalive pings to server without any active streams(RPCs). In other words, it allows sending keepalive pings with unary or simple RPC calls. PermitWithoutStreamis set to false by default.
- By setting
- Fix logic on release lock key if cancelled in
clientv3/concurrencypackage. - Fix
(*Client).Endpoints()method race condition. - Deprecated
grpc.ErrClientConnClosing.clientv3andproxy/grpcproxynow does not returngrpc.ErrClientConnClosing.grpc.ErrClientConnClosinghas been deprecated in gRPC >= 1.10.- Use
clientv3.IsConnCanceled(error)orgoogle.golang.org/grpc/status.FromError(error)instead.
etcdctl v3
- Make
ETCDCTL_API=3 etcdctldefault.- Now,
etcdctl set foo barmust beETCDCTL_API=2 etcdctl set foo bar. - Now,
ETCDCTL_API=3 etcdctl put foo barcould be justetcdctl put foo bar.
- Now,
- Add
etcdctl member add --learnerandetcdctl member promoteto add and promote raft learner member in etcd cluster. - Add
etcdctl --passwordflag.- To support
:character in user name. - e.g.
etcdctl --user user --password password get foo
- To support
- Add
etcdctl user add --new-user-passwordflag. - Add
etcdctl check datascalecommand. - Add
etcdctl check datascale --auto-compact, --auto-defragflags. - Add
etcdctl check perf --auto-compact, --auto-defragflags. - Add
etcdctl defrag --clusterflag. - Add "raft applied index" field to
endpoint status. - Add "errors" field to
endpoint status. - Add
etcdctl endpoint health --write-outsupport. - Add missing newline in
etcdctl endpoint health. - Fix
etcdctl watch [key] [range_end] -- [exec-command…]parsing.- Previously,
ETCDCTL_API=3 etcdctl watch foo -- echo watch event receivedpanicked.
- Previously,
- Fix
etcdctl move-leadercommand for TLS-enabled endpoints. - Add
progresscommand toetcdctl watch --interactive.- To manually trigger broadcasting watch progress event (empty watch response with latest header) to all associated watch streams.
- Think of it as
WithProgressNotifythat can be triggered manually.
- Add timeout to
etcdctl snapshot save.- User can specify timeout of
etcdctl snapshot savecommand using flag--command-timeout. - Fix etcdctl to strip out insecure endpoints from DNS SRV records when using discovery
- User can specify timeout of
gRPC proxy
- Fix etcd server panic from restore operation.
- Let's assume that a watcher had been requested with a future revision X and sent to node A that became network-partitioned thereafter. Meanwhile, cluster makes progress. Then when the partition gets removed, the leader sends a snapshot to node A. Previously if the snapshot's latest revision is still lower than the watch revision X, etcd server panicked during snapshot restore operation.
- Especially, gRPC proxy was affected, since it detects a leader loss with a key
"proxy-namespace__lostleader"and a watch revision"int64(math.MaxInt64 - 2)". - Now, this server-side panic has been fixed.
- Fix memory leak in cache layer.
- Change gRPC proxy to expose etcd server endpoint /metrics.
- The metrics that were exposed via the proxy were not etcd server members but instead the proxy itself.
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 heartbeat send.
- Previously record
- Fix missing learner nodes on
(n *node) ApplyConfChange. - Add
raft.Config.MaxUncommittedEntriesSizeto limit the total size of the uncommitted entries in bytes.- Once exceeded, raft returns
raft.ErrProposalDroppederror. - Prevent unbounded Raft log growth.
- There was a bug in PR#10167 but fixed via PR#10199.
- Once exceeded, raft returns
- Add
raft.Ready.CommittedEntriespagination usingraft.Config.MaxSizePerMsg.- This prevents out-of-memory errors if the raft log has become very large and commits all at once.
- Fix correctness bug in CommittedEntries pagination.
- Optimize message send flow control.
- Leader now sends more append entries if it has more non-empty entries to send after updating flow control information.
- Now, Raft allows multiple in-flight append messages.
- Optimize memory allocation when boxing slice in
maybeCommit.- By boxing a heap-allocated slice header instead of the slice header on the stack, we can avoid an allocation when passing through the sort.Interface interface.
- Avoid memory allocation in Raft entry
Stringmethod. - Avoid multiple memory allocations when merging stable and unstable log.
- Extract progress tracking into own component.
- Add package
raft/tracker. - Optimize string representation of
Progress.
- Add package
- Make relationship between
nodeandRawNodeexplicit. - Prevent learners from becoming leader.
- Add package
raft/quorumto reason about committed indexes as well as vote outcomes for both majority and joint quorums. - Use membership sets in progress tracking.
- Implement joint quorum computation.
- Refactor
raft/node.goto centralize configuration change application. - Allow voter to become learner through snapshot.
- Add package
raft/confchangeto internally support joint consensus. - Use
RawNodefor node's event loop. - Add
RawNode.Bootstrapmethod. - Add
raftpb.ConfChangeV2to use joint quorums.raftpb.ConfChangecontinues to work as today: it allows carrying out a single configuration change. Apb.ConfChangeproposal gets added to the Raft log as such and is thus also observed by the app during Ready handling, and fed back to ApplyConfChange.raftpb.ConfChangeV2allows joint configuration changes but will continue to carry out configuration changes in "one phase" (i.e. without ever entering a joint config) when this is possible.raftpb.ConfChangeV2messages initiate configuration changes. They support both the simple "one at a time" membership change protocol and full Joint Consensus allowing for arbitrary changes in membership.
- Change
raftpb.ConfState.Nodestoraftpb.ConfState.Voters. - Allow learners to vote, but still learners do not count in quorum.
- necessary in the situation in which a learner has been promoted (i.e. is now a voter) but has not learned about this yet.
- Fix restoring joint consensus.
- Visit
Progressin stable order. - Proactively probe newly added followers.
- The general expectation in
tracker.Progress.Next == c.LastIndexis that the follower has no log at all (and will thus likely need a snapshot), though the app may have applied a snapshot out of band before adding the replica (thus making the first index the better choice). - Previously, when the leader applied a new configuration that added voters, it would not immediately probe these voters, delaying when they would be caught up.
- The general expectation in
Package wal
- Add
Verifyfunction to perform corruption check on WAL contents. - Fix
waldirectory cleanup on creation failures.
Tooling
- Add
etcd-dump-logs --entry-typeflag to support WAL log filtering by entry type. - Add
etcd-dump-logs --stream-decoderflag to support custom decoder. - Add
SHA256SUMSfile to release assets.- etcd maintainers are a distributed team, this change allows for releases to be cut and validation provided without requiring a signing key.
Go
Dockerfile
- Rebase etcd image from Alpine to Debian to improve security and maintenance effort for etcd release.