ByteYue commented on code in PR #35396: URL: https://github.com/apache/doris/pull/35396#discussion_r1650948661
########## be/src/io/fs/s3_file_reader.cpp: ########## @@ -113,23 +120,85 @@ Status S3FileReader::read_at_impl(size_t offset, Slice result, size_t* bytes_rea if (!client) { return Status::InternalError("init s3 client error"); } - // clang-format off - auto resp = client->get_object( { .bucket = _bucket, .key = _key, }, - to, offset, bytes_req, bytes_read); - // clang-format on - if (resp.status.code != ErrorCode::OK) { - return std::move(Status(resp.status.code, std::move(resp.status.msg)) - .append(fmt::format("failed to read from {}", _path.native()))); + // // clang-format off + // auto resp = client->get_object( { .bucket = _bucket, .key = _key, }, + // to, offset, bytes_req, bytes_read); + // // clang-format on + // if (resp.status.code != ErrorCode::OK) { + // return std::move(Status(resp.status.code, std::move(resp.status.msg)) + // .append(fmt::format("failed to read from {}", _path.native()))); + // } + // if (*bytes_read != bytes_req) { + // return Status::InternalError("failed to read from {}(bytes read: {}, bytes req: {})", + // _path.native(), *bytes_read, bytes_req); + SCOPED_BVAR_LATENCY(s3_bvar::s3_get_latency); + + int retry_count = 0; + const int base_wait_time = config::s3_read_base_wait_time_ms; // Base wait time in milliseconds + const int max_wait_time = config::s3_read_max_wait_time_ms; // Maximum wait time in milliseconds + const int max_retries = config::max_s3_client_retry; // wait 1s, 2s, 4s, 8s for each backoff + + int total_sleep_time = 0; + while (retry_count <= max_retries) { + s3_file_reader_read_counter << 1; + // clang-format off + auto resp = client->get_object( { .bucket = _bucket, .key = _key, }, Review Comment: ```suggestion { SCOPED_BVAR_LATENCY(s3_bvar::s3_get_latency); auto resp = client->get_object( { .bucket = _bucket, .key = _key, }, } ``` -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org