[CP] Reset the system view status when restarting the server to ensure the eventual consistency of the system vie

This commit is contained in:
obdev 2024-02-07 18:58:54 +00:00 committed by ob-robot
parent 22f03c1a58
commit ca6af6b8c8
2 changed files with 11 additions and 3 deletions

View File

@ -235,7 +235,10 @@ int ObInfoSchemaColumnsTable::iterate_table_schema_array(const bool is_filter_ta
}
// for system view, its column info depend on hard code, so its valid by default, but do not have column meta
// status default value is valid, old version also work whether what status it read because its column count = 0
bool view_is_invalid = (0 == table_schema->get_object_status() || 0 == table_schema->get_column_count());
bool view_is_invalid = (0 == table_schema->get_object_status()
|| 0 == table_schema->get_column_count()
|| (table_schema->is_sys_view()
&& table_schema->get_schema_version() <= GCTX.start_time_));
if (OB_FAIL(ret)) {
} else if (is_normal_view && view_is_invalid) {
mem_context_->reset_remain_one_page();

View File

@ -5193,8 +5193,13 @@ int ObSQLUtils::async_recompile_view(const share::schema::ObTableSchema &old_vie
} else if (OB_ISNULL(GCTX.sql_engine_)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("failed to get sql engine", K(ret));
} else if ((0 == old_view_schema.get_object_status() || 0 == old_view_schema.get_column_count())) {
if (!reset_column_infos) {
} else if ((0 == old_view_schema.get_object_status()
|| 0 == old_view_schema.get_column_count()
|| (old_view_schema.is_sys_view()
&& old_view_schema.get_schema_version() <= GCTX.start_time_))) {
if (old_view_schema.is_sys_view() && GCONF.in_upgrade_mode()) {
//do not recompile sys view until upgrade finish
} else if (!reset_column_infos) {
ObArray<ObString> dummy_column_list;
if (OB_ISNULL(select_stmt)) {
ret = OB_ERR_UNEXPECTED;