caiconghui commented on a change in pull request #8486:
URL: https://github.com/apache/incubator-doris/pull/8486#discussion_r828818253
##########
File path: be/src/olap/schema_change.cpp
##########
@@ -1404,22 +1404,25 @@ SchemaChangeHandler::~SchemaChangeHandler() {
OLAPStatus SchemaChangeHandler::process_alter_tablet_v2(const
TAlterTabletReqV2& request) {
LOG(INFO) << "begin to do request alter tablet: base_tablet_id=" <<
request.base_tablet_id
- << ", base_schema_hash=" << request.base_schema_hash
<< ", new_tablet_id=" << request.new_tablet_id
- << ", new_schema_hash=" << request.new_schema_hash
<< ", alter_version=" << request.alter_version;
+ TabletSharedPtr base_tablet =
StorageEngine::instance()->tablet_manager()->get_tablet(
+ request.base_tablet_id, request.base_schema_hash);
+ if (base_tablet == nullptr) {
+ LOG(WARNING) << "fail to find base tablet. base_tablet=" <<
request.base_tablet_id;
+ return OLAP_ERR_TABLE_NOT_FOUND;
+ }
// Lock schema_change_lock util schema change info is stored in tablet
header
- if (!StorageEngine::instance()->tablet_manager()->try_schema_change_lock(
- request.base_tablet_id)) {
+ std::unique_lock schema_change_lock(base_tablet->get_schema_change_lock(),
std::try_to_lock);
+ if (!schema_change_lock.owns_lock()) {
LOG(WARNING) << "failed to obtain schema change lock. "
<< "base_tablet=" << request.base_tablet_id;
- return OLAP_ERR_TRY_LOCK_FAILED;
+ return OLAP_ERR_RWLOCK_ERROR;
Review comment:
why change this?
--
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]