Re: [PATCH v2 3/5] odb/source: let callers discern missing and corrupt objects

Patrick Steinhardt <[email protected]>
Newsgroups org.kernel.vger.git
Message-ID <[email protected]>
On Thu, Aug 20, 2026 at 05:09:51PM -0400, Karthik Nayak wrote:
> Patrick Steinhardt <[email protected]> writes:
> > On Thu, Aug 20, 2026 at 08:56:50AM -0400, Karthik Nayak wrote:
> Oops. Thanks for the detailed response.
> 
> I think I made my case in reverse, but my original argument still
> holds.
> 
> ret_packed   ret_loose    ret_packed != NOT_FOUND ?   returned
> -----------  -----------  ---------------------------  -----------------
> NOT_FOUND    NOT_FOUND    false                        ret_loose (NOT_FOUND)
> NOT_FOUND    ERROR        false                        ret_loose  (ERROR)
> ERROR        NOT_FOUND    true                         ret_packed (ERROR)
> ERROR        ERROR        true                         ret_packed (ERROR)
> 
> So since we return ret_loose as many times as ret_packed. The comment:
> 
> > and prefer the error of the packed source in case both reads have
> > failed.
> 
> isn't true entirely. So isn't it better modified to something like
> "prefer other errors over not found errors" or something. I hope that
> makes sense?

But we don't. As your above table shows, we return errors twice from the
packed backend and only once from the loose backend. And in case both
sources returned an error, we prefer the packed one.

I think where we're talking past one another is that I distinguish
between errors (-1) and NOT_FOUND.

Patrick
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.