Re: Fwd: New Version Notification for draft-toomim-httpbis-versions-02.txt

On 10/30/24 2:31 AM, Julian Reschke wrote:
> On 30.10.2024 03:50, Michael Toomim wrote:
>> I agree that either 3xx or 4xx could work. I considered using a 4xx when
>> writing the draft.
>>
>> The reason I chose 3xx is that there is a strong sense in which "Version
>> Unknown Here" is not an error, but is just a redirection. We are
>> building for a P2P world in which we expect peers to independently
>> choose how much history to store, and which versions to drop, knowing
>> that other peers probably store them. So the process of requesting a
>> version in a P2P network can involve asking around at lots of peers
>> before you find the old history you are looking for. Thus, the request
>> involves lots of redirection as it pokes around the network, which makes
>> "Version Unknown Here" a redirection like 301, 302, 303, 305, 306, 307,
>> and 308. The request does not conceptually finish until the client finds
>> the version, or gives up.
>
> So does the server know the new Location? In which case why not use an
> existing 3xx?

No, it does not know where the version is stored. As I said above, the 
process can involve asking around at lots of peers before you find the 
history you are looking for.

One common way to store history is with a distributed hash table. 
Another way is to subscribe to a set of archive nodes. Perhaps the 
client will go to https://archive.org to request the desired history. 
Perhaps it loads its own tape storage. It's not up to the server to 
prescribe how the client retrieves this history—the server (or cache) 
just needs to report that it doesn't have that version.

Another use-case for this status code is running a client-side cache on 
your local network to store important remote state in case your network 
goes offline. Imagine you're on a boat, and you run a local HTTP proxy 
that stores important state. When you reconnect to wifi (say at port), 
you can sync up with the servers, but in the interim, your proxy will be 
holding a partial cache of history. Your proxy will need to be able to 
respond "309 Version Unknown Here" when it doesn't have a version.

Perhaps we should name it more explicitly "309 Version Unknown Here and 
Now" because any peer might load or lose history at any point.

>> On the other hand, both 404 and 410 are unambiguous errors — the client
>> is requesting something that plainly does not exist. The request ends as
>> soon as the 4xx error is received by the client. Caches can store 4xx
>> responses (except 407).
>
> It doesn't exist, after all. And yes, caches can store it (with expiry
> information). Why would that be incorrect?


It *does* exist. It just doesn't exist on that server, at that time. 
That's why it says the code is "Unknown Here" not "Unknown Everywhere".

>> A 3xx says "I don't know, ask around." A 4xx says "I *know* that this
>> doesn't exist."
>
> Actually, 3xx usually means: it's not "here", please look "there".


Yes, and the semantics we need for this code is "It's not *here*, please 
keep looking."

Thanks, Julian.

Michael

Received on Friday, 1 November 2024 01:31:28 UTC