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

[FLASH-739] Add cluster manager service by poco timer #332

Closed
wants to merge 3 commits into from

Conversation

ilovesoup
Copy link
Contributor

Add a cluster manager service by Poco::Timer that runs cluster manager python script every refresh_interval seconds. At the meanwhile, cluster manager scripts should be changed to non-looping style. This will eliminate the need of supervise the script when deploy and user need not care about flash_cluster_manager.

dbms/src/Server/CMakeLists.txt Outdated Show resolved Hide resolved
dbms/src/Server/ClusterManagerService.cpp Outdated Show resolved Hide resolved
dbms/src/Server/ClusterManagerService.cpp Outdated Show resolved Hide resolved
dbms/src/Server/ClusterManagerService.cpp Outdated Show resolved Hide resolved
auto task_interval = conf.getInt(TASK_INTERVAL_KEY, 10) * SECOND;

if (!Poco::File(bin_path).exists())
throw Exception("Cluster manager binary file does not exist: " + bin_path);
Copy link
Contributor

@solotzg solotzg Nov 28, 2019

Choose a reason for hiding this comment

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

add error log here, application will exit without any info if is running as daemon.

use ErrorCodes::LOGICAL_ERROR

@zanmato1984
Copy link
Contributor

/run-integration-tests

{
const auto & conf = context.getConfigRef();

auto bin_path = conf.getString(CLUSTER_MANAGER_PATH_KEY, ".") + Poco::Path::separator() + BIN_NAME;
Copy link
Contributor

Choose a reason for hiding this comment

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

In our mock test, flash_cluster_manager can not be found definitely, make it optional

@ilovesoup ilovesoup changed the title Add cluster manager service by poco timer [FLASH-739] Add cluster manager service by poco timer Nov 29, 2019
throw Exception("Cluster manager binary file does not exist: " + bin_path);

std::vector<std::string> args;
args.push_back(config_path);
Copy link
Contributor

Choose a reason for hiding this comment

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

latest format of args is: /pinary-path --config config_path

@solotzg
Copy link
Contributor

solotzg commented Dec 11, 2019

move to #331 , close it.

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.

4 participants