-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[core] Introduce deletion vector meta cache at bucket level #6407
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?
Conversation
paimon-api/src/main/java/org/apache/paimon/options/CatalogOptions.java
Outdated
Show resolved
Hide resolved
paimon-api/src/main/java/org/apache/paimon/options/CatalogOptions.java
Outdated
Show resolved
Hide resolved
paimon-api/src/main/java/org/apache/paimon/options/CatalogOptions.java
Outdated
Show resolved
Hide resolved
paimon-core/src/main/java/org/apache/paimon/index/IndexFileHandler.java
Outdated
Show resolved
Hide resolved
paimon-core/src/main/java/org/apache/paimon/index/IndexFileHandler.java
Outdated
Show resolved
Hide resolved
|
|
||
| @Nullable | ||
| // Construct DataFile -> DeletionFile based on IndexFileMeta | ||
| public Map<String, DeletionFile> extractDeletionFileByMeta( |
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.
Remove public and add @VisibleForTesting.
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.
remove public will lead to compilation problems
| DELETION_VECTORS_INDEX, | ||
| partitionBuckets.stream().map(Pair::getLeft).collect(Collectors.toSet())); | ||
| Map<Pair<BinaryRow, Integer>, Map<String, DeletionFile>> result = new HashMap<>(); | ||
| partitionBuckets.forEach( |
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.
Just use partitionFileMetas.forEach?
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.
I think unnecessary buckets need to be filtered out?
paimon-core/src/main/java/org/apache/paimon/index/IndexFileHandler.java
Outdated
Show resolved
Hide resolved
paimon-core/src/main/java/org/apache/paimon/index/IndexFileHandler.java
Outdated
Show resolved
Hide resolved
paimon-core/src/main/java/org/apache/paimon/index/IndexFileHandler.java
Outdated
Show resolved
Hide resolved
paimon-core/src/main/java/org/apache/paimon/index/IndexFileHandler.java
Outdated
Show resolved
Hide resolved
paimon-core/src/main/java/org/apache/paimon/utils/DVMetaCache.java
Outdated
Show resolved
Hide resolved
paimon-core/src/main/java/org/apache/paimon/utils/DVMetaCache.java
Outdated
Show resolved
Hide resolved
|
|
||
| public DVMetaCache(long maxElementSize) { | ||
| this.cache = | ||
| Caffeine.newBuilder().maximumSize(maxElementSize).executor(Runnable::run).build(); |
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 it be set to max number of DVMetaCacheValue? And use softValues?
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.
I've added softValues. Do you mean to use List<DVMetaCacheValue> as the weight? I think the List might be empty, and those cache items won't be restricted because of the 0 weight
Purpose
In high-concurrency point query scenarios on the primary key table, we observed high CPU usage mainly caused by deserialization overhead of DV metadata. Currently, reading deletion vector metadata for a single bucket requires reading and deserializing a large number of entries from the index manifest, if the table has many partition and buckets.

This PR introduces a bucket-level dv meta cache which reduces CPU load and significantly improves QPS for single-bucket query scenarios on primary key tables.
Tests
API and Format
Documentation