Skip to content

Commit

Permalink
kafka: Flag remote.recovery can't be used with read replicas
Browse files Browse the repository at this point in the history
Validate SI flags to prevent combination of remote.recovery and
remote.read.replica flags.
  • Loading branch information
Lazin committed Jul 29, 2022
1 parent 3084fbf commit cec9ba2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/v/kafka/server/handlers/topics/validators.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,16 @@ struct remote_read_and_write_are_not_supported_for_read_replica {
static bool is_valid(const creatable_topic& c) {
auto config_entries = config_map(c.configs);
auto end = config_entries.end();
bool is_recovery
= (config_entries.find(topic_property_recovery) != end);
bool is_read_replica
= (config_entries.find(topic_property_read_replica) != end);
bool remote_read
= (config_entries.find(topic_property_remote_read) != end);
bool remote_write
= (config_entries.find(topic_property_remote_write) != end);

if (is_read_replica && (remote_read || remote_write)) {
if (is_read_replica && (remote_read || remote_write || is_recovery)) {
return false;
}
return true;
Expand Down

0 comments on commit cec9ba2

Please sign in to comment.