mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
25 KiB
25 KiB
Previous change logs can be found at CHANGELOG-3.4.
The minimum recommended etcd versions to run in production are 3.2.28+, 3.3.18+, and 3.4.2+.
v3.5.0 (2021-06)
See code changes and v3.5 upgrade guide for any breaking changes.
- v3.5.0 (2020 TBD), see code changes.
- v3.5.0-rc.1 (2020 TBD), see code changes.
- v3.5.0-rc.0 (2020 TBD), see code changes.
Again, before running upgrades from any previous release, please make sure to read change logs below and v3.5 upgrade guide.
Breaking Changes
go.etcd.io/etcdGo packages have moved togo.etcd.io/etcd/{api,pkg,raft,client,etcdctl,server,raft,tests}/v3to follow the Go modules conventionsgo.etcd.io/clientv3/snapshotSnapshotManager class have moved togo.etcd.io/clientv3/etcdctl. The methodsnapshot.Saveto download a snapshot from the remote server was preserved in 'go.etcd.io/clientv3/snapshot`.- `go.etcd.io/client' package got migrated to 'go.etcd.io/client/v2'.
- Changed behavior of clienv3 API MemberList.
- Previously, it is directly served with server's local data, which could be stale.
- Now, it is served with linearizable guarantee. If the server is disconnected from quorum,
MemberListcall will fail.
- gRPC gateway only supports
/v3endpoint.- Deprecated
/v3beta. curl -L http://localhost:2379/v3beta/kv/put -X POST -d '{"key": "Zm9v", "value": "YmFy"}'does work in v3.5. Usecurl -L http://localhost:2379/v3/kv/put -X POST -d '{"key": "Zm9v", "value": "YmFy"}'instead.
- Deprecated
etcd --experimental-enable-v2v3flag has been deprecated. Useetcd --enable-v2v3instead.- Change
etcd --experimental-enable-v2v3flag toetcd --enable-v2v3; v2 storage emulation is now stable.
- Change
etcd --experimental-backend-bbolt-freelist-typeflag has been deprecated. Useetcd --backend-bbolt-freelist-typeinstead. The default type is hashmap and it is stable now.etcd --debugflag has been deprecated. Useetcd --log-level=debuginstead.- Remove
embed.Config.Debug. etcd --log-outputflag has been deprecated. Useetcd --log-outputsinstead.etcd --logger=zap --log-outputs=stderris now the default.etcd --logger=capnslogflag value has been deprecated.etcd --logger=zap --log-outputs=defaultflag value is not supported..- Use
etcd --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.
- Use
etcd --log-outputs=stderris now the default.etcd --log-package-levelsflag forcapnsloghas been deprecated. Now,etcd --logger=zap --log-outputs=stderris the default.[CLIENT-URL]/config/local/logendpoint has been deprecated, as isetcd --log-package-levelsflag.curl http://127.0.0.1:2379/config/local/log -XPUT -d '{"Level":"DEBUG"}'won't work.- Please use
etcd --logger=zap --log-outputs=stderrinstead.
- Deprecated
etcd_debugging_mvcc_db_total_size_in_bytesPrometheus metric. Useetcd_mvcc_db_total_size_in_bytesinstead. - Deprecated
etcd_debugging_mvcc_put_totalPrometheus metric. Useetcd_mvcc_put_totalinstead. - Deprecated
etcd_debugging_mvcc_delete_totalPrometheus metric. Useetcd_mvcc_delete_totalinstead. - Deprecated
etcd_debugging_mvcc_txn_totalPrometheus metric. Useetcd_mvcc_txn_totalinstead. - Deprecated
etcd_debugging_mvcc_range_totalPrometheus metric. Useetcd_mvcc_range_totalinstead. - Master branch
/versionoutputs3.5.0-pre, instead of3.4.0+git. - Changed
proxypackage function signature to support structured logger.- Previously,
NewClusterProxy(c *clientv3.Client, advaddr string, prefix string) (pb.ClusterServer, <-chan struct{}), nowNewClusterProxy(lg *zap.Logger, c *clientv3.Client, advaddr string, prefix string) (pb.ClusterServer, <-chan struct{}). - Previously,
Register(c *clientv3.Client, prefix string, addr string, ttl int), nowRegister(lg *zap.Logger, c *clientv3.Client, prefix string, addr string, ttl int) <-chan struct{}. - Previously,
NewHandler(t *http.Transport, urlsFunc GetProxyURLs, failureWait time.Duration, refreshInterval time.Duration) http.Handler, nowNewHandler(lg *zap.Logger, t *http.Transport, urlsFunc GetProxyURLs, failureWait time.Duration, refreshInterval time.Duration) http.Handler.
- Previously,
- Changed
pkg/flagsfunction signature to support structured logger.- Previously,
SetFlagsFromEnv(prefix string, fs *flag.FlagSet) error, nowSetFlagsFromEnv(lg *zap.Logger, prefix string, fs *flag.FlagSet) error. - Previously,
SetPflagsFromEnv(prefix string, fs *pflag.FlagSet) error, nowSetPflagsFromEnv(lg *zap.Logger, prefix string, fs *pflag.FlagSet) error.
- Previously,
- ClientV3 supports grpc resolver API.
- Endpoints can be managed using endpoints.Manager
- Previously supported GRPCResolver was decomissioned. Use resolver instead.
- Turned on --pre-vote by default. Should prevent disrupting RAFT leader by an individual member.
- ETCD_CLIENT_DEBUG env: Now supports log levels (debug, info, warn, error, dpanic, panic, fatal). Only when set, overrides application-wide grpc logging settings.
- Embed Etcd.Close() needs to called exactly once and closes Etcd.Err() stream.
- Embed Etcd does not override global/grpc logger be default any longer. If desired, please call
embed.Config::SetupGlobalLoggers()explicitly. - Errors:
context cancelledorcontext deadline exceededare exposed as codes.Canceled, codes.DeadlineExceeded instead of 'codes.Unknown'.
Security
- Add
TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256andTLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256toetcd --cipher-suites. - Changed the format of WAL entries related to auth for not keeping password as a plain text.
- Add third party Security Audit Report.
- A log warning is added when etcd uses any existing directory that has a permission different than 700 on Linux and 777 on Windows.
Metrics, Monitoring
See List of metrics for all metrics per release.
Note that any etcd_debugging_* metrics are experimental and subject to change.
- Deprecated
etcd_debugging_mvcc_db_total_size_in_bytesPrometheus metric. Useetcd_mvcc_db_total_size_in_bytesinstead. - Deprecated
etcd_debugging_mvcc_put_totalPrometheus metric. Useetcd_mvcc_put_totalinstead. - Deprecated
etcd_debugging_mvcc_delete_totalPrometheus metric. Useetcd_mvcc_delete_totalinstead. - Deprecated
etcd_debugging_mvcc_txn_totalPrometheus metric. Useetcd_mvcc_txn_totalinstead. - Deprecated
etcd_debugging_mvcc_range_totalPrometheus metric. Useetcd_mvcc_range_totalinstead. - Add
etcd_debugging_mvcc_current_revisionPrometheus metric. - Add
etcd_debugging_mvcc_compact_revisionPrometheus metric. - Change
etcd_cluster_versionPrometheus metrics to include only major and minor version. - Add
etcd_debugging_mvcc_total_put_size_in_bytesPrometheus metric. - Add
etcd_server_client_requests_totalwith"type"and"client_api_version"labels. - Add
etcd_wal_write_bytes_total. - Add
etcd_debugging_auth_revision. - Add
os_fd_usedandos_fd_limitto monitor current OS file descriptors.
etcd server
etcd --enable-v2v3flag is now stable.etcd --experimental-enable-v2v3has been deprecated.- Added more v2v3 integration tests.
etcd --enable-v2=true --enable-v2v3=''by default, to enable v2 API server that is backed by v2 store.etcd --enable-v2=true --enable-v2v3=/aaato enable v2 API server that is backed by v3 storage.etcd --enable-v2=false --enable-v2v3=''to disable v2 API server.etcd --enable-v2=false --enable-v2v3=/aaato disable v2 API server. TODO: error?- Add
TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256andTLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256toetcd --cipher-suites. - Automatically create parent directory if it does not exist (fix issue#9609).
- v4.0 will configure
etcd --enable-v2=true --enable-v2v3=/aaato enable v2 API server that is backed by v3 storage.
- [
etcd --backend-bbolt-freelist-type] flag is now stable.etcd --experimental-backend-bbolt-freelist-typehas been deprecated.
- Support rollback/downgrade.
- Deprecate v2 apply on cluster version. Use v3 request to set cluster version and recover cluster version from v3 backend.
- Fix corruption bug in defrag.
- Fix quorum protection logic when promoting a learner.
- Improve peer corruption checker to work when peer mTLS is enabled.
- Log
[CLIENT-PORT]/healthcheck in server side. - Log successful etcd server-side health check in debug level.
- Improve compaction performance when latest index is greater than 1-million.
- Refactor consistentindex.
- Add log when etcdserver failed to apply command.
- Improve count-only range performance.
- Remove redundant storage restore operation to shorten the startup time.
- With 40 million key test data,it can shorten the startup time from 5 min to 2.5 min.
- 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.
- Add missing CRC checksum check in WAL validate method otherwise causes panic.
- See https://github.com/etcd-io/etcd/issues/11918.
- Improve logging around snapshot send and receive.
- Push down RangeOptions.limit argv into index tree to reduce memory overhead.
- Add reason field for /health response.
- Add exclude alarms from health check conditionally
- 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.FDUsagecall pattern to reduce objects malloc of Memory Usage and CPU Usage. - Improve mvcc.watchResponse channel Memory Usage.
- Log expensive request info in UnaryInterceptor.
- Fix invalid Go type in etcdserverpb.
- Improve healthcheck by using v3 range request and its corresponding timeout.
- Add
etcd --experimental-watch-progress-notify-intervalflag to make watch progress notify interval configurable. - Fix server panic in slow writes warnings.
- Fixed via PR#12238.
- Fix server panic when force-new-cluster flag is enabled in a cluster which had learner node.
- Add
--self-signed-cert-validityflag to support setting certificate expiration time.- Notice, certificates generated by etcd are valid for 1 year by default when specifying the auto-tls or peer-auto-tls option.
- Add
--experimental-warning-apply-durationflag which allows apply duration threshold to be configurable. - Add
--experimental-memory-mlock" flag which prevents etcd memory pages to be swapped out. - Add
--socket-reuse-portflag- Setting this flag enables
SO_REUSEPORTwhich allows rebind of a port already in use. User should take caution when using this flag to ensure flock is properly enforced.
- Setting this flag enables
- Add
--socket-reuse-addressflag- Setting this flag enables
SO_REUSEADDRwhich allows binding to an address inTIME_WAITstate, improving etcd restart time.
- Setting this flag enables
- Reduce around 30% memory allocation by logging range response size without marshal.
ETCD_VERIFY="all"enviroment triggers additional verification of consistency of etcd data-dir files.- Add
etcd --enable-log-rotationboolean flag which enables log rotation if true. - Add
etcd --log-rotation-config-jsonflag which allows passthrough of JSON config to configure log rotation for a file output target. - Add experimental distributed tracing boolean flag
--experimental-enable-distributed-tracingwhich enables tracing. - Add
--experimental-distributed-tracing-addressstring flag which allows configuring the OpenTelemetry collector address. - Add
--experimental-distributed-tracing-service-namestring flag which allows changing the default "etcd" service name. - Add
--experimental-distributed-tracing-instance-idstring flag which configures an instance ID, which must be unique per etcd instance.
Package runtime
Package embed
- Remove
embed.Config.Debug.- Use
embed.Config.LogLevelinstead.
- Use
- Add
embed.Config.ZapLoggerBuilderto allow creating a custom zap logger. - Replace global
*zap.Loggerwith etcd server logger object. - Add
embed.Config.EnableLogRotationwhich enables log rotation if true. - Add
embed.Config.LogRotationConfigJSONto allow passthrough of JSON config to configure log rotation for a file output target. - Add
embed.Config.ExperimentalEnableDistributedTracingwhich enables experimental distributed tracing if true. - Add
embed.Config.ExperimentalDistributedTracingAddresswhich allows overriding default collector address. - Add
embed.Config.ExperimentalDistributedTracingServiceNamewhich allows overriding default "etcd" service name. - Add
embed.Config.ExperimentalDistributedTracingServiceInstanceIDwhich allows configuring an instance ID, which must be uniquer per etcd instance.
Package clientv3
- Remove excessive watch cancel logging messages.
- Add
TryLockmethod toclientv3/concurrency/Mutex. A non-blocking method onMutexwhich does not wait to get lock on the Mutex, returns immediately if Mutex is locked by another session. - Fix client balancer failover against multiple endpoints.
- Fix IPv6 endpoint parsing in client.
- Fix errors caused by grpc changing balancer/resolver API. This change is compatible with grpc >= v1.26.0, but is not compatible with < v1.26.0 version.
- Use ServerName as the authority after bumping to grpc v1.26.0. Remove workaround in #11184.
- Fix
"hasleader"metadata embedding.- Previously,
clientv3.WithRequireLeader(ctx)was overwriting existing context keys.
- Previously,
- Fix watch leak caused by lazy cancellation. When clients cancel their watches, a cancel request will now be immediately sent to the server instead of waiting for the next watch event.
- Make sure save snapshot downloads checksum for integrity checks.
- Fix auth token invalid after watch reconnects. Get AuthToken automatically when clientConn is ready.
- Improve clientv3:get AuthToken gracefully without extra connection.
- Changed clientv3 dialing code to use grpc resolver API instead of custom balancer.
- Endpoints self identify now as
etcd-endpoints://{id}/#initially={list of endpoints}e.g.etcd-endpoints://0xc0009d8540/#initially=[localhost:2079]
- Endpoints self identify now as
Package lease
- Fix memory leak in follower nodes.
- Make sure grant/revoke won't be applied repeatedly after restarting etcd.
Package wal
- Add
etcd_wal_write_bytes_total. - Handle out-of-range slice bound in
ReadAlland entry limit indecodeRecord.
etcdctl v3
- Fix
etcdctl member addcommand to prevent potential timeout. (PR#11194 and PR#11638) - Add
etcdctl watch --progress-notifyflag. - Add
etcdctl auth statuscommand to check if authentication is enabled - Add
etcdctl get --count-onlyflag for output typefields. - Add
etcdctl member list -w=json --hexflag to print memberListResponse in hex format json. - Changed
etcdctl lock <lockname> exec-commandto return exit code of exec-command.
gRPC gateway
- gRPC gateway only supports
/v3endpoint.- Deprecated
/v3beta. curl -L http://localhost:2379/v3beta/kv/put -X POST -d '{"key": "Zm9v", "value": "YmFy"}'does work in v3.5. Usecurl -L http://localhost:2379/v3/kv/put -X POST -d '{"key": "Zm9v", "value": "YmFy"}'instead.
- Deprecated
gRPC Proxy
- Fix
panic on errorfor metrics handler. - Add gRPC keepalive related flags
grpc-keepalive-min-time,grpc-keepalive-intervalandgrpc-keepalive-timeout. - Fix grpc watch proxy hangs when failed to cancel a watcher .
- Add metrics handler for grpcproxy self.
- Add health handler for grpcproxy self.
Auth
- Fix NoPassword check when adding user through GRPC gateway (issue#11414)
- Fix bug where some auth related messages are logged at wrong level
- Fix a data corruption bug by saving consistent index.
- Improve checkPassword performance.
- Add authRevision field in AuthStatus.
API
- Add
/v3/auth/statusendpoint to check if authentication is enabled - Add
Linearizablefield toetcdserverpb.MemberListRequest. - Learner support Snapshot RPC.
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
Dependency
- Upgrade
google.golang.org/grpcfromv1.23.0tov1.26.0. - Upgrade
go.uber.org/zapfromv1.14.1tov1.15.0.
Release
Go
- Require Go 1.16+.
- Compile with Go 1.16
- etcd uses go modules (instead of vendor dir) to track dependencies.
Project Governance
- The etcd team has added, a well defined and openly discussed, project governance.