moq-archive: the reader confirms a prune when a missing object reads as forbidden (403)

Open
#10,298 2 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
70/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
backend, database

Research direction

Start with rs/moq-archive/src/consumer/index.rs at pruned, then trace the read failure handling in rs/moq-archive/src/consumer/track.rs around the cited load and serve_group locations. Add tests using rs/moq-archive/src/mock.rs's deny_missing for time lookup and exact-group fetch, plus a transient GET failure for a listed object. Done means missing keys are pruned, live keys remain indexed after transient failures, and the reader reports the original error when the listing still contains the key.

Written by the indexing model from the issue text.

Description

quest

Found by the retroactive Codex review of https://github.com/moq-dev/moq/pull/9918 (which made writes work on such stores) in https://github.com/moq-dev/moq/pull/10288, verified against main at a62650a98f.

Size: S. No public API or wire change.

Problem

On a store that refuses a GET of a missing key (a prefix-scoped B2 key returns 403; rs/moq-archive/src/mock.rs's deny_missing), moq-archive's reader refuses reads of pruned objects as Internal. It reconciles only Error::NotFound: in a time lookup, load turns any other error into Search::Failed (rs/moq-archive/src/consumer/track.rs:352-361), refused as Internal (track.rs:297-299); in an exact-group fetch, serve_group refuses as Internal and keeps the stale entry (track.rs:411-422), so every later reader fails too. This hits DVR pruning on a prefix-scoped B2 key.

Goal

A time lookup falls back to the history still kept, and an exact-group fetch drops the stale index entry.

Plan

Without matching on error kinds: after any object read failure, LIST and drop the index entry only when the listing lacks the key, reporting which case happened; otherwise keep the entry and return the original error.

Today's index::pruned (rs/moq-archive/src/consumer/index.rs:191-205) removes the entry before it lists and never adds it back, so a transient GET failure on a live object would drop it for good. Change pruned to list first and return whether it confirmed the prune, or add a helper that does.

Test with deny_missing for both a time lookup and an exact-group fetch, plus a transient GET failure on a listed object that keeps its index entry.

The fixing PR lists - [moq-dev/moq#9918](https://github.com/moq-dev/moq/pull/9918) - left the reader reconciling only NotFound, so a pruned object on a store that answers 403 refuses reads (found by reviewer) under ## Caused by.

(Written by Claude Opus 5.5)

Dominant language
Rust
Stars
1.6k
Forks
251
Avg merge
10h 10m
Merged PRs (30d)
822

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from moq-dev/moq

All issues in moq-dev/moq

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.