JingsongLi commented on code in PR #8412:
URL: https://github.com/apache/paimon/pull/8412#discussion_r3519286477
##########
paimon-api/src/main/java/org/apache/paimon/rest/HttpClientUtils.java:
##########
@@ -107,8 +112,7 @@ public static boolean exists(String uri) throws IOException
{
}
int rangeStatusCode = getRangeStatusCode(uri);
if (rangeStatusCode == HttpStatus.SC_OK
- || rangeStatusCode == HttpStatus.SC_PARTIAL_CONTENT
- || rangeStatusCode ==
HttpStatus.SC_REQUESTED_RANGE_NOT_SATISFIABLE) {
+ || rangeStatusCode == HttpStatus.SC_PARTIAL_CONTENT) {
Review Comment:
Dropping `SC_REQUESTED_RANGE_NOT_SATISFIABLE` here regresses the zero-length
object case. For a GET-only server, `HEAD` may be rejected, and a `Range:
bytes=0-0` probe against an empty object legitimately returns 416, which was
the reason for the old branch and
`testExistsTreatsEmptyResourceAsExistingWhenRangeReturns416`. With this change
`blob-write-null-on-missing-file`/descriptor pre-checks throw for an existing
empty HTTP BLOB instead of treating it as present. Please keep 416 as an
existing resource and restore the regression test.
--
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]