airborne12 commented on code in PR #37880: URL: https://github.com/apache/doris/pull/37880#discussion_r1680224083
########## be/src/http/action/calc_file_crc_action.cpp: ########## @@ -58,16 +59,28 @@ Status CalcFileCrcAction::_handle_calc_crc(HttpRequest* req, uint32_t* crc_value return Status::InternalError("convert tablet id or failed, {}", e.what()); } - TabletSharedPtr tablet = _engine.tablet_manager()->get_tablet(tablet_id); + BaseTabletSPtr tablet = nullptr; + + if (auto cloudEngine = dynamic_cast<CloudStorageEngine*>(&_engine)) { + tablet = DORIS_TRY(cloudEngine->get_tablet(tablet_id)); + // sync all rowsets + RETURN_IF_ERROR(std::dynamic_pointer_cast<CloudTablet>(tablet)->sync_rowsets(-1)); + } else if (auto storageEngine = dynamic_cast<StorageEngine*>(&_engine)) { + auto tabletPtr = storageEngine->tablet_manager()->get_tablet(tablet_id); + tablet = std::dynamic_pointer_cast<Tablet>(tabletPtr); + } else { + return Status::InternalError("convert _engine failed"); + } + if (tablet == nullptr) { - return Status::NotFound("Tablet not found. tablet_id={}", tablet_id); + return Status::NotFound("failed to get tablet {}", tablet_id); } const auto& req_start_version = req->param(PARAM_START_VERSION); const auto& req_end_version = req->param(PARAM_END_VERSION); *start_version = 0; - *end_version = tablet->max_version().second; + *end_version = tablet->max_version_unlocked(); Review Comment: for what reason? -- 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