提交 f553280c 编写于 作者: O obdev 提交者: wangzelin.wzl

fix unit migrate and add replica concurrent, unit is wait gc and has ls leader

上级 c6a74eed
......@@ -1213,9 +1213,7 @@ bool ObMultiTenant::is_available_tenant(uint64_t tenant_id) const
if (OB_SUCCESS == ret && NULL != tenant) {
if (tenant->get_create_status() == ObTenantCreateStatus::CREATE_COMMIT) {
ObUnitInfoGetter::ObUnitStatus unit_status = tenant->get_unit().unit_status_;
if (unit_status == ObUnitInfoGetter::UNIT_NORMAL || unit_status == ObUnitInfoGetter::UNIT_MIGRATE_IN || unit_status == ObUnitInfoGetter::UNIT_MIGRATE_OUT) {
available = true;
}
available = share::ObUnitInfoGetter::is_valid_tenant(unit_status);
}
}
return available;
......
......@@ -44,6 +44,13 @@ public:
UNIT_ERROR_STAT,
};
static const char* get_unit_status_str(const ObUnitStatus status) { return unit_status_strs_[status]; }
//UNIT_NORMAL or UNIT_MIGRATE_IN or UNIT_MIGRATE_OUT is valid tenant,
//UNIT_MARK_DELETING, // mark deleting in __all_unit, unit is shrink, ls need migrate
//UNIT_WAIT_GC_IN_OBSERVER, // already deleted in __all_unit, but The migration or replica will be concurrent with the unit migration, and although RS has deemed it ready for deletion, there may be migration tasks and replica tasks executing concurrently, resulting in a log stream on the unit, so it is also valid to be in this state
static bool is_valid_tenant(const ObUnitStatus status)
{
return UNIT_DELETING_IN_OBSERVER != status && UNIT_ERROR_STAT != status;
}
struct ObTenantConfig
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册