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

disabling ccr and remote clusters when index mgmt is disabled #32203

Conversation

bmcconaghy
Copy link
Contributor

Closes #32160

This PR disables CCR and Remote Clusters when index management has been disabled. Additionally, it disables CCR when remote clusters has been disabled.

@bmcconaghy bmcconaghy added v7.0.0 Feature:CCR and Remote Clusters v8.0.0 Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v6.7.0 v7.2.0 labels Feb 28, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this Bill! Had a few suggestions about the code.

config.has('xpack.index_management.enabled') &&
config.get('xpack.index_management.enabled') &&
config.has('xpack.remote_clusters.enabled') &&
config.get('xpack.remote_clusters.enabled')
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like index_management and remote_clusters are each being checked twice. I think we mean this?

      return (
        config.get('xpack.ccr.enabled') &&
        config.has('xpack.index_management.enabled') &&
        config.has('xpack.remote_clusters.enabled')
     );

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"has" checks for the existence of the key and "get" checks for its value. "get' will blow up if has is false, hence the two checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not true, it turns out. Tested get with nonexistent key and it worked fine.

config.has('xpack.remote_clusters.enabled') &&
config.get('xpack.remote_clusters.enabled')
);
},
Copy link
Contributor

Choose a reason for hiding this comment

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

CCR's UI surfaces cross-links with Remote Clusters. Should we also set ccrUiEnabled to false on line 25 if Remote Clusters UI is disabled?

        return {
          ccrUiEnabled: (
            config.get('xpack.ccr.ui.enabled')
            && config.get('xpack.remote_clusters.ui.enabled')
          )
        };

return (
config.get('xpack.remote_clusters.enabled') &&
config.has('xpack.index_management.enabled') &&
config.get('xpack.index_management.enabled')
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove line 51 since it's a dupe of line 50?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's not AFAIK

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, turns out the "has" calls are not necessary. Saw this in someone else's code and assumed they were, but this doesn't crash Kibana: config.get('xpack.doesntexist.enabled')

Copy link
Contributor

Choose a reason for hiding this comment

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

I actually had just scanned the code too quickly and didn't notice one was has and one was get. Looks like we both learned something new 😄

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Contributor

@sebelga sebelga left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @bmcconaghy for this 👍

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

Code LGTM! Tested locally:

  1. xpack.index_management.enabled: false also disables CCR and RC
  2. xpack.remote_clusters.enabled: false also disables CCR
  3. xpack.remote_clusters.ui.enabled: false also disables the CCR UI

No fatal errors.

@cjcenizal
Copy link
Contributor

Retest

@elasticmachine
Copy link
Contributor

💔 Build Failed

@bmcconaghy
Copy link
Contributor Author

retest

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@bmcconaghy bmcconaghy merged commit 55ecd79 into elastic:master Feb 28, 2019
@bmcconaghy bmcconaghy deleted the disable_ccr_remote_clusters_when_index_management_disabled branch February 28, 2019 18:56
bmcconaghy added a commit to bmcconaghy/kibana that referenced this pull request Feb 28, 2019
…c#32203)

* disabling ccr and remote clusters when index mgmt is disabled

* addressing PR feedback
bmcconaghy added a commit to bmcconaghy/kibana that referenced this pull request Feb 28, 2019
…c#32203)

* disabling ccr and remote clusters when index mgmt is disabled

* addressing PR feedback
bmcconaghy added a commit that referenced this pull request Feb 28, 2019
#32234)

* disabling ccr and remote clusters when index mgmt is disabled

* addressing PR feedback
bmcconaghy added a commit to bmcconaghy/kibana that referenced this pull request Feb 28, 2019
…c#32203)

* disabling ccr and remote clusters when index mgmt is disabled

* addressing PR feedback
bmcconaghy added a commit that referenced this pull request Feb 28, 2019
#32235)

* disabling ccr and remote clusters when index mgmt is disabled

* addressing PR feedback
bmcconaghy added a commit that referenced this pull request Feb 28, 2019
#32236)

* disabling ccr and remote clusters when index mgmt is disabled

* addressing PR feedback
bmcconaghy added a commit that referenced this pull request Feb 28, 2019
* disabling ccr and remote clusters when index mgmt is disabled

* addressing PR feedback

adjusting config paths for index_management
bmcconaghy added a commit that referenced this pull request Feb 28, 2019
#32248)

* disabling ccr and remote clusters when index mgmt is disabled

* addressing PR feedback

adjusting config paths for index_management
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:CCR and Remote Clusters Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v6.7.0 v7.0.0 v7.2.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants