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

[Segment Replication] Introduce new SEGMENT_REPLICATION_EXPERIMENTAL feature flag. #7006

Merged

Conversation

Rishikesh1159
Copy link
Member

@Rishikesh1159 Rishikesh1159 commented Apr 5, 2023

Description

This PR adds new SEGMENT_REPLICATION_EXPERIMENTAL feature flag. This Feature Flag should strictly be used only for testing purposes.

This PR puts cluster setting introduced behind this new SEGMENT_REPLICATION_EXPERIMENTAL feature flag.

Issues Resolved

Resolves #6952

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2023

Gradle Check (Jenkins) Run Completed with:

Signed-off-by: Rishikesh1159 <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2023

Gradle Check (Jenkins) Run Completed with:

@@ -35,6 +35,7 @@ protected FeatureFlagSettings(
new HashSet<>(
Arrays.asList(
FeatureFlags.REPLICATION_TYPE_SETTING,
FeatureFlags.SEGMENT_REPLICATION_CLUSTER_REPLICATION_TYPE_SETTING,
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be renamed REPLICATION_TYPE_SEGMENT_REPLICATION_CLUSTER_SETTING for readability. That way we preserve the SEGMENT_REPLICATION_CLUSTER_SETTING in the name to show users it's related.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure will update this in next commit.

@@ -27,6 +27,13 @@ public class FeatureFlags {
*/
public static final String REPLICATION_TYPE = "opensearch.experimental.feature.replication_type.enabled";

/**
* Gates the visibility of the segment replication cluster setting that allows changing of replication type.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Gates the visibility of the segment replication cluster setting that allows changing of replication type.
* Gates the visibility of the segment replication cluster setting that allows changing of default replication type in a cluster.

Signed-off-by: Rishikesh1159 <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2023

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

codecov-commenter commented Apr 5, 2023

Codecov Report

Merging #7006 (20c2546) into main (59e881b) will increase coverage by 0.04%.
The diff coverage is 50.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##               main    #7006      +/-   ##
============================================
+ Coverage     70.77%   70.82%   +0.04%     
- Complexity    59270    59299      +29     
============================================
  Files          4822     4822              
  Lines        283940   283940              
  Branches      40947    40947              
============================================
+ Hits         200963   201090     +127     
+ Misses        66454    66370      -84     
+ Partials      16523    16480      -43     
Impacted Files Coverage Δ
...org/opensearch/cluster/metadata/IndexMetadata.java 84.65% <ø> (-0.02%) ⬇️
...rg/opensearch/common/settings/ClusterSettings.java 92.50% <ø> (ø)
...pensearch/common/settings/FeatureFlagSettings.java 50.00% <ø> (ø)
.../main/java/org/opensearch/index/IndexSettings.java 85.30% <0.00%> (ø)
.../java/org/opensearch/common/util/FeatureFlags.java 90.90% <100.00%> (+0.90%) ⬆️

... and 472 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@@ -646,7 +646,7 @@ public void apply(Settings value, Settings current, Settings previous) {
public static final Map<String, List<Setting>> FEATURE_FLAGGED_CLUSTER_SETTINGS = Map.of(
FeatureFlags.SEARCHABLE_SNAPSHOT,
List.of(Node.NODE_SEARCH_CACHE_SIZE_SETTING),
FeatureFlags.REPLICATION_TYPE,
FeatureFlags.SEGMENT_REPLICATION_CLUSTER_SETTING,
Copy link
Member

Choose a reason for hiding this comment

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

I thought the goal was to reuse the FeatureFlags.REPLICATION_TYPE_SETTING since we were going to get rid of the gating mechanism in other places, and keep this one behind the existing flag.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes initially even I was thinking on same line, but the reason I added new feature flag is because FeatureFlags.REPLICATION_TYPE_SETTING feature flag is old, I mean many users are already aware of this feature flag, they can mistakenly enable this expecting some other behaviour and some users might get confused on why after segrep GA release they have a feature flag. In order to avoid this confusion I thought creating a new feature flag which is not popular among users and only known to few for testing purposes.

Other than avoiding confusion I don't have any strong opinion on adding new feature flag. @kotwanikunal what are your thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

Seems like a good plan! Let's go ahead with the new flag to avoid any confusion.

Copy link
Member

@anasalkouz anasalkouz Apr 6, 2023

Choose a reason for hiding this comment

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

Considering new features and enhancements that we are going to introduce in the future, I think it better to use the same feature flag, So, they are flagged as beta features and users can use same flag to test them, instead of having different flags for each enhancement. @Rishikesh1159 @kotwanikunal what do you think?

Copy link
Member

Choose a reason for hiding this comment

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

That was my original intent. An alternative solution that might work going forward is introducing a new feature flag which gates experimental features only - FeatureFlags.SEGMENT_REPLICATION_EXPERIMENTAL. This will avoid the confusion that @Rishikesh1159 was talking about as well as serves our purpose going forward with new/experimental features until we release them.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure thanks @kotwanikunal and @anasalkouz for your thoughts. I think kunal's alternative solution here makes sense. It will make things cleaner. I will go ahead and create new FeatureFlags.SEGMENT_REPLICATION_EXPERIMENTAL and we can use this for future segrep experimental features.

@Rishikesh1159 Rishikesh1159 changed the title [Segment Replication] Introduce new SEGMENT_REPLICATION_CLUSTER_SETTING feature flag. [Segment Replication] Introduce new SEGMENT_REPLICATION_EXPERIMENTAL feature flag. Apr 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2023

Gradle Check (Jenkins) Run Completed with:

@Rishikesh1159 Rishikesh1159 added the backport 2.x Backport to 2.x branch label Apr 6, 2023
@Rishikesh1159 Rishikesh1159 merged commit fe8b4d4 into opensearch-project:main Apr 6, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 6, 2023
…feature flag. (#7006)

* Add new SEGMENT_REPLICATION_CLUSTER_SETTING feature flag.

Signed-off-by: Rishikesh1159 <[email protected]>

* Remove entry from changelog as the cluster setting introduced is noy ready for users to use.

Signed-off-by: Rishikesh1159 <[email protected]>

* Fix failing unit tests.

Signed-off-by: Rishikesh1159 <[email protected]>

* Address comments on PR.

Signed-off-by: Rishikesh1159 <[email protected]>

* Address comments on PR and chnage feature flag to SEGMENT_REPLICATION_EXPERIMENTAL.

Signed-off-by: Rishikesh1159 <[email protected]>

---------

Signed-off-by: Rishikesh1159 <[email protected]>
(cherry picked from commit fe8b4d4)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Rishikesh1159 pushed a commit that referenced this pull request Apr 7, 2023
…feature flag. (#7006) (#7042)

* Add new SEGMENT_REPLICATION_CLUSTER_SETTING feature flag.



* Remove entry from changelog as the cluster setting introduced is noy ready for users to use.



* Fix failing unit tests.



* Address comments on PR.



* Address comments on PR and chnage feature flag to SEGMENT_REPLICATION_EXPERIMENTAL.



---------


(cherry picked from commit fe8b4d4)

Signed-off-by: Rishikesh1159 <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Segment Replication] Add new feature flag for testing new segment replication settings
5 participants