THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Read cluster-wide finalized feature versions from a broker or a controller via it’s
ApiKeys.API_VERSIONS
API.Add/update/delete cluster-wide finalized feature versions by exercising the newly introduced
ApiKeys.UPDATE_FEATURES A
PI on a controller.- Finalize the latest possible version levels set of all features on a cluster. This is useful to a cluster operator intending to finalize all the latest # available features, after completing the deployment of a new Kafka Broker release # onto an existing cluster.
We shall introduce 3 new APIs in the Admin interface, which enables us to read the feature versions and finalize feature version upgrades. Below is Java-ish pseudocode for the same.
...
Code Block |
---|
=== DESCRIBE FEATURES === # Get cluster-wide finalized features, and features supported by a specific broker. # - Use `--bootstrap-server` to provide a broker host:port to which queries should be issued. # - Optionally, provide `--controller` flag directing the tool to issue the query to the # controller (while discovering the controller via the bootstrap server). # This can be useful for debugging purposes. $> kafka-features.sh describe \ --bootstrap-server kafka-broker0.prn1:9071 \ [--controller] { "status": "OK", "supported_features": { "group_coordinator": { "min_version": 1, "max_version": 2 }, "transaction_coordinator": { "min_version": 1, "max_version": 5 }, "consumer_offsets_topic_schema": { "min_version": 1, "max_version": 1 } }, "finalized_features": { "epoch": 0, "group_coordinator": { "version_level": 1 }, "transaction_coordinator": { "version_level": 4 } }, "host": "kafka-broker0.prn1", "port": 9071 } === ADD_OR_UPDATE FEATURES === # Add or update a list of cluster-wide finalized features. # - Use `--bootstrap-server` to provide a broker host:port to which MetadataRequest query should be issued. # The MetadataResponse will be used to discover the Controller, to which the actual ADD_OR_UPDATE request is issued. # - Use `--upgrade` to provide a comma-separated list of features and new finalized max version to ADD_OR_UPDATE. # - Use `--allow-downgrade` to allow a downgrade for feature version levels. This should be used only when required. $> kafka-features.sh update \ --bootstrap-server kafka-broker0.prn1:9071 \ --upgrade group_coordinator:2,consumer_offsets_topic_schema:1 \ --allow-downgrade transaction_coordinator:3 \ Please confirm before downgrading the following features: 1.transaction_coordinator from v4 (existing) to v3 (new) [Y/n]? Y { "status": "OK", "supported_features": { "group_coordinator": { "min_version": 1, "max_version": 2 }, "transaction_coordinator": { "min_version": 1, "max_version": 5 }, "consumer_offsets_topic_schema": { "min_version": 1, "max_version": 1 } }, "finalized_features": { "epoch": 1, "group_coordinator": { "version_level": 2 }, "transaction_coordinator": { "version_level": 3 }, "consumer_offsets_topic_schema": { "version_level": 1 } }, "host": "kafka-broker0.prn1", "port": 9071 } === DELETE FEATURES === # Delete a list of cluster-wide finalized features. # - Use `--bootstrap-server` to provide a broker host:port to which MetadataRequest query should be issued. # The MetadataResponse will be used to discover the Controller, to which the actual delete request is issued. # - Use `--features` to provide a comma-separated list of finalized features to be deleted. $> kafka-features.sh delete \ --bootstrap-server kafka-broker0.prn1:9071 \ --features group_coordinator,transaction_coordinator Please confirm deletion of the following finalized features: 1. group_coordinator 2. transaction_coordinator [Y/n] Y { "status": "OK", "supported_features": { "group_coordinator": { "min_version": 1, "max_version": 2 }, "transaction_coordinator": { "min_version": 1, "max_version": 5 }, "consumer_offsets_topic_schema": { "min_version": 1, "max_version": 1 } }, "finalized_features": { "epoch": 2, "consumer_offsets_topic_schema": { "version_level": 1 } }, "host": "kafka-broker0.prn1", "port": 9071 } === ENABLEFINALIZE LATEST FEATURES === # EnableFinalize all the latest available features, as known to the controller. # # This command is useful to a cluster operator intending to enablefinalize all the latest # available features, after completing the deployment of a new Kafka Broker release # onto an existing cluster. # # The way the command works, is that it queries the controller to read the map of # supported features (via ApiVersionsRequest). Then the command constructs a `Set<FeatureUpdate>`, # containing all supported features, with their feature version levels set to the corresponding # max_version (as returned in the ApiVersionsResponse). Finally, the controller makes an # UPDATE_FEATURES api call passing to it the just constructed Set<FeatureUpdate>. This call # should enablefinalize all the latest available features. $> kafka-features.sh enablefinalize-latest \ --bootstrap-server kafka-broker0.prn1:9071 { "status": "OK", "supported_features": { "group_coordinator": { "min_version": 1, "max_version": 3 }, "transaction_coordinator": { "min_version": 1, "max_version": 6 }, "consumer_offsets_topic_schema": { "min_version": 1, "max_version": 3 } }, "finalized_features": { "epoch": 3, "group_coordinator": { "version_level": 3 }, "transaction_coordinator": { "version_level": 6 }, "consumer_offsets_topic_schema": { "version_level": 3 } }, "host": "kafka-broker0.prn1", "port": 9071 } |
...