uchenily commented on code in PR #61240:
URL: https://github.com/apache/doris/pull/61240#discussion_r2922278037
##########
be/src/agent/task_worker_pool.cpp:
##########
@@ -1786,25 +1785,37 @@ void create_tablet_callback(StorageEngine& engine,
const TAgentTaskRequest& req)
increase_report_version();
// get path hash of the created tablet
TabletSharedPtr tablet;
+ std::string error_msg;
{
SCOPED_TIMER(ADD_TIMER(profile, "GetTablet"));
- tablet =
engine.tablet_manager()->get_tablet(create_tablet_req.tablet_id);
+ tablet =
engine.tablet_manager()->get_tablet(create_tablet_req.tablet_id, false,
+ &error_msg);
+ }
+
+ if (tablet) {
+ TTabletInfo tablet_info;
+ tablet_info.tablet_id = tablet->tablet_id();
+ tablet_info.schema_hash = tablet->schema_hash();
+ tablet_info.version = create_tablet_req.version;
+ // Useless but it is a required field in TTabletInfo
+ tablet_info.version_hash = 0;
+ tablet_info.row_count = 0;
+ tablet_info.data_size = 0;
+ tablet_info.__set_path_hash(tablet->data_dir()->path_hash());
+ tablet_info.__set_replica_id(tablet->replica_id());
+ finish_tablet_infos.push_back(tablet_info);
+ LOG_INFO("successfully create tablet")
+ .tag("signature", req.signature)
+ .tag("tablet_id", create_tablet_req.tablet_id);
+ } else {
+ status = Status::NotFound("failed to get tablet, reason={}",
error_msg);
+
DorisMetrics::instance()->create_tablet_requests_failed->increment(1);
+ LOG_WARNING("created tablet is missing before finishing create
task, reason={}",
+ status.to_string())
+ .tag("signature", req.signature)
+ .tag("tablet_id", create_tablet_req.tablet_id)
+ .error(status);
}
Review Comment:
The log of the issue is no longer available. The following is an analysis of
the possible causes from the code:
case1. tablet has been deleted
another task is executing `drop_tablet_callback` (maybe related to
TabletScheduler or ReportHandler), and before executing get_tablet, the tablet
has already been deleted.
case2. tablet is in an unavailable state (tablet->is_used() == false)
two specific situations for this:
1. The tablet is already in a bad state (_is_bad == true).
2. An IO_ERROR occurred during a health check in the directory
(DataDir::health_check).
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]