masaori335 opened a new pull request, #13475:
URL: https://github.com/apache/trafficserver/pull/13475

     ## Motivation
   
     A sliced PURGE only removed the blocks before the first gap. The walk 
stopped at
     the first block that was not in cache, so any object whose cached blocks 
were not
     a contiguous run from block 0 was partially purged — and the client still 
got a
     `200`. A gap in the middle left every block behind it cached; an uncached 
first
     block purged nothing and relayed that block's `404`; and `bytes=-N` 
deleted the
     head while leaving the tail it had named.
   
     The stop was load-bearing rather than a stray early return: the walk's 
only other
     terminator needs the object length, which slice learns from a `206`'s
     `Content-Range`, and a PURGE response has none.
   
     ## Changes
   
     **ATS core** — report the purged object's extent as 
`X-Purged-Content-Range` on a
     PURGE cache hit, so a caller holding one piece of a larger resource can 
learn its
     extent. Deliberately not `Content-Range`: on a `200` that is meaningless 
under RFC
     9110, and `cache_range_requests` reads the pair as a stored `206` being 
served as
     `200` and rewrites the status.
   
     **Slice plugin** — give PURGE its own state machine, so it no longer 
routes through
     `handleFirstServerHeader` and cannot leak a block's `404` to the client. 
It walks
     every block, steps over a `404`, takes the extent as the largest any block 
reports
     (blocks disagree when the origin object was replaced in place), and 
synthesizes the
     response only once the walk finishes: `200` if any block was removed, 
`404` if none.
     Until some block reports an extent the walk is bounded by 
`--purge-probe-blocks`
     (default 8), overridable per request via `--purge-probe-header`. A suffix 
range is
     widened to the whole object; an unparseable range is refused with `400`.
   
     ## Tests
   
     `slice_purge_gaps` covers the traversal over gaps, both open-ended range 
forms, the
     miss bound and its override, and the refusal. `slice_stale_generation` 
reproduces
     the client-visible failures of an origin object replaced in place, which 
is how
     this was found.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to