Versions Compared

Key

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

...

As mentioned earlier, brokers which are fenced will not appear in MetadataResponses.  So clients that have up-to-date metadata will not try to contact fenced brokers.  However, clients that have slightly older metadata may attempt to contact them.  The broker will not respond to these requests-- instead, it will simply disconnect.  (There are a few exceptions.  One is that the broker will respond to fetch requests from other brokers.)

Broker leases are time-bounded.  The amount of time they last is specified by the controller in its response.  Once the period has elapsed, if the broker has not renewed its lease via a heartbeat, it will be fenced.

...

In the post-KIP-500 world, controller shutdown is handled by the broker heartbeat system instead.  In its periodic heartbeats, the broker asks the controller if it can transition into the SHUTDOWN state.  This motivates the controller to move all of the leaders off of that broker.  Once they are all moved, the controller responds to the heartbeat with a nextState of SHUTDOWN.

The Broker State Machine

...

NOT_RUNNING

This is the state that the broker is in before it has started up.  When the broker starts up, it transitions to STARTING.

STARTING

While the broker is in this state, it is trying to catch up with the latest metadata.  It fetches the metadata from the controller quorum. Once it has finished catching up, it transitions to the RECOVERY state.

RECOVERY

The broker is in this state while it is starting the log manager.  If the shutdown was clean, the broker will leave this state very quickly.  If the shutdown was unclean, the broker will stay in this state until log recovery is complete.

Once log recovery is done, the broker will start listening on the socket server.  It will then ask the controller to unfence it.  Once the controller agrees, it will transition to the RUNNING state.

RUNNING

The broker is in this state when it's up and running.

PENDING_CONTROLLED_SHUTDOWN

The broker is in this state when it has received a SIGTERM and is trying to shut down.

SHUTTING_DOWN

The broker is in this state when controlled shutdown has finished and it is shutting down.

Changes in the Broker State Machine

The numeric constants exposed through the metrics API have not changed, and there are no new or removed states.

The main change in the broker state machine is that the RECOVERING_FROM_UNCLEAN_SHUTDOWN state has been renamed to RECOVERY.  Also, unlike previously, the broker will always pass through RECOVERY (although it may only stay in this state for a very short amount of time).

Public Interfaces

meta.properties

...