fxbing opened a new pull request, #4635:
URL: https://github.com/apache/flink-cdc/pull/4635

   ## What is the purpose of this pull request?
   
   Fixes [FLINK-41658](https://issues.apache.org/jira/browse/FLINK-41658).
   
   Successive split readers in the same Fluss source subtask share a metric 
registry. When the old reader closes its connection, it also closes the shared 
`fluss` metric group. The replacement reader can continue consuming records 
while its client metrics are missing from Flink.
   
   ## Brief change log
   
   - Give each split reader its own registry and close the previous `fluss` 
group before creating the next one. This prevents Flink from reusing the same 
group while the old connection is still closing.
   - Route all split reader connection creation through 
`getOrCreateConnection()` so each connection uses its reader’s registry.
   
   ## Verifying this change
   
   - Added `testRecordsLagAfterResubscription` for both close orders. It 
verifies that the same metric ID exposes the replacement scanner’s gauge, that 
its value falls from 2 to 1 as another record is consumed, and that closing the 
replacement reader unregisters it.
   - All 49 targeted tests passed on both Flink 1.20.3 and 2.2.0. Spotless 
passed.
   
   ## Documentation
   
   - Does this pull request introduce a new feature? No.
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes, Codex CLI.
   
   Generated-by: Codex CLI 0.167.0
   


-- 
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