Skip to content

KAFKA-14057: Support dynamic reconfiguration in KRaft remote controllers#13332

Closed
cmccabe wants to merge 1 commit intoapache:trunkfrom
cmccabe:KAFKA-14057
Closed

KAFKA-14057: Support dynamic reconfiguration in KRaft remote controllers#13332
cmccabe wants to merge 1 commit intoapache:trunkfrom
cmccabe:KAFKA-14057

Conversation

@cmccabe
Copy link
Copy Markdown
Contributor

@cmccabe cmccabe commented Mar 2, 2023

This PR allows us to dynamically reconfigure the KRaft controller by setting either a cluster configuration (that is, a configuration that applies to all resource of type BROKER), or by configuring a combined broker/controller node.

As described in DynamicBrokerConfig#addReconfigurables(ControllerServer), we currently support reconfiguring Yammer metrics, metrics reporters, the socket server, and the Authorizer. More dynamically reconfigurable Controller elements will be added later.

This PR refactors MetadataPublisher's interface a bit. There is now a handleControllerChange callback. This is something that some publishers might want (a good example is ZkMigrationClient). There is now only a single publish() function rather than a separate function for publishing snapshots and log deltas. Most publishers didn't want to do anything different in those two cases. The ones that do want to do something different for snapshots can always check the manifest type. The close function now has a default empty implementation, since most publishers didn't need to do anything there.

This PR fixes a bug where the KRaft broker's authorizer was not dynamically reconfigurable even if it had implemented Reconfigurable. The bug resulted from the fact that we called DynamicBrokerConfig.addReconfigurables prior to initializing BrokerServer.authorizer.

This PR allows us to dynamically reconfigure the KRaft controller by setting either a cluster
configuration (that is, a configuration that applies to all resource of type BROKER), or by
configuring a combined broker/controller node.

As described in DynamicBrokerConfig#addReconfigurables(ControllerServer), we currently support
reconfiguring Yammer metrics, metrics reporters, the socket server, and the Authorizer.  More
dynamically reconfigurable Controller elements will be added later.

This PR refactors MetadataPublisher's interface a bit. There is now a handleControllerChange
callback. This is something that some publishers might want (a good example is ZkMigrationClient).
There is now only a single publish() function rather than a separate function for publishing
snapshots and log deltas. Most publishers didn't want to do anything different in those two cases.
The ones that do want to do something different for snapshots can always check the manifest type.
The close function now has a default empty implementation, since most publishers didn't need to do
anything there.

This PR fixes a bug where the KRaft broker's authorizer was not dynamically reconfigurable even if
it had implemented Reconfigurable. The bug resulted from the fact that we called
DynamicBrokerConfig.addReconfigurables prior to initializing BrokerServer.authorizer.
@cmccabe
Copy link
Copy Markdown
Contributor Author

cmccabe commented Mar 3, 2023

Let me split out the MetadataPublisher refactoring part.
#13337

@cmccabe
Copy link
Copy Markdown
Contributor Author

cmccabe commented Mar 7, 2023

Superseded by #13116

@cmccabe cmccabe closed this Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant