Skip to content

Serve the canonical empty digest in DedupStore::get_part - #3012

Merged
matdexir merged 9 commits into
mainfrom
fix-dedup-zero-digest
Nov 16, 2026
Merged

matdexir merged 9 commits into
mainfrom
fix-dedup-zero-digest

Conversation

@matdexir

Copy link
Copy Markdown
Contributor

What and why

Uncovered by the store topology conformance harness (#3010):

Since #2974, DedupStore::update skips writing a DedupIndex entry for the canonical zero-byte digest (is_zero_digest), and DedupStore::has_with_results reports Some(0) for it. However, DedupStore::get_part only short-circuited when length == Some(0), so an unbounded read (get_part(zero_digest, 0, None)) attempted to fetch and deserialize an index entry from index_store and failed with Code::Internal.

DedupStore::get_part now also checks is_zero_digest(key.borrow()) and immediately sends EOF, matching FilesystemStore, CompressionStore, and DedupStore::update.

How was this verified?

Extended empty_cas_upload_does_not_publish_dedup_index in nativelink-store/tests/dedup_store_test.rs to assert has(digest) == Some(0) and get_part_unchunked(digest, 0, None) == Bytes::new() for all ZERO_BYTE_DIGESTS. Without the change in dedup_store.rs, get_part_unchunked fails trying to read the missing index entry; with the change, it succeeds.

Risk

Low. Only affects reads of the canonical zero-byte digest on DedupStore.

AI assistance

Found via the store conformance harness and drafted with Cursor Agent; reviewed and verified.

@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nativelink Ready Ready Preview Nov 16, 2026 3:05pm UTC
nativelink-aidm Ready Ready Preview Nov 16, 2026 3:05pm UTC

Request Review

Comment thread nativelink-store/src/dedup_store.rs Resolved
@matdexir
matdexir had a problem deploying to cluster-ci-benchmark November 8, 2026 09:49 — with GitHub Actions Failure
@palfrey
palfrey temporarily deployed to cluster-ci-benchmark November 16, 2026 15:07 — with GitHub Actions Inactive
@matdexir
matdexir merged commit ab39fb8 into main Nov 16, 2026
25 checks passed
@matdexir
matdexir deleted the fix-dedup-zero-digest branch November 16, 2026 15:50

This branch was successfully deployed

2 active and 1 inactive deployments
cluster-ci-benchmark — d1d2ee67 Deployed Nov 16, 2026 by palfrey via NativeLink / Linux (PR) #758
Preview – nativelink — d1d2ee67 Deployed Nov 16, 2026 by vercel[bot]
Preview – nativelink-aidm — d1d2ee67 Deployed Nov 16, 2026 by vercel[bot]
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.

3 participants