Leondon9 opened a new pull request, #3335:
URL: https://github.com/apache/fluss/pull/3335

   ### Purpose
   
   Linked issue: N/A
   
   `ClientSchemaGetter#getSchema` already looked up missing schema IDs through 
`Admin#getTableSchema`, but the synchronously fetched schema was not stored in 
the local `schemasById` cache. As a result, repeated lookups for the same 
schema ID could issue repeated admin requests.
   
   This PR caches schemas fetched through the synchronous fallback path. It 
also adds a focused unit test that verifies the first lookup fetches the 
schema, the second lookup reuses the cache, and the latest schema metadata is 
advanced when the fetched schema is newer.
   
   ### Brief change log
   
   - Store synchronously fetched schemas in `ClientSchemaGetter`'s local schema 
cache.
   - Add `ClientSchemaGetterTest` covering cache reuse and latest-schema update 
behavior.
   
   ### Why this is better
   
   Repeated `getSchema(schemaId)` calls for a schema that was initially missing 
from the client cache no longer need to call `Admin#getTableSchema` every time. 
This reduces unnecessary metadata calls while preserving the existing 
latest-schema update behavior.
   
   ### Tests
   
   - `env PATH=/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin:/usr/sbin ./mvnw 
-pl fluss-client -am -Dtest=ClientSchemaGetterTest -DfailIfNoTests=false test`
   
   ### API and Format
   
   No public API or storage format changes.
   
   ### Documentation
   
   No documentation changes; this is an internal client metadata cache behavior 
fix.
   
   ### Generative AI disclosure
   
   Yes. This PR was authored with assistance from OpenAI Codex and reviewed by 
the human contributor before submission.
   
   Generated-by: OpenAI Codex following 
https://github.com/apache/fluss/blob/main/AGENTS.md


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