Samrat002 opened a new pull request, #28112:
URL: https://github.com/apache/flink/pull/28112

   ## What is the purpose of the change                                         
                                                                                
                  
   
   `NativeS3InputStream.seek()` unconditionally aborts the HTTP connection and 
opens a new Range GET for every seek, even for small forward seeks that land 
inside already-buffered data. During state restore, this creates `O(N)` HTTP 
round-trips for N state entries. each call costing TCP handshake + TLS + S3 
response latency.
   
   This PR aim to optimise an skip all HTTP work is deferred to the next 
`read()` call. Forward seeks within `max(readBufferSize, 
bufferedStream.available())` skip in-buffer instead of reopening the connection.
                                                                                
                                                                                
                    
   ## Brief change log
   - `seek()` and `skip()` now only update `nextReadPos` without any I/O        
                                                                                
                
   - Added `lazySeek()` to reconcile `nextReadPos` vs `streamPos` on the next 
`read()` call
   - Forward seeks within the dynamic threshold `max(readBufferSize, 
bufferedStream.available())` skip in-buffer; backward or large forward seeks 
reopen via Range GET          
   - Multiple seeks between reads coalesce — only the final position matters    
                                                                                
                
                                                                                
                                                                                
                    
   ## Verifying this change                                                     
                                                                                
                                                                                
                                                                                
                                   
   
   This change added tests and can be verified wit Unit Test and E2E working 
for high state flink application 
                                                                                
                                                                                
                    
   ## Does this pull request potentially affect one of the following parts:     
                                                                                
                  
                                                                                
                                                                                
                    
   - Dependencies (does it add or upgrade a dependency): no                     
                                                                                
                
   - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: no
   - The serializers: no                                                        
                                                                                
                
   - The runtime per-record code paths (performance sensitive): no
   - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no                      
                         
   - The S3 file system connector: yes                                          
                                                                                
                
      
   ## Documentation                                                             
                                                                                
                  
                                                               
   - Does this pull request introduce a new feature? no
   - If yes, how is the feature documented? not applicable
   
   ##### Was generative AI tooling used to co-author this PR?                   
                                                                                
                  
      
     - [ ] Yes (please specify the tool below)                                  
                                                                                
                    
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to