Revert iter object by upper layer
This commit is contained in:
committed by
wangzelin.wzl
parent
790775ee68
commit
3c66d1a97b
@ -711,7 +711,7 @@ void ObLSTabletService::report_tablet_to_rs(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int ObLSTabletService::table_scan(ObTableScanIterator &iter, ObTableScanParam ¶m, ObNewRowIterator *&result)
|
int ObLSTabletService::table_scan(ObTableScanIterator &iter, ObTableScanParam ¶m)
|
||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
NG_TRACE(S_table_scan_begin);
|
NG_TRACE(S_table_scan_begin);
|
||||||
@ -737,16 +737,13 @@ int ObLSTabletService::table_scan(ObTableScanIterator &iter, ObTableScanParam &p
|
|||||||
if (!is_same) {
|
if (!is_same) {
|
||||||
ret = OB_REPLICA_NOT_READABLE;
|
ret = OB_REPLICA_NOT_READABLE;
|
||||||
LOG_WARN("ls is not allow to read", K(ret), KPC(ls_), KP(&iter));
|
LOG_WARN("ls is not allow to read", K(ret), KPC(ls_), KP(&iter));
|
||||||
} else {
|
|
||||||
// result should be assigned at the last
|
|
||||||
result = &iter;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NG_TRACE(S_table_scan_end);
|
NG_TRACE(S_table_scan_end);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ObLSTabletService::table_rescan(ObTableScanParam ¶m, ObNewRowIterator *&result)
|
int ObLSTabletService::table_rescan(ObTableScanParam ¶m, ObNewRowIterator *result)
|
||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
NG_TRACE(S_table_rescan_begin);
|
NG_TRACE(S_table_rescan_begin);
|
||||||
|
|||||||
@ -275,11 +275,10 @@ public:
|
|||||||
// DAS interface
|
// DAS interface
|
||||||
int table_scan(
|
int table_scan(
|
||||||
ObTableScanIterator &iter,
|
ObTableScanIterator &iter,
|
||||||
ObTableScanParam ¶m,
|
ObTableScanParam ¶m);
|
||||||
common::ObNewRowIterator *&result);
|
|
||||||
int table_rescan(
|
int table_rescan(
|
||||||
ObTableScanParam ¶m,
|
ObTableScanParam ¶m,
|
||||||
common::ObNewRowIterator *&result);
|
common::ObNewRowIterator *result);
|
||||||
int insert_rows(
|
int insert_rows(
|
||||||
ObStoreCtx &ctx,
|
ObStoreCtx &ctx,
|
||||||
const ObDMLBaseParam &dml_param,
|
const ObDMLBaseParam &dml_param,
|
||||||
|
|||||||
@ -229,6 +229,8 @@ int ObAccessService::table_scan(
|
|||||||
} else if (OB_ISNULL(iter = common::sop_borrow(ObTableScanIterator))) {
|
} else if (OB_ISNULL(iter = common::sop_borrow(ObTableScanIterator))) {
|
||||||
ret = OB_ERR_UNEXPECTED;
|
ret = OB_ERR_UNEXPECTED;
|
||||||
LOG_WARN("alloc table scan iterator fail", K(ret));
|
LOG_WARN("alloc table scan iterator fail", K(ret));
|
||||||
|
} else if (FALSE_IT(result = iter)) {
|
||||||
|
// upper layer responsible for releasing iter object
|
||||||
} else if (OB_FAIL(check_read_allowed_(ls_id,
|
} else if (OB_FAIL(check_read_allowed_(ls_id,
|
||||||
data_tablet_id,
|
data_tablet_id,
|
||||||
access_type,
|
access_type,
|
||||||
@ -243,15 +245,11 @@ int ObAccessService::table_scan(
|
|||||||
} else if (OB_ISNULL(tablet_service = ls->get_tablet_svr())) {
|
} else if (OB_ISNULL(tablet_service = ls->get_tablet_svr())) {
|
||||||
ret = OB_ERR_UNEXPECTED;
|
ret = OB_ERR_UNEXPECTED;
|
||||||
LOG_ERROR("tablet service should not be null.", K(ret), K(ls_id));
|
LOG_ERROR("tablet service should not be null.", K(ret), K(ls_id));
|
||||||
} else if (OB_FAIL(tablet_service->table_scan(*iter, param, result))) {
|
} else if (OB_FAIL(tablet_service->table_scan(*iter, param))) {
|
||||||
LOG_WARN("Fail to scan table, ", K(ret), K(ls_id), K(param));
|
LOG_WARN("Fail to scan table, ", K(ret), K(ls_id), K(param));
|
||||||
} else {
|
} else {
|
||||||
NG_TRACE(storage_table_scan_end);
|
NG_TRACE(storage_table_scan_end);
|
||||||
}
|
}
|
||||||
if (OB_FAIL(ret) && OB_NOT_NULL(iter)) {
|
|
||||||
iter->reset();
|
|
||||||
common::sop_return(ObTableScanIterator, iter);
|
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user