Skip to content

[core] Keep recent deletion vectors in the lookup file cache - #1594

Open
JeonDaehong wants to merge 1 commit into
apache:mainfrom
JeonDaehong:lookup-dv-cache
Open

JeonDaehong wants to merge 1 commit into
apache:mainfrom
JeonDaehong:lookup-dv-cache

Conversation

@JeonDaehong

Copy link
Copy Markdown
Contributor

Purpose

In deletion-vector mode, lookup compaction checks each hit against the deletion vector of the file it came from. LookupFileCache kept one vector, so when consecutive keys hit files in different levels, every switch read the vector from the index file and decoded it again. With the default local-cache.whitelist (meta,global-index) those reads go to storage.

Brief change log

  • Keep the recently used deletion vectors, least recently used first, bounded by the same budget that bounded the single vector.
  • A hit on the most recent vector, the common case, does not move anything.

Tests

deletion_vectors_of_alternating_files_stay_cached reads two vectors, deletes the index file, and checks both again in turn. It fails on main because the second vector replaced the first.

Measured on c7i.8xlarge with local files: 1M keys, deletion vectors on, then 8 rounds of updating a random share of the keys and compacting. Main and this branch alternated 3 times, and the table reads hash the same on both.

updates per round num-sorted-run.compaction-trigger vector reads, main → PR compaction, main this PR
10% 5 77,475 → 8 68.8–69.8 s 33.8–34.0 s
1% 5 2,990 → 13 8.91–8.93 s 7.57–7.58 s
30% 5 3 → 3 30.77–30.85 s 30.66–30.76 s
10% 2 5 → 5 7.68–7.71 s 7.65–7.67 s

In the first shape the re-reads come from the rounds where several levels already carry deletion vectors (40,900 and 36,571 reads in rounds 6 and 7). On object storage each of those is a GET. The last two shapes compact everything each round, so they don't switch files and stay the same.

API and Format

No public API or storage format changes.

Documentation

None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant