- 
                Notifications
    You must be signed in to change notification settings 
- Fork 25.6k
Minor-Fixes Support 7x segments as archive in 8x / 9x #125666
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
          
     Merged
      
      
            drempapis
  merged 5 commits into
  elastic:main
from
drempapis:117042_Support_7x_segments_as_archive_in_8x_minor_fixes
  
      
      
   
  Mar 27, 2025 
      
    
  
     Merged
                    Changes from 3 commits
      Commits
    
    
            Show all changes
          
          
            5 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      55e0127
              
                Minor fixes based on late review
              
              
                drempapis d588230
              
                Update docs/changelog/125666.yaml
              
              
                drempapis 5d74ec2
              
                Merge branch 'main' into 117042_Support_7x_segments_as_archive_in_8x_…
              
              
                drempapis 6a8143a
              
                update after review
              
              
                drempapis 4468870
              
                Merge branch 'main' into 117042_Support_7x_segments_as_archive_in_8x_…
              
              
                drempapis 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 hidden or 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,5 @@ | ||
| pr: 125666 | ||
| summary: Minor-Fixes Support 7x segments as archive in 8x / 9x | ||
| area: Search | ||
| type: bug | ||
| issues: [] | 
  
    
      This file contains hidden or 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
    
  
  
    
              
  
    
      This file contains hidden or 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 | 
|---|---|---|
|  | @@ -86,8 +86,16 @@ public MetadataOnlyBKDReader(IndexInput metaIn, boolean isVersionPost86) throws | |
| pointCount = metaIn.readVLong(); | ||
| docCount = metaIn.readVInt(); | ||
|  | ||
| // This code has been introduced to process IndexInput created with Lucene86Codec+. This is not necessary | ||
| // in the read-only version for older formats. | ||
| // The pre-8.6 code does not read the following fields that its standard Lucene counterpart does. After experimenting with the | ||
| // code, we got to the assumption that these are the last fields being read, which are not needed in the metadata-only reader, and | ||
| // we can safely ignore them when loading the file. Although by coincidence, nothing breaks if we read a couple of VLongs, as long | ||
| // as some bytes are available to read. | ||
| // | ||
| // The extra reads have been introduced to process IndexInput created with Lucene86Codec+, where a new BKD format has been | ||
| // introduced. It seems that we have stricter checks around the header and footer starting from the 86 formats hence we do need to | ||
|          | ||
| // consume all the data input there but not in previous formats. | ||
| // | ||
| // For correctness, we added version checking here. If and only if, the version is 8.6 or higher, we read the additional fields. | ||
| if (isVersionPost86) { | ||
| metaIn.readVInt(); | ||
| metaIn.readLong(); | ||
|  | ||
      
      Oops, something went wrong.
        
    
  
  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.
replace assumption with conclusion? :)
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.
Done ty!