etcd 0.3.0 - Improved Cluster Discovery, API Enhancements and Windows Support

February 7, 2014 · By Brandon Philips

We're excited to release version 0.3.0 of etcd, a highly-available key value store for shared configuration and service discovery. Read on to learn about the changes in this release or hop over to GitHub to download the latest binaries.

New Features

Discovery API

The Discovery API automates the process of bootstrapping a cluster. In previous releases, a human had to pick a leader, pass a list of -peers to all of the followers and maintain that list going forward. The Discovery API takes a unique token as an input and fetches a list of peers that have already been registered with that token. If no peers have ever existed, the first peer to use that token will assume leadership of the cluster. Stale peers will be cleaned up automatically to allow you to use the same token as machines come and go.

Use the publicly-available discovery service at, or run your own. All of the information you need is available in the Discovery API docs.

Other API Additions

This release does not break the existing v2 API but it does add two new features:

  • CompareAndDelete: etcd has let you create and update keys atomically but this release introduces atomic deletes too. This means that you can delete a key only if certain prerequisites like its index or value are correct.

  • prevNode: write requests will now return a prevNode field next to the existing node field. This entry represents the state of this key before the write was made and is useful for many uses like using a key as a simple atomic queue without a GET and PUT.

Improved Logging

We added an event-based logging system to get details about leader elections and cluster changes out of the core consensus system of etcd. This gives admins more clear and helpful information about the cluster state via log files.

go get and Windows Support

We recently moved to using goven for dependency management in etcd which means a few things:

  • go get works and is a fast way to grab master
  • Go cross compilation works and etcd now has official Windows builds

Changes to Functionality

Goodbye info File

The info file was removed and is no longer used. This file was a cache of command line arguments and was causing a lot of confusion and bug reports. If you have an info file in your etcd data directory you can safely remove it.

Snapshots by Default

etcd uses a replicated log that is managed by the Raft consensus protocol. During normal usage, every write causes an entry to be appended to the log. In previous releases, the entire log was stored in memory, which caused memory usage to grow over the life of the cluster.

In this release we enabled -snapshot=true by default. This means that periodically etcd will flush older logs from memory to reduce resource usage.

Minor Fixes and Improvements

Bug Fixes

  • Improvements to the goraft locking code and leader step down code
  • Fixes to the internal watch datastructures and locks