- 
                Notifications
    You must be signed in to change notification settings 
- Fork 25.6k
Only Allow Enabling Streams If No Conflicting Indices Exist #132064
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
Only Allow Enabling Streams If No Conflicting Indices Exist #132064
Conversation
| Pinging @elastic/es-data-management (Team:Data Management) | 
| Hi @lukewhiting, I've created a changelog YAML for you. | 
        
          
                .../src/main/java/org/elasticsearch/rest/streams/logs/TransportLogsStreamsToggleActivation.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                .../src/main/java/org/elasticsearch/rest/streams/logs/TransportLogsStreamsToggleActivation.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      …-streams-enable-check-for-indices
        
          
                .../src/main/java/org/elasticsearch/rest/streams/logs/TransportLogsStreamsToggleActivation.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      …-streams-enable-check-for-indices
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.
Pull Request Overview
This PR prevents enabling logs streams when conflicting indices already exist, addressing issue ES-12416. The implementation adds validation to check for existing indices named "logs" or starting with "logs." before allowing stream enablement.
- Adds pre-validation to prevent stream enablement conflicts with existing indices
- Implements comprehensive test coverage for the new validation logic
- Exports the streams package for broader accessibility
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description | 
|---|---|
| server/src/main/java/module-info.java | Exports the streams package to make it accessible | 
| modules/streams/src/yamlRestTest/resources/rest-api-spec/test/streams/logs/10_basic.yml | Adds test cases and teardown for conflict validation scenarios | 
| modules/streams/src/main/java/org/elasticsearch/rest/streams/logs/TransportLogsStreamsToggleActivation.java | Implements the core validation logic to prevent enabling streams with conflicting indices | 
| modules/streams/build.gradle | Minor quote style fix for consistency | 
| docs/changelog/132064.yaml | Documents the enhancement for release notes | 
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
        
          
                .../src/main/java/org/elasticsearch/rest/streams/logs/TransportLogsStreamsToggleActivation.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                .../src/main/java/org/elasticsearch/rest/streams/logs/TransportLogsStreamsToggleActivation.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      …not using a stream
…-streams-enable-check-for-indices
This PR makes it so that the logs streams feature can only be enabled on a cluster if there are not pre-existing indices called
logsor with names startinglogs.*.Fixes ES-12416