bunchesofdonald commented on PR #8517:
URL: https://github.com/apache/opendal/pull/8517#issuecomment-7107251836

   Thanks for the review. All three are addressed in ee06713:
   
   1. `GcsConditionalWriter` generates two `X-Goog-Gcs-Idempotency-Token` 
values when it is built, one for the single-request insert and one for 
resumable session creation, and reuses each on every retry. They are separate 
because Google's parameters doc says to use a different value for different 
requests. A retried `close()` inside GCS's dedup window (about a minute) now 
gets the original response; after the window it still gets 412 and 
`ConditionNotMatch`, which 
`retry_close_after_dedup_window_reports_precondition_failure` covers. Reusing 
one token across 5xx retries matches Google's own Go client, which creates one 
invocation ID before its retry loop.
   2. `gcs_insert_object_request` returns a request-build error for an invalid 
`content_type`, as the resumable path does. The metadata serialization `expect` 
in the same function now returns an error too.
   3. The mock now fails `ifGenerationNotMatch` on a missing object with 412 
and answers a matching `ifGenerationNotMatch` with 304. Google's docs say the 
precondition fails on a missing object but don't give the status, so I checked 
it against real GCS: 412.
   
   Real GCS, versioned bucket, user credentials, tested at 35673f9 (ee06713 
differs only in one added unit-test assertion; `core.rs` and the non-test part 
of `writer.rs` are byte-identical):
   
   - `OPENDAL_TEST=gcs cargo test --test behavior --features tests,services-gcs 
-- if_`: 28 passed, 0 failed
   - `... -- version`: 23 passed, 0 failed
   - Direct inserts on a missing object: `ifGenerationNotMatch=12345` → 412, 
`ifGenerationMatch=12345` → 412, `ifGenerationMatch=0` → 200. GCS accepted the 
idempotency header on these requests.
   
   One thing outside this change: the mock doesn't evaluate preconditions when 
it creates a resumable session, only on the single-request insert, so the 
resumable path's mock is still looser than GCS. That predates this PR; happy to 
follow up separately if you want it.
   


-- 
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