-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Invalidate latest version cache when new schema version is registered #4023
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Invalidate latest version cache when new schema version is registered #4023
Conversation
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
|
/sem-approve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a caching bug where the latest schema version cache was not being invalidated after registering a new schema version, causing subsequent calls to retrieve stale cached data.
- Adds cache invalidation logic when a new schema is successfully registered
- Adds comprehensive test coverage to verify cache invalidation behavior
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| CachedSchemaRegistryClient.java | Invalidates latest version caches after successful schema registration |
| CachedSchemaRegistryClientTest.java | Adds test to verify latest version cache is properly invalidated on registration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
client/src/main/java/io/confluent/kafka/schemaregistry/client/CachedSchemaRegistryClient.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/sem-approve |
|
@rayokota Can I please have a review on this? Not sure if the command "/sem-approve" is working as expected. |
|
cc: @rayokota can I please get a review on this PR? |
|
@jsingh-yelp , can you update the branch to the latest? |
|
@rayokota done |
What
Currently when a new schema version is registered, the client library's latestVersionCache isn't invalidated, causing it to serve a stale version.
This change invalidates the latest version cache whenever a new schema version is registered.
Checklist
Please answer the questions with Y, N or N/A if not applicable.
References
Issue link: #4021
Test & Review
Added tests for this change.