add parallelsim in session_longops view
This commit is contained in:
12
deps/oblib/src/lib/container/ob_mask_set2.h
vendored
12
deps/oblib/src/lib/container/ob_mask_set2.h
vendored
@ -52,9 +52,9 @@ public:
|
|||||||
public:
|
public:
|
||||||
int mask(const T &key)
|
int mask(const T &key)
|
||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
if (!is_inited_) {
|
if (!is_inited_) {
|
||||||
ret = OB_NOT_INIT;
|
ret = OB_NOT_INIT;
|
||||||
} else {
|
} else {
|
||||||
bool hit = false;
|
bool hit = false;
|
||||||
for (int64_t i = 0 ; OB_SUCCESS == ret && i < array_->count(); i++) {
|
for (int64_t i = 0 ; OB_SUCCESS == ret && i < array_->count(); i++) {
|
||||||
@ -114,9 +114,9 @@ public:
|
|||||||
tmp_new_mask = true;
|
tmp_new_mask = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (OB_SUCCESS == ret) {
|
if (OB_SUCCESS == ret) {
|
||||||
if (!hit) {
|
if (!hit) {
|
||||||
ret = OB_MASK_SET_NO_NODE;
|
ret = OB_MASK_SET_NO_NODE;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -728,7 +728,8 @@ int ObColumnRedefinitionTask::collect_longops_stat(ObLongopsValue &value)
|
|||||||
} else if (OB_FAIL(databuff_printf(stat_info_.message_,
|
} else if (OB_FAIL(databuff_printf(stat_info_.message_,
|
||||||
MAX_LONG_OPS_MESSAGE_LENGTH,
|
MAX_LONG_OPS_MESSAGE_LENGTH,
|
||||||
pos,
|
pos,
|
||||||
"STATUS: REPLICA BUILD, ROW_SCANNED: %ld, ROW_INSERTED: %ld",
|
"STATUS: REPLICA BUILD, PARALLELISM: %ld, ROW_SCANNED: %ld, ROW_INSERTED: %ld",
|
||||||
|
ObDDLUtil::get_real_parallelism(parallelism_, false/*is mv refresh*/),
|
||||||
row_scanned,
|
row_scanned,
|
||||||
row_inserted))) {
|
row_inserted))) {
|
||||||
LOG_WARN("failed to print", K(ret));
|
LOG_WARN("failed to print", K(ret));
|
||||||
|
|||||||
@ -1550,7 +1550,8 @@ int ObIndexBuildTask::collect_longops_stat(ObLongopsValue &value)
|
|||||||
if (OB_FAIL(databuff_printf(stat_info_.message_,
|
if (OB_FAIL(databuff_printf(stat_info_.message_,
|
||||||
MAX_LONG_OPS_MESSAGE_LENGTH,
|
MAX_LONG_OPS_MESSAGE_LENGTH,
|
||||||
pos,
|
pos,
|
||||||
"STATUS: REPLICA BUILD, ROW_SCANNED: %ld, ROW_SORTED: %ld, ROW_INSERTED_INTO_TMP_FILE: %ld, ROW_INSERTED: %ld out of %ld column group rows",
|
"STATUS: REPLICA BUILD, PARALLELISM: %ld, ROW_SCANNED: %ld, ROW_SORTED: %ld, ROW_INSERTED_INTO_TMP_FILE: %ld, ROW_INSERTED: %ld out of %ld column group rows",
|
||||||
|
ObDDLUtil::get_real_parallelism(parallelism_, false/*is mv refresh*/),
|
||||||
row_scanned,
|
row_scanned,
|
||||||
row_sorted,
|
row_sorted,
|
||||||
row_inserted_file,
|
row_inserted_file,
|
||||||
@ -1562,7 +1563,8 @@ int ObIndexBuildTask::collect_longops_stat(ObLongopsValue &value)
|
|||||||
if (OB_FAIL(databuff_printf(stat_info_.message_,
|
if (OB_FAIL(databuff_printf(stat_info_.message_,
|
||||||
MAX_LONG_OPS_MESSAGE_LENGTH,
|
MAX_LONG_OPS_MESSAGE_LENGTH,
|
||||||
pos,
|
pos,
|
||||||
"STATUS: REPLICA BUILD, ROW_SCANNED: %ld, ROW_SORTED: %ld, ROW_INSERTED: %ld",
|
"STATUS: REPLICA BUILD, PARALLELISM: %ld, ROW_SCANNED: %ld, ROW_SORTED: %ld, ROW_INSERTED: %ld",
|
||||||
|
ObDDLUtil::get_real_parallelism(parallelism_, false/*is mv refresh*/),
|
||||||
row_scanned,
|
row_scanned,
|
||||||
row_sorted,
|
row_sorted,
|
||||||
row_inserted_file))) {
|
row_inserted_file))) {
|
||||||
|
|||||||
@ -1286,7 +1286,8 @@ int ObTableRedefinitionTask::collect_longops_stat(ObLongopsValue &value)
|
|||||||
if (OB_FAIL(databuff_printf(stat_info_.message_,
|
if (OB_FAIL(databuff_printf(stat_info_.message_,
|
||||||
MAX_LONG_OPS_MESSAGE_LENGTH,
|
MAX_LONG_OPS_MESSAGE_LENGTH,
|
||||||
pos,
|
pos,
|
||||||
"STATUS: REPLICA BUILD, ROW_SCANNED: %ld, ROW_SORTED: %ld, ROW_INSERTED_TMP_FILE: %ld, ROW_INSERTED: %ld out of %ld column group rows",
|
"STATUS: REPLICA BUILD, PARALLELISM: %ld, ROW_SCANNED: %ld, ROW_SORTED: %ld, ROW_INSERTED_TMP_FILE: %ld, ROW_INSERTED: %ld out of %ld column group rows",
|
||||||
|
ObDDLUtil::get_real_parallelism(parallelism_, alter_table_arg_.mview_refresh_info_.is_mview_complete_refresh_),
|
||||||
row_scanned,
|
row_scanned,
|
||||||
row_sorted,
|
row_sorted,
|
||||||
row_inserted_file,
|
row_inserted_file,
|
||||||
@ -1298,7 +1299,8 @@ int ObTableRedefinitionTask::collect_longops_stat(ObLongopsValue &value)
|
|||||||
if (OB_FAIL(databuff_printf(stat_info_.message_,
|
if (OB_FAIL(databuff_printf(stat_info_.message_,
|
||||||
MAX_LONG_OPS_MESSAGE_LENGTH,
|
MAX_LONG_OPS_MESSAGE_LENGTH,
|
||||||
pos,
|
pos,
|
||||||
"STATUS: REPLICA BUILD, ROW_SCANNED: %ld, ROW_SORTED: %ld, ROW_INSERTED: %ld",
|
"STATUS: REPLICA BUILD, PARALLELISM: %ld, ROW_SCANNED: %ld, ROW_SORTED: %ld, ROW_INSERTED: %ld",
|
||||||
|
ObDDLUtil::get_real_parallelism(parallelism_, alter_table_arg_.mview_refresh_info_.is_mview_complete_refresh_),
|
||||||
row_scanned,
|
row_scanned,
|
||||||
row_sorted,
|
row_sorted,
|
||||||
row_inserted_file))) {
|
row_inserted_file))) {
|
||||||
|
|||||||
@ -810,8 +810,7 @@ int ObDDLUtil::generate_build_replica_sql(
|
|||||||
ObArray<int64_t> select_column_ids;
|
ObArray<int64_t> select_column_ids;
|
||||||
ObArray<int64_t> order_column_ids;
|
ObArray<int64_t> order_column_ids;
|
||||||
bool is_shadow_column = false;
|
bool is_shadow_column = false;
|
||||||
int64_t real_parallelism = std::max(1L, parallelism);
|
const int64_t real_parallelism = ObDDLUtil::get_real_parallelism(parallelism, false/*is mv refresh*/);
|
||||||
real_parallelism = std::min(ObMacroDataSeq::MAX_PARALLEL_IDX + 1, real_parallelism);
|
|
||||||
// get dest table column names
|
// get dest table column names
|
||||||
if (dest_table_schema->is_spatial_index()) {
|
if (dest_table_schema->is_spatial_index()) {
|
||||||
if (OB_FAIL(ObDDLUtil::generate_spatial_index_column_names(*dest_table_schema, *source_table_schema, insert_column_names,
|
if (OB_FAIL(ObDDLUtil::generate_spatial_index_column_names(*dest_table_schema, *source_table_schema, insert_column_names,
|
||||||
@ -1140,8 +1139,7 @@ int ObDDLUtil::generate_build_mview_replica_sql(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (OB_SUCC(ret)) {
|
if (OB_SUCC(ret)) {
|
||||||
int64_t real_parallelism = std::max(2L, parallelism);
|
const int64_t real_parallelism = ObDDLUtil::get_real_parallelism(parallelism, true/*is mv refresh*/);
|
||||||
real_parallelism = std::min(ObMacroDataSeq::MAX_PARALLEL_IDX + 1, real_parallelism);
|
|
||||||
const ObString &select_sql_string = mview_table_schema->get_view_schema().get_view_definition_str();
|
const ObString &select_sql_string = mview_table_schema->get_view_schema().get_view_definition_str();
|
||||||
if (is_oracle_mode) {
|
if (is_oracle_mode) {
|
||||||
if (OB_FAIL(sql_string.assign_fmt("INSERT /*+ append monitor enable_parallel_dml parallel(%ld) opt_param('ddl_execution_id', %ld) opt_param('ddl_task_id', %ld) use_px */ INTO \"%.*s\".\"%.*s\""
|
if (OB_FAIL(sql_string.assign_fmt("INSERT /*+ append monitor enable_parallel_dml parallel(%ld) opt_param('ddl_execution_id', %ld) opt_param('ddl_task_id', %ld) use_px */ INTO \"%.*s\".\"%.*s\""
|
||||||
@ -2021,6 +2019,18 @@ bool ObDDLUtil::use_idempotent_mode(const int64_t data_format_version, const sha
|
|||||||
return data_format_version >= DATA_VERSION_4_3_1_0 && task_type == DDL_MVIEW_COMPLETE_REFRESH;
|
return data_format_version >= DATA_VERSION_4_3_1_0 && task_type == DDL_MVIEW_COMPLETE_REFRESH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int64_t ObDDLUtil::get_real_parallelism(const int64_t parallelism, const bool is_mv_refresh)
|
||||||
|
{
|
||||||
|
int64_t real_parallelism = 0L;
|
||||||
|
if (is_mv_refresh) {
|
||||||
|
real_parallelism = std::max(2L, parallelism);
|
||||||
|
} else {
|
||||||
|
real_parallelism = std::max(1L, parallelism);
|
||||||
|
}
|
||||||
|
real_parallelism = std::min(oceanbase::ObMacroDataSeq::MAX_PARALLEL_IDX + 1, real_parallelism);
|
||||||
|
return real_parallelism;
|
||||||
|
}
|
||||||
|
|
||||||
/****************** ObCheckTabletDataComplementOp *************/
|
/****************** ObCheckTabletDataComplementOp *************/
|
||||||
|
|
||||||
int ObCheckTabletDataComplementOp::check_task_inner_sql_session_status(
|
int ObCheckTabletDataComplementOp::check_task_inner_sql_session_status(
|
||||||
|
|||||||
@ -654,6 +654,7 @@ public:
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
static bool use_idempotent_mode(const int64_t data_format_version, const share::ObDDLType task_type);
|
static bool use_idempotent_mode(const int64_t data_format_version, const share::ObDDLType task_type);
|
||||||
|
static int64_t get_real_parallelism(const int64_t parallelism, const bool is_mv_refresh);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static int batch_check_tablet_checksum(
|
static int batch_check_tablet_checksum(
|
||||||
|
|||||||
Reference in New Issue
Block a user