-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Local schema cache weighted invalidation based on schema size #2598
base: master
Are you sure you want to change the base?
Local schema cache weighted invalidation based on schema size #2598
Conversation
* <code>schema.cache.maximum.weight</code> | ||
*/ | ||
public static final String SCHEMA_CACHE_MAXIMUM_WEIGHT_CONFIG = "schema.cache.maximum.weight"; | ||
public static final int SCHEMA_CACHE_MAXIMUM_WEIGHT_DEFAULT = 1000000; |
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.
The sum of canonical schema length must be under 1,000,000 characters is what this variable means. From the guava cache docs there's a lot of fuzziness as to how things get invalidated within the cache itself (based on usage and % of contribution to weight total?) but we've set this limit such that large schemas should be getting invalidated over time. What this essentially means is that more smaller schemas will be cached (and that's good!) as we should be able to cache quite a few of them. No significant performance degradation has materialized from making this change.
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.
Thanks for the PR @mattsewall-stripe!
The build failed with a few checkstyle errors
* <code>schema.cache.use.weight</code> | ||
*/ | ||
public static final String SCHEMA_CACHE_USE_WEIGHT_CONFIG = "schema.cache.use.weight"; | ||
public static final boolean SCHEMA_CACHE_USE_WEIGHT_DEFAULT = false; |
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.
Turned off by default but in my opinion likely could be turned on by default.
Hey! I apologize for the delay but have built project locally and ran tests :) |
Hi! @rayokota can you take another look? Coming around to this again |
|
Summary
Motivation