Skip to content

Refetch container on newer client revision in object service - #4262

Draft
roman-khimov with Copilot wants to merge 2 commits into
masterfrom
copilot/try-fetch-newer-container-revision
Draft

roman-khimov with Copilot wants to merge 2 commits into
masterfrom
copilot/try-fetch-newer-container-revision

Conversation

Copilot AI commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

A gateway can hold a newer container revision than a storage node. Because the node's cache is stale, it rejects the request with ContainerRevisionMismatch. This change makes the node refetch the container when a request carries a higher revision than the one it has cached.

  • Object service (pkg/services/object/common.go)

    • If the client's revision is greater than the server's, checkContainerRevision resets the cached container and reads it again from the FS chain before comparing.
    • A mismatch is still returned if the fresh revision differs from the client's, for example when the client's revision is ahead of the chain.
    • The reset goes through an optional interface assertion on fsChain. The FSChain interface and its mocks are unchanged.
  • Node wiring (cmd/neofs-node/object.go)

    • fsChainForObjects.ResetContainer clears the entry in the container TTL cache (resetContainer). It does nothing if the container source isn't cached.
  • Container service

    • No change. It reads containers through an uncached path, so it already sees the latest revision.
  • Abuse risk

    • A client sending a revision above the node's can force a cache drop and a chain read on every such request. I added no rate limiting. The issue accepts this tradeoff because a node isn't obliged to cache container data. Say if you want a guard.
    • The patch adds no new tests.

Co-authored-by: roman-khimov <22092804+roman-khimov@users.noreply.github.com>
Copilot AI changed the title [WIP] Try to fetch newer container revision in requests Refetch container on newer client revision in object service Oct 29, 2026
Copilot AI requested a review from roman-khimov October 29, 2026 20:34

This branch has not been deployed

No deployments
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.

Try to fetch newer container revision in case a request has it

2 participants