-
Notifications
You must be signed in to change notification settings - Fork 125
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
Support persisting TableMetadata in the metastore #433
base: main
Are you sure you want to change the base?
Conversation
This will potentially reduce a lot of I/O overhead! Thanks for working on it. |
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 taking a stab at this! I think it's worth discussing whether metadata contents could be better stored within the TableLikeEntity itself.
polaris-core/src/main/java/org/apache/polaris/core/entity/TableMetadataEntity.java
Outdated
Show resolved
Hide resolved
polaris-service/src/main/java/org/apache/polaris/service/persistence/MetadataCacheManager.java
Outdated
Show resolved
Hide resolved
polaris-service/src/main/java/org/apache/polaris/service/persistence/MetadataCacheManager.java
Outdated
Show resolved
Hide resolved
polaris-service/src/main/java/org/apache/polaris/service/persistence/MetadataCacheManager.java
Outdated
Show resolved
Hide resolved
polaris-service/src/main/java/org/apache/polaris/service/persistence/MetadataCacheManager.java
Outdated
Show resolved
Hide resolved
polaris-service/src/main/java/org/apache/polaris/service/persistence/MetadataCacheManager.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
// if the metadata is not changed, return early | ||
if (base == metadata) { |
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.
should we fix this too? if base.path != metadata.path
Description
This adds a new flag
METADATA_CACHE_MAX_BYTES
which allows the catalog to store table metadata in the metastore and vend it from there when loadTable is called.Entries are cached based on the metadata location. Currently, the entire metadata.json content is cached.
Features not included in this PR:
There is partial support for (1) here and I want to extend it, but the goal is to structure things in a way that will allow us to implement (2) and (3) in the future as well.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Existing tests vend table metadata correctly when caching is enabled.
Added a small test in
BasePolarisCatalogTest
to cover the basic semantics of cachingManual testing with eclipselink -- I observed the entities getting created in Postgres and saw large metadata being cached:
With MySQL, small metadata is persisted:
However large metadata may cause
internalproperties
to exceed the size limit and nothing will be cached. Calls still return safely.