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

   ## What is the purpose of the change
   
   Fixes [FLINK-41522](https://issues.apache.org/jira/browse/FLINK-41522).
   
   FileCatalogStore changes YAML-sensitive string options when persisting 
catalog configurations. For example, a catalog created with default database 
`123` uses a database named `'123'` (including literal quotation marks) after 
reloading.
   
   The writer passes values already encoded by 
`Configuration.toFileWritableMap()` to YAMLMapper, which encodes them again. 
This change lets YAMLMapper encode the original strings exactly once.
   
   ## Brief change log
   
   - Use `Configuration.toMap()` when writing catalog configurations through 
YAMLMapper.
   - Add file-store close/reopen tests covering YAML-sensitive strings and 
typed list/map values.
   - Verify that a catalog instantiated from the reloaded descriptor retains 
its default database name.
   
   The reader remains unchanged. Previously affected catalog definitions are 
not automatically repaired, since encoded quotation marks cannot safely be 
distinguished from intentional characters in the original value.
   
   ## Verifying this change
   
   Added two regression tests in `FileCatalogStoreTest`:
   
   - `testCatalogOptionsSurviveReopening`
   - `testDefaultDatabaseSurvivesReopening`
   
   Both tests fail by assertion without the fix and pass with it. Reverting and 
restoring the fix reproduced the same results.
   
   ## 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 state serializer changes; corrects string encoding in 
persisted catalog YAML
   - 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: 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: gpt-6-astra


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