Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redpanda: remove _redpanda_enabled=false mode #4324

Merged
merged 3 commits into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 31 additions & 41 deletions src/v/redpanda/application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -438,36 +438,34 @@ void application::hydrate_config(const po::variables_map& cfg) {
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace update in subsequent commit, because all the indentation
jumps around & otherwise it's not obvious what I'm doing here.

🙏

};

_redpanda_enabled = config["redpanda"].IsDefined();
if (_redpanda_enabled) {
ss::smp::invoke_on_all([&config, cfg_path] {
config::node().load(cfg_path, config);
}).get0();

auto node_config_errors = config::node().load(config);
for (const auto& i : node_config_errors) {
vlog(
_log.warn,
"Node property '{}' validation error: {}",
i.first,
i.second);
}
if (node_config_errors.size() > 0) {
throw std::invalid_argument("Validation errors in node config");
}
ss::smp::invoke_on_all([&config, cfg_path] {
config::node().load(cfg_path, config);
}).get0();

auto node_config_errors = config::node().load(config);
for (const auto& i : node_config_errors) {
vlog(
_log.warn,
"Node property '{}' validation error: {}",
i.first,
i.second);
}
if (node_config_errors.size() > 0) {
throw std::invalid_argument("Validation errors in node config");
}

// This includes loading from local bootstrap file or legacy
// config file on first-start or upgrade cases.
_config_preload = cluster::config_manager::preload(config).get0();
// This includes loading from local bootstrap file or legacy
// config file on first-start or upgrade cases.
_config_preload = cluster::config_manager::preload(config).get0();

vlog(_log.info, "Cluster configuration properties:");
vlog(_log.info, "(use `rpk cluster config edit` to change)");
config_printer("redpanda", config::shard_local_cfg());
vlog(_log.info, "Cluster configuration properties:");
vlog(_log.info, "(use `rpk cluster config edit` to change)");
config_printer("redpanda", config::shard_local_cfg());

vlog(_log.info, "Node configuration properties:");
vlog(_log.info, "(use `rpk config set <cfg> <value>` to change)");
config_printer("redpanda", config::node());

vlog(_log.info, "Node configuration properties:");
vlog(_log.info, "(use `rpk config set <cfg> <value>` to change)");
config_printer("redpanda", config::node());
}
if (config["pandaproxy"]) {
_proxy_config.emplace(config["pandaproxy"]);
if (config["pandaproxy_client"]) {
Expand Down Expand Up @@ -499,11 +497,9 @@ void application::check_environment() {
syschecks::systemd_message("checking environment (CPU, Mem)").get();
syschecks::cpu();
syschecks::memory(config::node().developer_mode());
if (_redpanda_enabled) {
storage::directories::initialize(
config::node().data_directory().as_sstring())
.get();
}
storage::directories::initialize(
config::node().data_directory().as_sstring())
.get();
}

static admin_server_cfg
Expand Down Expand Up @@ -659,9 +655,7 @@ make_upload_controller_config(ss::scheduling_group sg) {

// add additional services in here
void application::wire_up_services() {
if (_redpanda_enabled) {
wire_up_redpanda_services();
}
wire_up_redpanda_services();
if (_proxy_config) {
construct_service(
_proxy_client,
Expand Down Expand Up @@ -1225,9 +1219,7 @@ application::set_proxy_client_config(ss::sstring name, std::any val) {
}

void application::start(::stop_signal& app_signal) {
if (_redpanda_enabled) {
start_redpanda(app_signal);
}
start_redpanda(app_signal);

if (_proxy_config) {
_proxy.invoke_on_all(&pandaproxy::rest::proxy::start).get();
Expand All @@ -1245,9 +1237,7 @@ void application::start(::stop_signal& app_signal) {
_schema_reg_config->schema_registry_api());
}

if (_redpanda_enabled) {
start_kafka(app_signal);
}
start_kafka(app_signal);

_admin.invoke_on_all([](admin_server& admin) { admin.set_ready(); }).get();

Expand Down
1 change: 0 additions & 1 deletion src/v/redpanda/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ class application {
void setup_public_metrics();
void setup_internal_metrics();
std::unique_ptr<ss::app_template> _app;
bool _redpanda_enabled{true};
cluster::config_manager::preload_result _config_preload;
std::optional<pandaproxy::rest::configuration> _proxy_config;
std::optional<kafka::client::configuration> _proxy_client_config;
Expand Down
3 changes: 0 additions & 3 deletions tests/rptest/services/redpanda.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@ def __init__(self,
context,
num_brokers,
*,
enable_rp=True,
extra_rp_conf=None,
extra_node_conf=None,
enable_pp=False,
Expand All @@ -499,7 +498,6 @@ def __init__(self,
skip_if_no_redpanda_log: bool = False):
super(RedpandaService, self).__init__(context, num_nodes=num_brokers)
self._context = context
self._enable_rp = enable_rp
self._extra_rp_conf = extra_rp_conf or dict()
self._enable_pp = enable_pp
self._enable_sr = enable_sr
Expand Down Expand Up @@ -1509,7 +1507,6 @@ def write_node_conf_file(self, node, override_cfg_params=None):
node_ip=node_ip,
kafka_alternate_port=self.KAFKA_ALTERNATE_PORT,
admin_alternate_port=self.ADMIN_ALTERNATE_PORT,
enable_rp=self._enable_rp,
enable_pp=self._enable_pp,
enable_sr=self._enable_sr,
superuser=self._superuser,
Expand Down
2 changes: 0 additions & 2 deletions tests/rptest/services/templates/redpanda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

organization: "vectorized"

{% if enable_rp %}
redpanda:
developer_mode: true
data_directory: "{{data_dir}}"
Expand Down Expand Up @@ -47,7 +46,6 @@ redpanda:
port: 33145
node_id: 1
{% endif %}
{% endif %}

{% if enable_pp %}
pandaproxy:
Expand Down