Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In 0.8, each partition can have multiple replicas. These replicas are distributed across different brokers for better availability. At any given instance of time, only one of these replicas will serve reads and writes. In other words, one replica acts as the leader. When a broker needs to be shutdown (A broker can be shutdown for doing a new release, changing config etc), it would be useful to still serve the requests for the partitions on this broker using the other in-sync replicas. This is what the Controlled shutdown tool helps you to achieve. It transfers the leadership of the partitions from the broker (to be shutdown) to the other available replicas(in the in-sync set) on the remaining brokers.

Basically, it reduces the unavailable window. If we simply shutdown a broker without running the tool first, partitions with leader on the broker are not available until the new leaders are elected. Since we currently elect leaders sequentially one partition at a time and each leader election involves reads/writes to ZK, it may take some time for all leaders to be elected, especially when there are many partitions. Running the controlled shutdown tool allows us to move the leader proactively one at a time and thus reduce the unavailable window.

A summary of the steps that the tool does is shown below -

...