Skip to content

Commit

Permalink
Increase default delta.metadata.cache-ttl to 30m
Browse files Browse the repository at this point in the history
TTL can be higher because the cached metadata is immutable
and the space occupied by it in memory is accounted for
  • Loading branch information
raunaqmorarka committed Dec 13, 2024
1 parent dd68eca commit af3a6f3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions docs/src/main/sphinx/connector/delta-lake.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,8 @@ values. Typical usage does not require you to configure them.
- Description
- Default
* - `delta.metadata.cache-ttl`
- Frequency of checks for metadata updates equivalent to transactions to
update the metadata cache specified in [](prop-type-duration).
- `5m`
- Caching duration for Delta Lake tables metadata.
- `30m`
* - `delta.metadata.cache-max-retained-size`
- Maximum retained size of Delta table metadata stored in cache. Must be
specified in [](prop-type-data-size) values such as `64MB`. Default is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class DeltaLakeConfig
@VisibleForTesting
static final DataSize DEFAULT_METADATA_CACHE_MAX_RETAINED_SIZE = DataSize.succinctBytes(Math.floorDiv(Runtime.getRuntime().maxMemory(), 20L));

private Duration metadataCacheTtl = new Duration(5, TimeUnit.MINUTES);
private Duration metadataCacheTtl = new Duration(30, TimeUnit.MINUTES);
private DataSize metadataCacheMaxRetainedSize = DEFAULT_METADATA_CACHE_MAX_RETAINED_SIZE;
private DataSize dataFileCacheSize = DEFAULT_DATA_FILE_CACHE_SIZE;
private Duration dataFileCacheTtl = new Duration(30, TimeUnit.MINUTES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void testDefaults()
assertRecordedDefaults(recordDefaults(DeltaLakeConfig.class)
.setDataFileCacheSize(DeltaLakeConfig.DEFAULT_DATA_FILE_CACHE_SIZE)
.setDataFileCacheTtl(new Duration(30, MINUTES))
.setMetadataCacheTtl(new Duration(5, TimeUnit.MINUTES))
.setMetadataCacheTtl(new Duration(30, TimeUnit.MINUTES))
.setMetadataCacheMaxRetainedSize(DeltaLakeConfig.DEFAULT_METADATA_CACHE_MAX_RETAINED_SIZE)
.setDomainCompactionThreshold(1000)
.setMaxSplitsPerSecond(Integer.MAX_VALUE)
Expand Down

0 comments on commit af3a6f3

Please sign in to comment.