-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Do not add index event listener if CCR disabled #37432
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
78ccb3c
Do not add index event listener if CCR disabled
Tim-Brooks 3c91938
Add test
Tim-Brooks 976eeeb
Work on changes
Tim-Brooks 553b46b
Merge remote-tracking branch 'upstream/master' into do_no_add_listener
Tim-Brooks b4fedc8
Add todo
Tim-Brooks e10820e
Fix checkstyle
Tim-Brooks c936b84
Merge remote-tracking branch 'upstream/master' into do_no_add_listener
Tim-Brooks bf5a195
Merge remote-tracking branch 'upstream/master' into do_no_add_listener
Tim-Brooks 2c7192c
Merge remote-tracking branch 'upstream/master' into do_no_add_listener
Tim-Brooks c4a89c9
Merge remote-tracking branch 'upstream/master' into do_no_add_listener
Tim-Brooks b8239cd
Merge remote-tracking branch 'upstream/master' into do_no_add_listener
Tim-Brooks db518d5
Merge remote-tracking branch 'upstream/master' into do_no_add_listener
Tim-Brooks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/CcrDisabledIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
package org.elasticsearch.xpack.ccr; | ||
|
||
import org.elasticsearch.common.settings.Settings; | ||
import org.elasticsearch.plugins.Plugin; | ||
import org.elasticsearch.test.ESIntegTestCase; | ||
import org.elasticsearch.xpack.core.XPackClientPlugin; | ||
import org.elasticsearch.xpack.core.XPackSettings; | ||
|
||
import java.util.Collection; | ||
import java.util.Collections; | ||
|
||
public class CcrDisabledIT extends ESIntegTestCase { | ||
|
||
public void testClusterCanStartWithCcrInstalledButNotEnabled() throws Exception { | ||
// TODO: Assert that x-pack ccr feature is not enabled once feature functionality has been added | ||
ensureGreen(); | ||
} | ||
|
||
@Override | ||
protected Settings nodeSettings(int nodeOrdinal) { | ||
return Settings.builder().put(super.nodeSettings(nodeOrdinal)).put(XPackSettings.CCR_ENABLED_SETTING.getKey(), true) | ||
.put(XPackSettings.SECURITY_ENABLED.getKey(), false).build(); | ||
} | ||
|
||
@Override | ||
protected Settings transportClientSettings() { | ||
return Settings.builder().put(super.transportClientSettings()).put(XPackSettings.SECURITY_ENABLED.getKey(), false).build(); | ||
} | ||
|
||
@Override | ||
protected Collection<Class<? extends Plugin>> nodePlugins() { | ||
return Collections.singletonList(LocalStateCcr.class); | ||
} | ||
|
||
@Override | ||
protected Collection<Class<? extends Plugin>> transportClientPlugins() { | ||
return Collections.singletonList(XPackClientPlugin.class); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the problem that is fixed here only occurs when an index is created, so let's create an index in this test. Perhaps also invoke the
XPackClient.prepareInfo()
API to check whether the plugin is disabled.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean I specifically tried and the test failed without the my fix in the
Ccr.java
class. You can see it happens when the add listener method is called:I will add the
prepareInfo
check.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also - it looks like CCR has not implemented the
XPackFeatureSet
functionality? When I search for references, it is not referenced in the ccr package.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a PR open for this.