Revert Fix transfer out and then tranfer in restart replay clog bug
This commit is contained in:
@ -1444,7 +1444,6 @@ int ObLS::replay_get_tablet_no_check(const common::ObTabletID &tablet_id,
|
||||
LOG_WARN("failed to get tablet", K(ret), K(key));
|
||||
} else if (scn <= tablet_change_checkpoint_scn) {
|
||||
LOG_WARN("tablet already gc", K(ret), K(key), K(scn), K(tablet_change_checkpoint_scn));
|
||||
ret = OB_OBSOLETE_CLOG_NEED_SKIP;
|
||||
} else if (OB_FAIL(MTL(ObLogService*)->get_log_replay_service()->get_max_replayed_scn(ls_meta_.ls_id_, max_scn))) {
|
||||
LOG_WARN("failed to get_max_replayed_scn", KR(ret), K_(ls_meta), K(scn), K(tablet_id));
|
||||
}
|
||||
@ -1463,7 +1462,6 @@ int ObLS::replay_get_tablet_no_check(const common::ObTabletID &tablet_id,
|
||||
LOG_INFO("tablet does not exist, but need retry", KR(ret), K(key), K(scn), K(tablet_change_checkpoint_scn), K(max_scn));
|
||||
} else {
|
||||
LOG_INFO("tablet already gc, but scn is more than tablet_change_checkpoint_scn", KR(ret), K(key), K(scn), K(tablet_change_checkpoint_scn), K(max_scn));
|
||||
ret = OB_OBSOLETE_CLOG_NEED_SKIP;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1481,25 +1479,18 @@ int ObLS::replay_get_tablet(const common::ObTabletID &tablet_id,
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObTabletHandle tablet_handle;
|
||||
ObTablet *tablet = nullptr;
|
||||
|
||||
if (IS_NOT_INIT) {
|
||||
ret = OB_NOT_INIT;
|
||||
LOG_WARN("ls is not inited", KR(ret));
|
||||
} else if (OB_FAIL(replay_get_tablet_no_check(tablet_id, scn, tablet_handle))) {
|
||||
LOG_WARN("failed to get tablet", K(ret), K(tablet_id), K(ls_meta_.ls_id_));
|
||||
} else if (OB_ISNULL(tablet = tablet_handle.get_obj())) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("tablet should not be NULL", K(ret), K(tablet_id), K(scn));
|
||||
} else {
|
||||
ObTabletStatus::Status tablet_status = ObTabletStatus::MAX;
|
||||
ObTabletCreateDeleteMdsUserData data;
|
||||
bool is_commited = false;
|
||||
if (tablet_id.is_ls_inner_tablet()) {
|
||||
// do nothing
|
||||
} else if (tablet->get_clog_checkpoint_scn() >= scn) {
|
||||
ret = OB_OBSOLETE_CLOG_NEED_SKIP;
|
||||
LOG_WARN("replay scn is smaller than tablet clog checkpoint scn, need skip", K(ret), KPC(tablet), K(scn));
|
||||
} else if (OB_FAIL(tablet_handle.get_obj()->ObITabletMdsInterface::get_latest_tablet_status(data, is_commited))) {
|
||||
if (OB_EMPTY_RESULT == ret) {
|
||||
LOG_WARN("rewrite errcode to EAGAIN", KR(ret), K(tablet_id), K(ls_meta_.ls_id_));
|
||||
@ -1508,21 +1499,18 @@ int ObLS::replay_get_tablet(const common::ObTabletID &tablet_id,
|
||||
LOG_WARN("failed to get CreateDeleteMdsUserData", KR(ret), K(tablet_id), K(ls_meta_.ls_id_));
|
||||
}
|
||||
} else if (FALSE_IT(tablet_status = data.get_tablet_status())) {
|
||||
} else if (tablet->is_empty_shell()) {
|
||||
if (ObTabletStatus::DELETED != tablet_status
|
||||
&& ObTabletStatus::TRANSFER_OUT_DELETED != tablet_status) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_ERROR("tablet is empty shell but tablet status is not deleted or transfer out deleted",
|
||||
KR(ret), K(tablet_id), K(ls_meta_.ls_id_), K(scn), K(tablet_status));
|
||||
} else {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_ERROR("tablet is already be empty shell but still has data clog", KR(ret), K(tablet_id), K(ls_meta_.ls_id_), K(scn));
|
||||
}
|
||||
} else if (ObTabletStatus::NORMAL == tablet_status
|
||||
|| ObTabletStatus::TRANSFER_OUT == tablet_status
|
||||
|| ObTabletStatus::TRANSFER_IN == tablet_status) {
|
||||
// do nothing
|
||||
} else if (ObTabletStatus::DELETED == tablet_status
|
||||
|| ObTabletStatus::TRANSFER_OUT_DELETED == tablet_status) {
|
||||
// tablet shell
|
||||
ret = OB_TABLET_NOT_EXIST;
|
||||
LOG_INFO("tablet is already deleted", KR(ret), K(tablet_id), K(ls_meta_.ls_id_), K(scn));
|
||||
} else {
|
||||
//There will be cases when the mds has been persisted but the clog_checkpoint_scn is still relatively small.
|
||||
//There is no problem with primary database, but for the standby database, the read timestamp of tenant's
|
||||
//standby machine is relatively small but no valid data can be read because the data is filtered when skip
|
||||
//ObTabletStatus::DELETED == tablet_status or ObTabletStatus::TRANSFER_OUT_DELETED == tablet_status
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_INFO("invalid status", KR(ret), K(tablet_id), K(ls_meta_.ls_id_), K(tablet_status), K(scn));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user