...
For correctness reasons, the controller shall allow processing of only one inflight
ApiKeys.UPDATE_FEATURES
API call at any given time.Prior to mutating
'/features'
in ZK, the implementation verifies that all broker advertisements (as seen by it thus far) contained no incompatibilities with the providedList<FeatureUpdate>
(see Validations section below).Note that feature version deletions (using a version level < 1) can be used in circumstances where a finalized feature needs to be garbage collected. This type mutates '/features' in ZK without any guarding checks on feature versions.
Once validations in #2 are successful, the
List<FeatureUpdate>
are applied to contents of'/features'
ZK node. Upon successful write, ZK should automatically increment the version of the node by 1.Finally, an
UpdateFeatureResponse
is returned to the user.
...
Each
FeatureUpdate
provided in the request was valid, and all updates were persisted to the'/features'
ZK node by the controller (along with a bump to the ZK node version).- Brokers in the cluster have gradually started receiving notifications (via ZK watches) on the changes to '/features' ZK node. They react by reading the latest contents of the node from ZK, and re-establishing the ZK watch. This mechanism also enables brokers to shutdown when incompatibilities are detected (see Broker protections section).
When a call to the ApiKeys.UPDATE_FEATURES
API has failed, the following is guaranteed to the client:
...
Whenever ZK notifies the broker about a change to
'/features'
node, the broker will read the latest list of finalized features from ZK and caches it in memory (also see Broker protections section in this doc).We will modify the implementation of the
ApiKeys.API_VERSIONS
API to populate the information about finalized features in the response. This will contain the cluster-wide finalized versions from the broker’s internal ZK cache of'/features'
node contents (as explained above), as well as the broker-level supported versions (an additional piece of information that's useful for debugging).The finalized feature versions populated in the response will be eventually consistent, since it is refreshed in the brokers via ZK watches.
...
NOTE: The logic for the validations will be exactly the same as the one described under Validations section under Controller API.
Incompatible broker lifetime race condition
...