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

   ## What is the purpose of the change
   
   Fixes FLINK-41685: `CoordinatorStoreImpl#apply` ran its consumer on 
`store.get(key)` without holding the per-key lock used by `compute` and 
`computeIfPresent`, allowing concurrent reads of mutable store values (such as 
the watermark-alignment `WatermarkAggregator`) to observe torn intermediate 
state.
   
   Note: stacked on top of #29038 (`e6883df17c1`) for review; will be rebased 
onto `master` once #29038 merges.
   
   ## Brief change log
   
   - Executed `CoordinatorStoreImpl#apply` inside `ConcurrentHashMap#compute`, 
returning the existing value unchanged.
   - Documented atomicity and non-reentrancy on `CoordinatorStore#apply`.
   - Added `CoordinatorStoreImplTest` and 
`SourceCoordinatorAlignmentTest#testConcurrentStoreApplyAndCompute`.
   
   ## Verifying this change
   
   - `CoordinatorStoreImplTest#testApplyIsAtomicWithComputeIfPresent` and 
`SourceCoordinatorAlignmentTest#testConcurrentStoreApplyAndCompute` fail 
without the fix and pass with it.
   - Regression: `CoordinatorStoreImplTest`, `SourceCoordinatorAlignmentTest`, 
`SourceCoordinatorTest`, and `SourceCoordinatorContextTest` pass locally.
   
   ## 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: yes
     - The S3 file system connector: no
   
   ## 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?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Antigravity (Gemini 4)
   


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