This is an automated email from the ASF dual-hosted git repository.

jacktengg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 1834f8aa8e5 [chore](conf) Remove deprecated/unused FE/BE configs and 
stale session variables (#63744)
1834f8aa8e5 is described below

commit 1834f8aa8e503443056320cc354b3e920d56d86f
Author: TengJianPing <[email protected]>
AuthorDate: Fri Jun 5 16:33:06 2026 +0800

    [chore](conf) Remove deprecated/unused FE/BE configs and stale session 
variables (#63744)
    
    Issue Number: close #xxx
    
    Related PR: #xxx
    
    Problem Summary:
    
    Doris has accumulated a number of FE configs, BE configs and session
    variables that are either explicitly marked `@Deprecated`, or simply
    have no remaining references anywhere in the codebase (production
    sources, regression tests, docs, or tools). They add noise to the
    user-facing configuration surface and to the source tree without
    changing any behavior. This commit removes them in three coordinated
    parts and adds the minimum amount of backward-compatibility plumbing
    required to keep a BE-then-FE rolling upgrade safe.
    
    1. FE configs (fe/fe-common/.../Config.java)
    
    Remove 13 `@Deprecated` fields with no remaining production references:
    `meta_publish_timeout_ms`, `backup_plugin_path`,
    `max_unfinished_load_job`, `use_new_tablet_scheduler`,
    `enable_concurrent_update`, `cbo_max_statistics_job_num`,
    `max_cbo_statistics_task_timeout_sec`,
    `cbo_concurrency_statistics_task_num`, `cbo_default_sample_percentage`,
    `finish_job_max_saved_second`, `enable_array_type`,
    `period_analyze_simultaneously_running_task_num`,
    `maximum_parallelism_of_export_job`.
    
    `ConfigBase.java` gains a small `warnUnknownConfigKeys()` helper. After
    `setFields()` runs, if any of the legacy keys above is still listed in
    `fe.conf`, FE logs a single WARN line in fe.out: "[WARN] Unknown config
    'enable_array_type' in /xxx/fe/conf/fe.conf is ignored, please check
    whether it is a typo or has been removed in this version". so operators
    notice the stale entry on upgrade. FE startup is not affected: the FE
    config loader iterates over Java fields, so unknown keys in `fe.conf`
    were already silently ignored before this change.
    
    2. BE configs (be/src/common/config.{cpp,h},
    be/src/cloud/config.{cpp,h})
    
    Remove 24 configs that have zero references in the BE source tree:
    `doris_scanner_max_run_time_ms`, `multi_get_max_threads`, `num_disks`,
    `read_size`, `load_max_wg_active_memtable_percent`,
    `jdbc_connection_pool_cache_clear_time_sec`, `big_column_size_buffer`,
    `small_column_size_buffer`, `max_fragment_start_wait_time_seconds`,
    `enable_workload_group_for_scan`,
    `workload_group_scan_task_wait_timeout_ms`,
    `variant_use_cloud_schema_dict_cache`,
    `variant_threshold_rows_to_estimate_sparse_column`,
    `variant_nested_group_max_depth`, `enable_ttl_cache_evict_using_lru`,
    `file_cache_background_ttl_gc_batch`,
    `kerberos_refresh_interval_second`, `enable_debug_log_timeout_secs`,
    `enable_index_compaction`, `schema_dict_cache_capacity`,
    `test_s3_resource`, `meta_service_use_load_balancer`,
    `meta_service_rpc_timeout_ms`, `delete_bitmap_rpc_retry_times`.
    
    The BE config loader (`be/src/common/config.cpp` `init()`) also iterates
    over the registered field map, so unknown keys in `be.conf` were already
    silently ignored — hard removal is safe on a rolling upgrade. None of
    the removed options affect on-disk data format or the BE↔BE / BE↔FE wire
    format, so the standard BE-first rolling upgrade ordering is preserved.
    For any of the removed configs, BE log a warning line in be.out:
    "W20260603 15:56:41.059423 493959 config.cpp:2105] Unknown config
    'enable_storage_vectorization' in /xxx/be/conf/be_custom.conf is
    ignored, please check whether it is a typo or has been removed in this
    version."
    
    3. Session variables (fe/fe-core/.../qe/SessionVariable.java,
    .../qe/VariableMgr.java)
    
    Remove 16 stale Doris-specific session variables along with their public
    name constants and any getter/setter methods:
    `enable_jdbc_oracle_null_predicate_push_down`, `use_v2_rollup`,
    `rewrite_count_distinct_to_bitmap_hll`,
    `enable_variant_access_in_original_planner`, `extract_wide_range_expr`,
    `auto_broadcast_join_threshold`, `runtime_filters_max_num`,
    `disable_inverted_index_v1_for_variant`, `enable_infer_predicate`,
    `limit_rows_for_single_instance`, `nereids_star_schema_support`,
    `enable_cbo_statistics`, `enable_eliminate_sort_node`,
    `drop_table_if_ctas_failed`, `trace_nereids`,
    `enable_sync_mv_cost_based_rewrite`.
    
    Selection criteria for each removed variable: zero references in
    `fe/fe-core/src/main/java` and `fe/fe-common/src/main/java` outside
    `SessionVariable.java` itself (after expanding the search to cover
    `get`/`set`/`is`-prefixed accessors of the field name, the public name
    constant, the underlying lowercase string literal, the body of
    `toThrift()`, and the body of `setForwardedSessionVariables()`), and
    zero hits in `regression-test/`, `docs/`, `tools/`, and `be/test/`.
    
    Upgrade compatibility is the critical concern here. Unlike fe.conf and
    be.conf, unknown session-variable names cause `VariableMgr` to throw
    `ERR_UNKNOWN_SYSTEM_VARIABLE` at four sites (`setVar`,
    `setVarForNonMasterFE`, `fillValue`, `getValue`). A hard delete would
    therefore break existing user scripts and JDBC client connection init
    paths that still issue `SET` on the old names during a BE-then-FE
    rolling upgrade. To stay safe, `VariableMgr` now keeps an explicit
    `REMOVED_SESSION_VAR_NAMES` set listing the 16 removed lowercase names;
    each of the four lookup sites short-circuits on this set so that `SET
    <removed_var> = ...` silently no-ops and `SELECT @@<removed_var>`
    returns an empty string. The same pattern is already used for
    `mysql_compat_var_whitelist`.
    
    The legacy FE configs and BE configs listed above have been removed. The
    following session variables have been removed; `SET` and `SELECT @@`
    against them now silently succeed (with empty/no-op behavior) instead of
    returning the variable's previous default:
    `enable_jdbc_oracle_null_predicate_push_down`, `use_v2_rollup`,
    `rewrite_count_distinct_to_bitmap_hll`,
    `enable_variant_access_in_original_planner`, `extract_wide_range_expr`,
    `auto_broadcast_join_threshold`, `runtime_filters_max_num`,
    `disable_inverted_index_v1_for_variant`, `enable_infer_predicate`,
    `limit_rows_for_single_instance`, `nereids_star_schema_support`,
    `enable_cbo_statistics`, `enable_eliminate_sort_node`,
    `drop_table_if_ctas_failed`, `trace_nereids`,
    `enable_sync_mv_cost_based_rewrite`. If any of the removed FE keys is
    still present in `fe.conf` on upgrade, FE logs a WARN line on startup.
    
    ### What problem does this PR solve?
    
    Issue Number: close #xxx
    
    Related PR: #xxx
    
    Problem Summary:
    
    ### Release note
    
    None
    
    ### Check List (For Author)
    
    - Test <!-- At least one of them must be included. -->
        - [ ] Regression test
        - [ ] Unit Test
        - [ ] Manual test (add detailed scripts or steps below)
        - [ ] No need to test or manual test. Explain why:
    - [ ] This is a refactor/code format and no logic has been changed.
            - [ ] Previous test can cover this change.
            - [ ] No code files have been changed.
            - [ ] Other reason <!-- Add your reason?  -->
    
    - Behavior changed:
        - [ ] No.
        - [ ] Yes. <!-- Explain the behavior change -->
    
    - Does this need documentation?
        - [ ] No.
    - [ ] Yes. <!-- Add document PR link here. eg:
    https://github.com/apache/doris-website/pull/1214 -->
    
    ### Check List (For Reviewer who merge this PR)
    
    - [ ] Confirm the release note
    - [ ] Confirm test cases
    - [ ] Confirm document
    - [ ] Add branch pick label <!-- Add branch pick label that this PR
    should merge into -->
---
 be/src/cloud/config.cpp                            |   4 -
 be/src/cloud/config.h                              |   3 -
 be/src/common/config.cpp                           |  85 +++++------
 be/src/common/config.h                             |  45 +-----
 .../main/java/org/apache/doris/common/Config.java  |  80 ----------
 .../java/org/apache/doris/common/ConfigBase.java   |  29 ++++
 .../java/org/apache/doris/qe/SessionVariable.java  | 170 +--------------------
 .../main/java/org/apache/doris/qe/VariableMgr.java |  54 +++++++
 .../set/test_removed_session_variables.out         |  13 ++
 .../set/test_removed_session_variables.groovy      |  87 +++++++++++
 10 files changed, 224 insertions(+), 346 deletions(-)

diff --git a/be/src/cloud/config.cpp b/be/src/cloud/config.cpp
index b3695512419..b502704e843 100644
--- a/be/src/cloud/config.cpp
+++ b/be/src/cloud/config.cpp
@@ -25,8 +25,6 @@ DEFINE_String(deploy_mode, "");
 DEFINE_mString(cloud_unique_id, "");
 DEFINE_mString(meta_service_endpoint, "");
 DEFINE_mBool(enable_meta_service_endpoint_consistency_check, "true");
-DEFINE_Bool(meta_service_use_load_balancer, "false");
-DEFINE_mInt32(meta_service_rpc_timeout_ms, "10000");
 DEFINE_Bool(meta_service_connection_pooled, "true");
 DEFINE_mInt64(meta_service_connection_pool_size, "20");
 DEFINE_mInt32(meta_service_connection_age_base_seconds, "30");
@@ -107,8 +105,6 @@ DEFINE_mBool(enable_use_cloud_unique_id_from_fe, "true");
 
 DEFINE_mBool(enable_cloud_tablet_report, "true");
 
-DEFINE_mInt32(delete_bitmap_rpc_retry_times, "25");
-
 DEFINE_mInt64(meta_service_rpc_reconnect_interval_ms, "100");
 
 DEFINE_mInt32(meta_service_conflict_error_retry_times, "10");
diff --git a/be/src/cloud/config.h b/be/src/cloud/config.h
index 40b41715825..c52e09bc098 100644
--- a/be/src/cloud/config.h
+++ b/be/src/cloud/config.h
@@ -58,7 +58,6 @@ DECLARE_mInt32(meta_service_connection_age_base_seconds);
 //
 // Only works when meta_service_endpoint is set to a single host.
 DECLARE_mInt32(meta_service_idle_connection_timeout_ms);
-DECLARE_mInt32(meta_service_rpc_timeout_ms);
 DECLARE_mInt32(meta_service_rpc_retry_times);
 // default brpc timeout
 DECLARE_mInt32(meta_service_brpc_timeout_ms);
@@ -147,8 +146,6 @@ DECLARE_mBool(enable_use_cloud_unique_id_from_fe);
 
 DECLARE_Bool(enable_cloud_tablet_report);
 
-DECLARE_mInt32(delete_bitmap_rpc_retry_times);
-
 DECLARE_mInt64(meta_service_rpc_reconnect_interval_ms);
 
 DECLARE_mInt32(meta_service_conflict_error_retry_times);
diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp
index 7bd2ced5796..e29ad919dc7 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -34,6 +34,7 @@
 #include <memory>
 #include <mutex>
 #include <random>
+#include <set>
 #include <string>
 #include <string_view>
 #include <utility>
@@ -345,8 +346,6 @@ DEFINE_mInt32(doris_scan_range_max_mb, "1024");
 DEFINE_mInt32(doris_scanner_row_num, "16384");
 // single read execute fragment row bytes
 DEFINE_mInt32(doris_scanner_row_bytes, "10485760");
-// single read execute fragment max run time millseconds
-DEFINE_mInt32(doris_scanner_max_run_time_ms, "1000");
 DEFINE_mInt32(doris_scanner_dynamic_interval_ms, "100");
 // (Advanced) Maximum size of per-query receive-side buffer
 DEFINE_mInt32(exchg_node_buffer_size_bytes, "20485760");
@@ -522,9 +521,6 @@ DEFINE_mInt64(cumulative_compaction_min_deltas, "5");
 DEFINE_mInt64(cumulative_compaction_max_deltas, "1000");
 DEFINE_mInt32(cumulative_compaction_max_deltas_factor, "10");
 
-// This config can be set to limit thread number in  multiget thread pool.
-DEFINE_mInt32(multi_get_max_threads, "10");
-
 // The upper limit of "permits" held by all compaction tasks. This config can 
be set to limit memory consumption for compaction.
 DEFINE_mInt64(total_permits_for_compaction_score, "1000000");
 
@@ -716,13 +712,10 @@ DEFINE_Int32(fragment_mgr_async_work_pool_thread_num_min, 
"16");
 DEFINE_Int32(fragment_mgr_async_work_pool_thread_num_max, "2048");
 DEFINE_Int32(fragment_mgr_async_work_pool_queue_size, "4096");
 
-// Control the number of disks on the machine.  If 0, this comes from the 
system settings.
-DEFINE_Int32(num_disks, "0");
 // The read size is the size of the reads sent to os.
 // There is a trade off of latency and throughout, trying to keep disks busy 
but
 // not introduce seeks.  The literature seems to agree that with 8 MB reads, 
random
 // io and sequential io perform similarly.
-DEFINE_Int32(read_size, "8388608");    // 8 * 1024 * 1024, Read Size (in bytes)
 DEFINE_Int32(min_buffer_size, "1024"); // 1024, The minimum read buffer size 
(in bytes)
 
 // for pprof
@@ -778,9 +771,6 @@ DEFINE_Int32(load_process_soft_mem_limit_percent, "80");
 // memtable memory limiter will do nothing.
 DEFINE_Int32(load_process_safe_mem_permit_percent, "5");
 
-// If there are a lot of memtable memory, then wait them flush finished.
-DEFINE_mDouble(load_max_wg_active_memtable_percent, "0.6");
-
 // result buffer cancelled time (unit: second)
 DEFINE_mInt32(result_buffer_cancelled_interval_time, "300");
 
@@ -1008,9 +998,6 @@ DEFINE_Int32(send_batch_thread_pool_queue_size, "102400");
 DEFINE_mInt32(max_segment_num_per_rowset, "1000");
 DEFINE_mInt32(segment_compression_threshold_kb, "256");
 
-// Time to clean up useless JDBC connection pool cache
-DEFINE_mInt32(jdbc_connection_pool_cache_clear_time_sec, "28800");
-
 // Global bitmap cache capacity for aggregation cache, size in bytes
 DEFINE_Int64(delete_bitmap_agg_cache_capacity, "104857600");
 // The default delete bitmap cache is set to 100MB,
@@ -1084,9 +1071,6 @@ DEFINE_mInt32(merged_hdfs_min_io_size, "8192");
 
 // OrcReader
 DEFINE_mInt32(orc_natural_read_size_mb, "8");
-DEFINE_mInt64(big_column_size_buffer, "65535");
-DEFINE_mInt64(small_column_size_buffer, "100");
-
 // Perform the always_true check at intervals determined by 
runtime_filter_sampling_frequency
 DEFINE_mInt32(runtime_filter_sampling_frequency, "32");
 DEFINE_mInt32(execution_max_rpc_timeout_sec, "3600");
@@ -1120,13 +1104,6 @@ DEFINE_mInt64(nodechannel_pending_queue_max_bytes, 
"67108864");
 // The batch size for sending data by brpc streaming client
 DEFINE_mInt64(brpc_streaming_client_batch_bytes, "262144");
 
-// Max waiting time to wait the "plan fragment start" rpc.
-// If timeout, the fragment will be cancelled.
-// This parameter is usually only used when the FE loses connection,
-// and the BE can automatically cancel the relevant fragment after the timeout,
-// so as to avoid occupying the execution thread for a long time.
-DEFINE_mInt32(max_fragment_start_wait_time_seconds, "30");
-
 DEFINE_mInt32(fragment_mgr_cancel_worker_interval_seconds, "1");
 
 // Node role tag for backend. Mix role is the default role, and computation 
role have no
@@ -1186,21 +1163,11 @@ DEFINE_Bool(enable_debug_points, "false");
 
 DEFINE_Int32(pipeline_executor_size, "0");
 DEFINE_Int32(blocking_pipeline_executor_size, "0");
-DEFINE_Bool(enable_workload_group_for_scan, "false");
-DEFINE_mInt64(workload_group_scan_task_wait_timeout_ms, "10000");
-
-// Whether use schema dict in backend side instead of MetaService side(cloud 
mode)
-DEFINE_mBool(variant_use_cloud_schema_dict_cache, "true");
-DEFINE_mInt64(variant_threshold_rows_to_estimate_sparse_column, "2048");
 DEFINE_mInt32(variant_max_json_key_length, "255");
 DEFINE_mBool(variant_throw_exeception_on_invalid_json, "false");
 DEFINE_mBool(variant_enable_duplicate_json_path_check, "false");
 DEFINE_mBool(enable_vertical_compact_variant_subcolumns, "true");
 DEFINE_mBool(enable_variant_doc_sparse_write_subcolumns, "true");
-// Maximum depth of nested arrays to track with NestedGroup
-// Reserved for future use when NestedGroup expansion moves to storage layer
-// Deeper arrays will be stored as JSONB
-DEFINE_mInt32(variant_nested_group_max_depth, "3");
 DEFINE_mBool(variant_nested_group_discard_scalar_on_conflict, "false");
 
 DEFINE_Validator(variant_max_json_key_length,
@@ -1237,9 +1204,6 @@ 
DEFINE_mInt64(file_cache_evict_in_advance_recycle_keys_num_threshold, "1000");
 
 DEFINE_mBool(enable_read_cache_file_directly, "true");
 DEFINE_mBool(file_cache_enable_evict_from_other_queue_by_size, "true");
-// If true, evict the ttl cache using LRU when full.
-// Otherwise, only expiration can evict ttl and new data won't add to cache 
when full.
-DEFINE_Bool(enable_ttl_cache_evict_using_lru, "true");
 DEFINE_mBool(enbale_dump_error_file, "false");
 // limit the max size of error log on disk
 DEFINE_mInt64(file_cache_error_log_limit_bytes, "209715200"); // 200MB
@@ -1271,7 +1235,6 @@ DEFINE_mInt64(file_cache_background_monitor_interval_ms, 
"5000");
 DEFINE_mInt64(file_cache_background_ttl_gc_interval_ms, "180000");
 DEFINE_mInt64(file_cache_background_ttl_info_update_interval_ms, "180000");
 DEFINE_mInt64(file_cache_background_tablet_id_flush_interval_ms, "1000");
-DEFINE_mInt64(file_cache_background_ttl_gc_batch, "1000");
 DEFINE_mInt64(file_cache_background_lru_dump_interval_ms, "60000");
 // dump queue only if the queue update specific times through several dump 
intervals
 DEFINE_mInt64(file_cache_background_lru_dump_update_cnt_threshold, "1000");
@@ -1373,9 +1336,6 @@ DEFINE_mBool(allow_zero_date, "false");
 DEFINE_Bool(allow_invalid_decimalv2_literal, "false");
 DEFINE_mString(kerberos_ccache_path, "/tmp/");
 DEFINE_mString(kerberos_krb5_conf_path, "/etc/krb5.conf");
-// Deprecated
-DEFINE_mInt32(kerberos_refresh_interval_second, "43200");
-
 // JDK-8153057: avoid StackOverflowError thrown from the 
UncaughtExceptionHandler in thread "process reaper"
 DEFINE_mBool(jdk_process_reaper_use_default_stack_size, "true");
 
@@ -1491,9 +1451,6 @@ DEFINE_mBool(enable_column_type_check, "true");
 // 128 MB
 DEFINE_mInt64(local_exchange_buffer_mem_limit, "134217728");
 
-// Default 300s, if its value <= 0, then log is disabled
-DEFINE_mInt64(enable_debug_log_timeout_secs, "0");
-
 // Tolerance for the number of partition id 0 in rowset, default 0
 DEFINE_Int32(ignore_invalid_partition_id_rowset_num, "0");
 
@@ -1609,8 +1566,6 @@ DEFINE_Validator(paimon_file_system_scheme_mappings,
 
 DEFINE_mInt32(thrift_client_open_num_tries, "1");
 
-DEFINE_Bool(enable_index_compaction, "false");
-
 // http scheme in S3Client to use. E.g. http or https
 DEFINE_String(s3_client_http_scheme, "http");
 DEFINE_Validator(s3_client_http_scheme, [](const std::string& config) -> bool {
@@ -1724,8 +1679,6 @@ DEFINE_mInt32(max_automatic_compaction_num_per_round, 
"64");
 DEFINE_mInt32(check_tablet_delete_bitmap_interval_seconds, "300");
 DEFINE_mInt32(check_tablet_delete_bitmap_score_top_n, "10");
 DEFINE_mBool(enable_check_tablet_delete_bitmap_score, "true");
-DEFINE_mInt32(schema_dict_cache_capacity, "4096");
-
 // whether to prune rows with delete sign = 1 in base compaction
 // ATTN: this config is only for test
 DEFINE_mBool(enable_prune_delete_sign_when_base_compaction, "true");
@@ -1818,8 +1771,6 @@ DEFINE_mInt32(file_handles_deplenish_frequency_times, 
"3");
 
 // clang-format off
 #ifdef BE_TEST
-// test s3
-DEFINE_String(test_s3_resource, "resource");
 DEFINE_String(test_s3_ak, "ak");
 DEFINE_String(test_s3_sk, "sk");
 DEFINE_String(test_s3_endpoint, "endpoint");
@@ -2126,6 +2077,22 @@ std::ostream& operator<<(std::ostream& out, const 
std::vector<T>& v) {
         continue;                                                              
                \
     }
 
+// Keys that start with an uppercase letter and consist only of uppercase 
letters,
+// digits and underscores (e.g. JAVA_OPTS, LOG_DIR) are exported as environment
+// variables by bin/start_be.sh and are not BE config fields, so they must not 
be
+// reported as unknown.
+static bool is_env_style_key(const std::string& key) {
+    if (key.empty() || key[0] < 'A' || key[0] > 'Z') {
+        return false;
+    }
+    for (char c : key) {
+        if (!((c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_')) {
+            return false;
+        }
+    }
+    return true;
+}
+
 // init conf fields
 bool init(const char* conf_file, bool fill_conf_map, bool must_exist, bool 
set_to_default) {
     Properties props;
@@ -2154,6 +2121,24 @@ bool init(const char* conf_file, bool fill_conf_map, 
bool must_exist, bool set_t
         SET_FIELD(it.second, std::vector<std::string>, fill_conf_map, 
set_to_default);
     }
 
+    // Emit a warning for every key present in the conf file that does not 
correspond to a
+    // registered BE config field. Such keys (typos or configs removed in a 
newer version)
+    // are silently ignored above, so without this warning operators would 
have no feedback
+    // that the value is not taking effect. BE startup is not affected.
+    for (const auto& kv : props.conf_map()) {
+        const std::string& key = kv.first;
+        if (Register::_s_field_map->find(key) != 
Register::_s_field_map->end()) {
+            continue;
+        }
+        if (is_env_style_key(key)) {
+            continue;
+        }
+        LOG(WARNING) << fmt::format(
+                "Unknown config '{}' in {} is ignored, please check whether it 
is a typo "
+                "or has been removed in this version.",
+                key, conf_file);
+    }
+
     if (config::is_cloud_mode()) {
         auto st = config::set_config("enable_file_cache", "true", true, true);
         LOG(INFO) << "set config enable_file_cache "
diff --git a/be/src/common/config.h b/be/src/common/config.h
index b68783656e2..205e86002ad 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -405,8 +405,6 @@ DECLARE_mInt32(doris_scan_range_max_mb);
 DECLARE_mInt32(doris_scanner_row_num);
 // single read execute fragment row bytes
 DECLARE_mInt32(doris_scanner_row_bytes);
-// Deprecated. single read execute fragment max run time millseconds
-DECLARE_mInt32(doris_scanner_max_run_time_ms);
 // Minimum interval in milliseconds between adaptive scanner concurrency 
adjustments
 DECLARE_mInt32(doris_scanner_dynamic_interval_ms);
 // (Advanced) Maximum size of per-query receive-side buffer
@@ -590,9 +588,6 @@ DECLARE_mInt64(cumulative_compaction_min_deltas);
 DECLARE_mInt64(cumulative_compaction_max_deltas);
 DECLARE_mInt32(cumulative_compaction_max_deltas_factor);
 
-// This config can be set to limit thread number in  multiget thread pool.
-DECLARE_mInt32(multi_get_max_threads);
-
 // The upper limit of "permits" held by all compaction tasks. This config can 
be set to limit memory consumption for compaction.
 DECLARE_mInt64(total_permits_for_compaction_score);
 
@@ -773,13 +768,10 @@ 
DECLARE_Int32(fragment_mgr_async_work_pool_thread_num_min);
 DECLARE_Int32(fragment_mgr_async_work_pool_thread_num_max);
 DECLARE_Int32(fragment_mgr_async_work_pool_queue_size);
 
-// Control the number of disks on the machine.  If 0, this comes from the 
system settings.
-DECLARE_Int32(num_disks);
 // The read size is the size of the reads sent to os.
 // There is a trade off of latency and throughout, trying to keep disks busy 
but
 // not introduce seeks.  The literature seems to agree that with 8 MB reads, 
random
 // io and sequential io perform similarly.
-DECLARE_Int32(read_size);       // 8 * 1024 * 1024, Read Size (in bytes)
 DECLARE_Int32(min_buffer_size); // 1024, The minimum read buffer size (in 
bytes)
 
 // for pprof
@@ -838,9 +830,6 @@ DECLARE_Int32(load_process_soft_mem_limit_percent);
 // memtable memory limiter will do nothing.
 DECLARE_Int32(load_process_safe_mem_permit_percent);
 
-// If there are a lot of memtable memory, then wait them flush finished.
-DECLARE_mDouble(load_max_wg_active_memtable_percent);
-
 // result buffer cancelled time (unit: second)
 DECLARE_mInt32(result_buffer_cancelled_interval_time);
 
@@ -1066,9 +1055,6 @@ DECLARE_mInt32(max_segment_num_per_rowset);
 // segment_compression_threshold_kb.
 DECLARE_mInt32(segment_compression_threshold_kb);
 
-// Time to clean up useless JDBC connection pool cache
-DECLARE_mInt32(jdbc_connection_pool_cache_clear_time_sec);
-
 // Global bitmap cache capacity for aggregation cache, size in bytes
 DECLARE_Int64(delete_bitmap_agg_cache_capacity);
 DECLARE_String(delete_bitmap_dynamic_agg_cache_limit);
@@ -1144,8 +1130,6 @@ DECLARE_mInt32(merged_hdfs_min_io_size);
 
 // OrcReader
 DECLARE_mInt32(orc_natural_read_size_mb);
-DECLARE_mInt64(big_column_size_buffer);
-DECLARE_mInt64(small_column_size_buffer);
 
 DECLARE_mInt32(runtime_filter_sampling_frequency);
 DECLARE_mInt32(execution_max_rpc_timeout_sec);
@@ -1184,13 +1168,6 @@ DECLARE_Bool(enable_brpc_connection_check);
 
 DECLARE_mInt64(brpc_connection_check_timeout_ms);
 
-// Max waiting time to wait the "plan fragment start" rpc.
-// If timeout, the fragment will be cancelled.
-// This parameter is usually only used when the FE loses connection,
-// and the BE can automatically cancel the relevant fragment after the timeout,
-// so as to avoid occupying the execution thread for a long time.
-DECLARE_mInt32(max_fragment_start_wait_time_seconds);
-
 DECLARE_Int32(fragment_mgr_cancel_worker_interval_seconds);
 
 // Node role tag for backend. Mix role is the default role, and computation 
role have no
@@ -1278,9 +1255,6 @@ DECLARE_mInt64(file_cache_evict_in_advance_batch_bytes);
 DECLARE_mInt64(file_cache_evict_in_advance_recycle_keys_num_threshold);
 DECLARE_mBool(enable_read_cache_file_directly);
 DECLARE_Bool(file_cache_enable_evict_from_other_queue_by_size);
-// If true, evict the ttl cache using LRU when full.
-// Otherwise, only expiration can evict ttl and new data won't add to cache 
when full.
-DECLARE_Bool(enable_ttl_cache_evict_using_lru);
 DECLARE_mBool(enbale_dump_error_file);
 // limit the max size of error log on disk
 DECLARE_mInt64(file_cache_error_log_limit_bytes);
@@ -1312,7 +1286,6 @@ DECLARE_mInt64(file_cache_background_monitor_interval_ms);
 DECLARE_mInt64(file_cache_background_ttl_gc_interval_ms);
 DECLARE_mInt64(file_cache_background_ttl_info_update_interval_ms);
 DECLARE_mInt64(file_cache_background_tablet_id_flush_interval_ms);
-DECLARE_mInt64(file_cache_background_ttl_gc_batch);
 DECLARE_Int32(file_cache_downloader_thread_num_min);
 DECLARE_Int32(file_cache_downloader_thread_num_max);
 // used to persist lru information before be reboot and load the info back
@@ -1422,8 +1395,6 @@ DECLARE_mBool(allow_invalid_decimalv2_literal);
 DECLARE_mString(kerberos_ccache_path);
 // set krb5.conf path, use "/etc/krb5.conf" by default
 DECLARE_mString(kerberos_krb5_conf_path);
-// the interval for renew kerberos ticket cache
-DECLARE_mInt32(kerberos_refresh_interval_second);
 
 // JDK-8153057: avoid StackOverflowError thrown from the 
UncaughtExceptionHandler in thread "process reaper"
 DECLARE_mBool(jdk_process_reaper_use_default_stack_size);
@@ -1451,12 +1422,6 @@ DECLARE_mInt64(lookup_connection_cache_capacity);
 
 // level of compression when using LZ4_HC, whose defalut value is 
LZ4HC_CLEVEL_DEFAULT
 DECLARE_mInt64(LZ4_HC_compression_level);
-// Threshold of a column as sparse column
-// Notice: TEST ONLY
-DECLARE_mBool(variant_use_cloud_schema_dict_cache);
-// Threshold to estimate a column is sparsed
-// Notice: TEST ONLY
-DECLARE_mInt64(variant_threshold_rows_to_estimate_sparse_column);
 // Max json key length in bytes when parsing json into variant 
subcolumns/jsonb.
 DECLARE_mInt32(variant_max_json_key_length);
 // Treat invalid json format str as string, instead of throwing exception if 
false
@@ -1466,9 +1431,6 @@ DECLARE_mBool(variant_enable_duplicate_json_path_check);
 // Enable vertical compact subcolumns of variant column
 DECLARE_mBool(enable_vertical_compact_variant_subcolumns);
 DECLARE_mBool(enable_variant_doc_sparse_write_subcolumns);
-// Maximum depth of nested arrays to track with NestedGroup
-// Reserved for future use when NestedGroup expansion moves to storage layer
-DECLARE_mInt32(variant_nested_group_max_depth);
 // When true, discard scalar data that conflicts with NestedGroup array<object>
 // data at the same path. This simplifies compaction by always prioritizing
 // nested structure over scalar. When false, report an error on conflict.
@@ -1585,8 +1547,6 @@ DECLARE_mInt32(variant_max_merged_tablet_schema_size);
 
 DECLARE_mInt64(local_exchange_buffer_mem_limit);
 
-DECLARE_mInt64(enable_debug_log_timeout_secs);
-
 DECLARE_mBool(enable_column_type_check);
 
 // Tolerance for the number of partition id 0 in rowset, default 0
@@ -1783,7 +1743,6 @@ DECLARE_mInt32(max_automatic_compaction_num_per_round);
 DECLARE_mInt32(check_tablet_delete_bitmap_interval_seconds);
 DECLARE_mInt32(check_tablet_delete_bitmap_score_top_n);
 DECLARE_mBool(enable_check_tablet_delete_bitmap_score);
-DECLARE_mInt32(schema_dict_cache_capacity);
 
 // whether to prune rows with delete sign = 1 in base compaction
 // ATTN: this config is only for test
@@ -1864,8 +1823,6 @@ DECLARE_mBool(enable_cloud_make_rs_visible_on_be);
 DECLARE_mInt32(file_handles_deplenish_frequency_times);
 
 #ifdef BE_TEST
-// test s3
-DECLARE_String(test_s3_resource);
 DECLARE_String(test_s3_ak);
 DECLARE_String(test_s3_sk);
 DECLARE_String(test_s3_endpoint);
@@ -1966,6 +1923,8 @@ public:
     // dump props to conf file
     Status dump(const std::string& conffile);
 
+    const std::map<std::string, std::string>& conf_map() const { return 
file_conf_map; }
+
 private:
     std::map<std::string, std::string> file_conf_map;
 };
diff --git a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java 
b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
index bb6ee8bb8c9..232c06ff304 100644
--- a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
+++ b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
@@ -791,11 +791,6 @@ public class Config extends ConfigBase {
             "Whether to allow colocate balance between all groups."})
     public static boolean disable_colocate_balance_between_groups = false;
 
-    /**
-     * The default user resource publishing timeout.
-     */
-    @Deprecated
-    @ConfField public static int meta_publish_timeout_ms = 1000;
     @ConfField public static boolean proxy_auth_enable = false;
     @ConfField public static String proxy_auth_magic_prefix = "x@8";
     /**
@@ -814,12 +809,6 @@ public class Config extends ConfigBase {
     public static int expr_depth_limit = 3000;
 
     // Configurations for backup and restore
-    /**
-     * Plugins' path for BACKUP and RESTORE operations. Currently deprecated.
-     */
-    @Deprecated
-    @ConfField public static String backup_plugin_path = 
"/tools/trans_file_tool/trans_files.sh";
-
     // For forward compatibility, will be removed later.
     // check token when download image file.
     @ConfField public static boolean enable_token_check = true;
@@ -886,14 +875,6 @@ public class Config extends ConfigBase {
     @ConfField(mutable = true, masterOnly = true)
     public static long max_bytes_per_broker_scanner = 500 * 1024 * 1024 * 
1024L; // 500G
 
-    /**
-     * Max number of load jobs, include PENDING、ETL、LOADING、QUORUM_FINISHED.
-     * If exceed this number, load job is not allowed to be submitted.
-     */
-    @Deprecated
-    @ConfField(mutable = true, masterOnly = true)
-    public static long max_unfinished_load_job = 1000;
-
     /**
      * If set to true, Planner will try to select replica of tablet on same 
host as this Frontend.
      * This may reduce network transmission in following case:
@@ -1056,12 +1037,6 @@ public class Config extends ConfigBase {
     @ConfField(mutable = false, masterOnly = true)
     public static long tablet_schedule_interval_ms = 1000;
 
-    /**
-     * Deprecated after 0.10
-     */
-    @Deprecated
-    @ConfField public static boolean use_new_tablet_scheduler = true;
-
     /**
      * the threshold of cluster balance score, if a backend's load score is 
10% lower than average score,
      * this backend will be marked as LOW load, if load score is 10% higher 
than average score, HIGH load
@@ -1734,10 +1709,6 @@ public class Config extends ConfigBase {
     @ConfField(mutable = false, masterOnly = true)
     public static int partition_info_update_interval_secs = 60;
 
-    @Deprecated
-    @ConfField(masterOnly = true)
-    public static boolean enable_concurrent_update = false;
-
     /**
      * This configuration can only be configured during cluster initialization 
and cannot be modified during cluster
      * restart and upgrade after initialization is complete.
@@ -1847,33 +1818,6 @@ public class Config extends ConfigBase {
     @ConfField(mutable = true, masterOnly = true)
     public static long min_bytes_indicate_replica_too_large = 2 * 1024 * 1024 
* 1024L;
 
-    // statistics
-    /*
-     * the max unfinished statistics job number
-     */
-    @Deprecated
-    @ConfField(mutable = true, masterOnly = true)
-    public static int cbo_max_statistics_job_num = 20;
-    /*
-     * the max timeout of a statistics task
-     */
-    @Deprecated
-    @ConfField(mutable = true, masterOnly = true)
-    public static int max_cbo_statistics_task_timeout_sec = 300;
-    /*
-     * the concurrency of statistics task
-     */
-    @Deprecated
-    @ConfField(mutable = false, masterOnly = true)
-    public static int cbo_concurrency_statistics_task_num = 10;
-    /*
-     * default sample percentage
-     * The value from 0 ~ 100. The 100 means no sampling and fetch all data.
-     */
-    @Deprecated
-    @ConfField(mutable = true, masterOnly = true)
-    public static int cbo_default_sample_percentage = 10;
-
     /*
      * the system automatically checks the time interval for statistics
      */
@@ -1995,15 +1939,6 @@ public class Config extends ConfigBase {
     @ConfField
     public static int async_task_consumer_thread_num = 64;
 
-    /**
-     * When job is finished, it will be saved in job manager for a while.
-     * This configuration is used to control the max saved time.
-     * Default is 3 days.
-     */
-    @Deprecated
-    @ConfField
-    public static int finish_job_max_saved_second = 60 * 60 * 24 * 3;
-
     // enable_workload_group should be immutable and temporarily set to 
mutable during the development test phase
     @ConfField(mutable = true, varType = VariableAnnotation.EXPERIMENTAL)
     public static boolean enable_workload_group = true;
@@ -2051,13 +1986,6 @@ public class Config extends ConfigBase {
     @ConfField(mutable = true)
     public static boolean enable_decimal_conversion = true;
 
-    /**
-     * Support complex data type ARRAY.
-     */
-    @Deprecated
-    @ConfField(mutable = true, masterOnly = true)
-    public static boolean enable_array_type = false;
-
     /**
      * The timeout of executing async remote fragment.
      * In normal case, the async remote fragment will be executed in a short 
time. If system are under high load
@@ -2626,10 +2554,6 @@ public class Config extends ConfigBase {
                     + "not guarded for correctness reasons; see the NOTE in 
BaseAnalysisTask."})
     public static long statistics_max_string_column_length = 1024;
 
-    @Deprecated
-    @ConfField
-    public static final int period_analyze_simultaneously_running_task_num = 1;
-
     @ConfField(mutable = false)
     public static boolean allow_analyze_statistics_info_polluting_file_cache = 
true;
 
@@ -2642,10 +2566,6 @@ public class Config extends ConfigBase {
     @ConfField(mutable = true, description = {"The maximum number of 
partitions allowed for an Export job"})
     public static int maximum_number_of_export_partitions = 2000;
 
-    @Deprecated
-    @ConfField(mutable = true, description = {"The maximum parallelism allowed 
for an Export job"})
-    public static int maximum_parallelism_of_export_job = 50;
-
     @ConfField(mutable = true, description = {"Whether to use MySQL's BIGINT 
type to return Doris's LARGEINT type"})
     public static boolean use_mysql_bigint_for_largeint = false;
 
diff --git a/fe/fe-common/src/main/java/org/apache/doris/common/ConfigBase.java 
b/fe/fe-common/src/main/java/org/apache/doris/common/ConfigBase.java
index d6b9b2b3615..192fdea7c8b 100644
--- a/fe/fe-common/src/main/java/org/apache/doris/common/ConfigBase.java
+++ b/fe/fe-common/src/main/java/org/apache/doris/common/ConfigBase.java
@@ -160,6 +160,35 @@ public class ConfigBase {
         }
         replacedByEnv(props);
         setFields(props, isLdapConfig);
+        warnUnknownConfigKeys(confFile, props);
+    }
+
+    // Keys that start with an uppercase letter and consist only of uppercase 
letters,
+    // digits and underscores (e.g. JAVA_OPTS, LOG_DIR) are exported as 
environment
+    // variables by bin/start_fe.sh and are not Doris config fields, so they 
must not
+    // be reported as unknown.
+    private static final Pattern ENV_STYLE_KEY_PATTERN = 
Pattern.compile("[A-Z][A-Z0-9_]*");
+
+    // Emit a warning for every key present in the config file that does not 
correspond
+    // to a known config field. Such keys (typos or configs removed in a newer 
version)
+    // are silently ignored by setFields(), so without this warning operators 
would have
+    // no feedback that the value is not taking effect. FE startup is not 
affected.
+    private void warnUnknownConfigKeys(String confFile, Properties props) {
+        Map<String, Field> fieldMap = isLdapConfig ? ldapConfFields : 
confFields;
+        if (fieldMap == null) {
+            return;
+        }
+        for (String key : props.stringPropertyNames()) {
+            if (ENV_STYLE_KEY_PATTERN.matcher(key).matches()) {
+                continue;
+            }
+            if (fieldMap.containsKey(key)) {
+                continue;
+            }
+            System.err.println(String.format(
+                    "[WARN] Unknown config '%s' in %s is ignored, please check 
whether it is a typo "
+                            + "or has been removed in this version.", key, 
confFile));
+        }
     }
 
     public static HashMap<String, String> dump() {
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
index 3f6da2fed73..1227dce7ba6 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
@@ -80,7 +80,6 @@ import java.util.Set;
 import java.util.concurrent.TimeUnit;
 import java.util.function.BiConsumer;
 
-
 /**
  * System variable.
  **/
@@ -213,8 +212,6 @@ public class SessionVariable implements Serializable, 
Writable {
     // user can set instance num after exchange, no need to be equal to nums 
of before exchange
     public static final String PARALLEL_EXCHANGE_INSTANCE_NUM = 
"parallel_exchange_instance_num";
     public static final String SHOW_HIDDEN_COLUMNS = "show_hidden_columns";
-    public static final String USE_V2_ROLLUP = "use_v2_rollup";
-    public static final String REWRITE_COUNT_DISTINCT_TO_BITMAP_HLL = 
"rewrite_count_distinct_to_bitmap_hll";
     public static final String EVENT_SCHEDULER = "event_scheduler";
     public static final String STORAGE_ENGINE = "storage_engine";
     // Compatible with datagrip mysql
@@ -251,7 +248,6 @@ public class SessionVariable implements Serializable, 
Writable {
     public static final String runtime_filter_wait_infinitely = 
"runtime_filter_wait_infinitely";
 
     // Maximum number of bloom runtime filters allowed per query
-    public static final String RUNTIME_FILTERS_MAX_NUM = 
"runtime_filters_max_num";
     // Runtime filter type used, For testing, Corresponds to TRuntimeFilterType
     public static final String RUNTIME_FILTER_TYPE = "runtime_filter_type";
     // if the right table is greater than this value in the hash join,  we 
will ignore IN filter
@@ -296,8 +292,6 @@ public class SessionVariable implements Serializable, 
Writable {
 
     public static final String DELETE_WITHOUT_PARTITION = 
"delete_without_partition";
 
-    public static final String ENABLE_VARIANT_ACCESS_IN_ORIGINAL_PLANNER = 
"enable_variant_access_in_original_planner";
-
     // set the default parallelism for send batch when execute InsertStmt 
operation,
     // if the value for parallelism exceed 
`max_send_batch_parallelism_per_job` in BE config,
     // then the coordinator be will use the value of 
`max_send_batch_parallelism_per_job`
@@ -321,14 +315,10 @@ public class SessionVariable implements Serializable, 
Writable {
 
     public static final String GLOBAL_PARTITION_TOPN_THRESHOLD = 
"global_partition_topn_threshold";
 
-    public static final String ENABLE_INFER_PREDICATE = 
"enable_infer_predicate";
-
     public static final long DEFAULT_INSERT_VISIBLE_TIMEOUT_MS = 60_000;
 
     public static final String ENABLE_VECTORIZED_ENGINE = 
"enable_vectorized_engine";
 
-    public static final String EXTRACT_WIDE_RANGE_EXPR = 
"extract_wide_range_expr";
-
     // If user set a very small value, use this value instead.
     public static final long MIN_INSERT_VISIBLE_TIMEOUT_MS = 1000;
 
@@ -385,8 +375,6 @@ public class SessionVariable implements Serializable, 
Writable {
 
     public static final String BLOCK_ENCRYPTION_MODE = "block_encryption_mode";
 
-    public static final String AUTO_BROADCAST_JOIN_THRESHOLD = 
"auto_broadcast_join_threshold";
-
     public static final String PARALLEL_PREPARE_THRESHOLD = 
"parallel_prepare_threshold";
 
     public static final String ENABLE_PROJECTION = "enable_projection";
@@ -435,8 +423,6 @@ public class SessionVariable implements Serializable, 
Writable {
 
     public static final String REWRITE_OR_TO_IN_PREDICATE_THRESHOLD = 
"rewrite_or_to_in_predicate_threshold";
 
-    public static final String NEREIDS_STAR_SCHEMA_SUPPORT = 
"nereids_star_schema_support";
-
     public static final String NEREIDS_CBO_PENALTY_FACTOR = 
"nereids_cbo_penalty_factor";
     public static final String ENABLE_NEREIDS_TRACE = "enable_nereids_trace";
     public static final String ENABLE_EXPR_TRACE = "enable_expr_trace";
@@ -489,12 +475,8 @@ public class SessionVariable implements Serializable, 
Writable {
 
     public static final String ENABLE_PUSH_DOWN_NO_GROUP_AGG = 
"enable_push_down_no_group_agg";
 
-    public static final String ENABLE_CBO_STATISTICS = "enable_cbo_statistics";
-
     public static final String ENABLE_SAVE_STATISTICS_SYNC_JOB = 
"enable_save_statistics_sync_job";
 
-    public static final String ENABLE_ELIMINATE_SORT_NODE = 
"enable_eliminate_sort_node";
-
     public static final String NEREIDS_TRACE_EVENT_MODE = 
"nereids_trace_event_mode";
 
     public static final String PARTITION_PRUNING_EXPAND_THRESHOLD = 
"partition_pruning_expand_threshold";
@@ -531,7 +513,6 @@ public class SessionVariable implements Serializable, 
Writable {
     public static final String ENABLE_NO_NEED_READ_DATA_OPT = 
"enable_no_need_read_data_opt";
 
     public static final String GROUP_BY_AND_HAVING_USE_ALIAS_FIRST = 
"group_by_and_having_use_alias_first";
-    public static final String DROP_TABLE_IF_CTAS_FAILED = 
"drop_table_if_ctas_failed";
 
     public static final String MAX_TABLE_COUNT_USE_CASCADES_JOIN_REORDER = 
"max_table_count_use_cascades_join_reorder";
     public static final int MIN_JOIN_REORDER_TABLE_COUNT = 2;
@@ -544,8 +525,6 @@ public class SessionVariable implements Serializable, 
Writable {
 
     public static final String MINIDUMP_PATH = "minidump_path";
 
-    public static final String TRACE_NEREIDS = "trace_nereids";
-
     public static final String PLAN_NEREIDS_DUMP = "plan_nereids_dump";
 
     public static final String DUMP_NEREIDS_MEMO = "dump_nereids_memo";
@@ -759,9 +738,6 @@ public class SessionVariable implements Serializable, 
Writable {
     public static final String ENABLE_MATERIALIZED_VIEW_NEST_REWRITE
             = "enable_materialized_view_nest_rewrite";
 
-    public static final String ENABLE_SYNC_MV_COST_BASED_REWRITE
-            = "enable_sync_mv_cost_based_rewrite";
-
     public static final String MATERIALIZED_VIEW_REWRITE_DURATION_THRESHOLD_MS
             = "materialized_view_rewrite_duration_threshold_ms";
 
@@ -825,7 +801,6 @@ public class SessionVariable implements Serializable, 
Writable {
 
     public static final String SHORT_CIRCUIT_EVALUATION = 
"short_circuit_evaluation";
 
-
     // NOTE: if you want to add some debug variables, please disable sql cache 
in `CacheAnalyzer.commonCacheCondition`,
     //       and set affectQueryResult=true
     public static final List<String> DEBUG_VARIABLES = ImmutableList.of(
@@ -841,14 +816,10 @@ public class SessionVariable implements Serializable, 
Writable {
 
     public static final String ENABLE_STATS = "enable_stats";
 
-    public static final String LIMIT_ROWS_FOR_SINGLE_INSTANCE = 
"limit_rows_for_single_instance";
-
     public static final String FETCH_REMOTE_SCHEMA_TIMEOUT_SECONDS = 
"fetch_remote_schema_timeout_seconds";
 
     public static final String MAX_FETCH_REMOTE_TABLET_COUNT = 
"max_fetch_remote_schema_tablet_count";
 
-    public static final String DISABLE_INVERTED_INDEX_V1_FOR_VARIANT = 
"disable_inverted_index_v1_for_variant";
-
     // Deprecated legacy switch for flatten-nested variant behavior.
     // It is distinct from variant_enable_nested_group.
     // Default is false, which means do not flatten nested when create table.
@@ -949,7 +920,6 @@ public class SessionVariable implements Serializable, 
Writable {
 
     public static final String SKEW_VALUE_THRESHOLD = "skew_value_threshold";
 
-
     @VarAttrDef.VarAttr(name = SKEW_VALUE_THRESHOLD, needForward = true,
                 description = {"当列中某个特定值的出现次数大于等于(rowCount/ndv)× 
skewValueThreshold 时,该值即被视为热点值",
                         "When the occurrence of a value in a column is greater 
than "
@@ -1434,7 +1404,6 @@ public class SessionVariable implements Serializable, 
Writable {
                         setter = "setPipelineTaskNum")
     public int parallelPipelineTaskNum = 0;
 
-
     public enum IgnoreSplitType {
         NONE,
         IGNORE_JNI,
@@ -1523,7 +1492,6 @@ public class SessionVariable implements Serializable, 
Writable {
     )
     public boolean skipPrunePredicate = false;
 
-
     @VarAttrDef.VarAttr(name = ENABLE_SQL_CACHE, fuzzy = true)
     public boolean enableSqlCache = true;
 
@@ -1551,12 +1519,6 @@ public class SessionVariable implements Serializable, 
Writable {
     @VarAttrDef.VarAttr(name = FORWARD_TO_MASTER)
     public boolean forwardToMaster = true;
 
-    @VarAttrDef.VarAttr(name = USE_V2_ROLLUP)
-    public boolean useV2Rollup = false;
-
-    @VarAttrDef.VarAttr(name = REWRITE_COUNT_DISTINCT_TO_BITMAP_HLL)
-    public boolean rewriteCountDistinct = true;
-
     // compatible with some mysql client connect, say DataGrip of JetBrains
     @VarAttrDef.VarAttr(name = EVENT_SCHEDULER)
     public String eventScheduler = "OFF";
@@ -1592,12 +1554,6 @@ public class SessionVariable implements Serializable, 
Writable {
     @VarAttrDef.VarAttr(name = SEND_BATCH_PARALLELISM, needForward = true)
     public int sendBatchParallelism = 1;
 
-    @VarAttrDef.VarAttr(name = ENABLE_VARIANT_ACCESS_IN_ORIGINAL_PLANNER)
-    public boolean enableVariantAccessInOriginalPlanner = false;
-
-    @VarAttrDef.VarAttr(name = EXTRACT_WIDE_RANGE_EXPR, needForward = true)
-    public boolean extractWideRangeExpr = true;
-
     @VarAttrDef.VarAttr(name = ENABLE_NEREIDS_DML, varType = 
VariableAnnotation.REMOVED)
     public boolean enableNereidsDML = true;
 
@@ -1687,12 +1643,6 @@ public class SessionVariable implements Serializable, 
Writable {
     @VarAttrDef.VarAttr(name = TRIM_TAILING_SPACES_FOR_EXTERNAL_TABLE_QUERY, 
needForward = true)
     public boolean trimTailingSpacesForExternalTableQuery = false;
 
-    // the maximum size in bytes for a table that will be broadcast to all be 
nodes
-    // when performing a join, By setting this value to -1 broadcasting can be 
disabled.
-    // Default value is 1Gto
-    @VarAttrDef.VarAttr(name = AUTO_BROADCAST_JOIN_THRESHOLD)
-    public double autoBroadcastJoinThreshold = 0.8;
-
     @VarAttrDef.VarAttr(name = PARALLEL_PREPARE_THRESHOLD, fuzzy = true)
     public int parallelPrepareThreshold = 32;
 
@@ -1730,7 +1680,6 @@ public class SessionVariable implements Serializable, 
Writable {
             "Ignore the rf when it encounters an error" })
     public boolean ignoreRuntimeFilterError = false;
 
-
     @VarAttrDef.VarAttr(name = RUNTIME_FILTER_MODE, needForward = true)
     private String runtimeFilterMode = "GLOBAL";
 
@@ -1749,9 +1698,6 @@ public class SessionVariable implements Serializable, 
Writable {
     @VarAttrDef.VarAttr(name = runtime_filter_wait_infinitely, fuzzy = true, 
needForward = true)
     public boolean runtimeFilterWaitInfinitely = false;
 
-    @VarAttrDef.VarAttr(name = RUNTIME_FILTERS_MAX_NUM, needForward = true)
-    private int runtimeFiltersMaxNum = 10;
-
     // Set runtimeFilterType to IN_OR_BLOOM filter
     @VarAttrDef.VarAttr(name = RUNTIME_FILTER_TYPE, fuzzy = true, needForward 
= true)
     private int runtimeFilterType = 12;
@@ -1822,9 +1768,6 @@ public class SessionVariable implements Serializable, 
Writable {
         }
     }
 
-    @VarAttrDef.VarAttr(name = DISABLE_INVERTED_INDEX_V1_FOR_VARIANT, 
needForward = true)
-    private boolean disableInvertedIndexV1ForVaraint = true;
-
     @Deprecated
     @VarAttrDef.VarAttr(name = ENABLE_VARIANT_FLATTEN_NESTED, needForward = 
true)
     private boolean enableVariantFlattenNested = false;
@@ -1932,9 +1875,6 @@ public class SessionVariable implements Serializable, 
Writable {
     @VarAttrDef.VarAttr(name = GLOBAL_PARTITION_TOPN_THRESHOLD)
     private double globalPartitionTopNThreshold = 100;
 
-    @VarAttrDef.VarAttr(name = ENABLE_INFER_PREDICATE)
-    private boolean enableInferPredicate = true;
-
     @VarAttrDef.VarAttr(name = RETURN_OBJECT_DATA_AS_BINARY)
     private boolean returnObjectDataAsBinary = false;
 
@@ -1982,14 +1922,6 @@ public class SessionVariable implements Serializable, 
Writable {
                     + "(comma-separated integer list)"})
     public String requiredGroupIds = "";
 
-    @VarAttrDef.VarAttr(name = LIMIT_ROWS_FOR_SINGLE_INSTANCE,
-            description = {"当一个 ScanNode 上没有过滤条件,且 limit 值小于这个阈值时,"
-                    + "系统会将这个算子的并发度调整为 1,以减少简单查询的扇出",
-                    "When a ScanNode has no filter conditions and the limit 
value is less than this threshold, "
-                            + "the system will adjust the concurrency of this 
operator to 1 "
-                            + "to reduce the fan-out of simple queries"})
-    public long limitRowsForSingleInstance = 10000;
-
     public boolean isEnableLeftZigZag() {
         return enableLeftZigZag;
     }
@@ -2075,9 +2007,6 @@ public class SessionVariable implements Serializable, 
Writable {
     @VarAttrDef.VarAttr(name = "filter_cost_factor", needForward = true)
     public double filterCostFactor = 0.0001;
 
-    @VarAttrDef.VarAttr(name = NEREIDS_STAR_SCHEMA_SUPPORT)
-    private boolean nereidsStarSchemaSupport = true;
-
     @VarAttrDef.VarAttr(name = ENABLE_NEREIDS_DISTRIBUTE_PLANNER, needForward 
= true,
             fuzzy = false, varType = VariableAnnotation.EXPERIMENTAL, 
description = {
                 "使用新的 nereids 的分布式规划器的开关,这个分布式规划器可以规划出一些更高效的查询计划,比如在某些情况下,"
@@ -2243,11 +2172,6 @@ public class SessionVariable implements Serializable, 
Writable {
      * The current statistics are only used for CBO test,
      * and are not available to users. (work in progress)
      */
-    @VarAttrDef.VarAttr(name = ENABLE_CBO_STATISTICS)
-    public boolean enableCboStatistics = false;
-
-    @VarAttrDef.VarAttr(name = ENABLE_ELIMINATE_SORT_NODE)
-    public boolean enableEliminateSortNode = true;
 
     @VarAttrDef.VarAttr(name = PARTITION_PRUNING_EXPAND_THRESHOLD, fuzzy = 
true)
     public int partitionPruningExpandThreshold = 10;
@@ -2370,10 +2294,6 @@ public class SessionVariable implements Serializable, 
Writable {
                             + "Format: db1.tbl1,db2.tbl2 or * for all MOR 
tables."})
     public String readMorAsDupTables = "";
 
-    // Whether drop table when create table as select insert data appear error.
-    @VarAttrDef.VarAttr(name = DROP_TABLE_IF_CTAS_FAILED, needForward = true)
-    public boolean dropTableIfCtasFailed = true;
-
     @VarAttrDef.VarAttr(name = MAX_TABLE_COUNT_USE_CASCADES_JOIN_REORDER, 
needForward = true)
     public int maxTableCountUseCascadesJoinReorder = 10;
 
@@ -2448,9 +2368,6 @@ public class SessionVariable implements Serializable, 
Writable {
     @VarAttrDef.VarAttr(name = ENABLE_FOLD_NONDETERMINISTIC_FN)
     public boolean enableFoldNondeterministicFn = false;
 
-    @VarAttrDef.VarAttr(name = TRACE_NEREIDS)
-    public boolean traceNereids = false;
-
     @VarAttrDef.VarAttr(name = PLAN_NEREIDS_DUMP)
     public boolean planNereidsDump = false;
 
@@ -2559,7 +2476,6 @@ public class SessionVariable implements Serializable, 
Writable {
             setter = "setOrcTinyStripeThresholdBytes")
     public long orcTinyStripeThresholdBytes  = 8L * 1024L * 1024L;
 
-
     @VarAttrDef.VarAttr(
             name = ORC_ONCE_MAX_READ_BYTES,
             fuzzy = true,
@@ -2573,7 +2489,6 @@ public class SessionVariable implements Serializable, 
Writable {
             setter = "setOrcOnceMaxReadBytes")
     public long orcOnceMaxReadBytes = 8L * 1024L * 1024L;
 
-
     @VarAttrDef.VarAttr(
             name = ORC_MAX_MERGE_DISTANCE_BYTES,
             fuzzy = true,
@@ -2586,7 +2501,6 @@ public class SessionVariable implements Serializable, 
Writable {
             setter = "setOrcMaxMergeDistanceBytes")
     public long orcMaxMergeDistanceBytes = 1024L * 1024L;
 
-
     @VarAttrDef.VarAttr(
             name = ENABLE_PARQUET_FILTER_BY_MIN_MAX,
             fuzzy = true,
@@ -2801,7 +2715,6 @@ public class SessionVariable implements Serializable, 
Writable {
     })
     public long hugeTableDefaultSampleRows = 4194304;
 
-
     @VarAttrDef.VarAttr(name = HUGE_TABLE_LOWER_BOUND_SIZE_IN_BYTES, flag = 
VarAttrDef.GLOBAL,
             description = {
                     "大小超过该值的表将会自动通过采样收集统计信息",
@@ -2912,11 +2825,6 @@ public class SessionVariable implements Serializable, 
Writable {
                     "Whether enable materialized view nest rewrite"})
     public boolean enableMaterializedViewNestRewrite = false;
 
-    @VarAttrDef.VarAttr(name = ENABLE_SYNC_MV_COST_BASED_REWRITE, needForward 
= true,
-            description = {"是否允许基于代价改写同步物化视图",
-                    "Whether enable cost based rewrite for sync mv"}, varType 
= VariableAnnotation.REMOVED)
-    public boolean enableSyncMvCostBasedRewrite = true;
-
     @VarAttrDef.VarAttr(name = 
MATERIALIZED_VIEW_REWRITE_DURATION_THRESHOLD_MS, needForward = true,
             description = {"物化视图透明改写允许的最长耗时,超过此时长不再进行透明改写",
                     "The maximum duration allowed for transparent rewriting of 
materialized views; "
@@ -2928,7 +2836,6 @@ public class SessionVariable implements Serializable, 
Writable {
                     "The maximum number of partitions created during table 
creation"})
     public int createTablePartitionMaxNum = 10000;
 
-
     @VarAttrDef.VarAttr(name = HIVE_PARQUET_USE_COLUMN_NAMES, 
affectQueryResultInExecution = true,
             description = {"默认情况下按名称访问 Parquet 列。将此属性设置为“false”可按 Hive 
表定义中的序号位置访问列。",
                     "Access Parquet columns by name by default. Set this 
property to `false` to access columns "
@@ -3277,7 +3184,6 @@ public class SessionVariable implements Serializable, 
Writable {
                     "用于控制结果反序列化时 thrift 字段的最大值,当遇到类似\"MaxMessageSize 
reached\"这样的错误时可以考虑修改该参数"})
     public int maxMsgSizeOfResultReceiver = 
TConfiguration.DEFAULT_MAX_MESSAGE_SIZE;
 
-
     // CLOUD_VARIABLES_BEGIN
     @VarAttrDef.VarAttr(name = CLOUD_CLUSTER, alias = {COMPUTE_GROUP})
     public String cloudCluster = "";
@@ -3719,7 +3625,6 @@ public class SessionVariable implements Serializable, 
Writable {
     )
     public boolean defaultVariantEnableDocMode = false;
 
-
     @VarAttrDef.VarAttr(
             name = DEFAULT_VARIANT_DOC_MATERIALIZATION_MIN_ROWS,
             needForward = true,
@@ -4100,7 +4005,6 @@ public class SessionVariable implements Serializable, 
Writable {
         return insertTimeoutS;
     }
 
-
     public void setInsertTimeoutS(int insertTimeoutS) {
         this.insertTimeoutS = insertTimeoutS;
     }
@@ -4409,7 +4313,6 @@ public class SessionVariable implements Serializable, 
Writable {
         return val;
     }
 
-
     private int checkFieldValue(String variableName, int minValue, String 
value) throws Exception {
         int val = Integer.valueOf(value);
         if (val < minValue) {
@@ -4644,22 +4547,7 @@ public class SessionVariable implements Serializable, 
Writable {
         return forwardToMaster;
     }
 
-    public boolean isUseV2Rollup() {
-        return useV2Rollup;
-    }
-
     // for unit test
-    public void setUseV2Rollup(boolean useV2Rollup) {
-        this.useV2Rollup = useV2Rollup;
-    }
-
-    public boolean isRewriteCountDistinct() {
-        return rewriteCountDistinct;
-    }
-
-    public void setRewriteCountDistinct(boolean rewriteCountDistinct) {
-        this.rewriteCountDistinct = rewriteCountDistinct;
-    }
 
     public String getEventScheduler() {
         return eventScheduler;
@@ -4777,14 +4665,6 @@ public class SessionVariable implements Serializable, 
Writable {
         this.runtimeFilterWaitTimeMs = runtimeFilterWaitTimeMs;
     }
 
-    public int getRuntimeFiltersMaxNum() {
-        return runtimeFiltersMaxNum;
-    }
-
-    public void setRuntimeFiltersMaxNum(int runtimeFiltersMaxNum) {
-        this.runtimeFiltersMaxNum = runtimeFiltersMaxNum;
-    }
-
     public int getRuntimeFilterType() {
         return runtimeFilterType;
     }
@@ -4829,10 +4709,6 @@ public class SessionVariable implements Serializable, 
Writable {
         return enableLocalExchange;
     }
 
-    public boolean getEnableCboStatistics() {
-        return enableCboStatistics;
-    }
-
     public long getFileSplitSize() {
         return fileSplitSize;
     }
@@ -4933,14 +4809,14 @@ public class SessionVariable implements Serializable, 
Writable {
         return retryOriginSqlOnConvertFail;
     }
 
-    public String[] getSqlConvertorFeatures() {
-        return enableSqlConvertorFeatures.split(",");
-    }
-
     public String getSqlConvertorConfig() {
         return sqlConvertorConfig;
     }
 
+    public String[] getSqlConvertorFeatures() {
+        return enableSqlConvertorFeatures.split(",");
+    }
+
     public Dialect getSqlParseDialect() {
         return Dialect.getByName(sqlDialect);
     }
@@ -5016,10 +4892,6 @@ public class SessionVariable implements Serializable, 
Writable {
         return deleteWithoutPartition;
     }
 
-    public boolean isExtractWideRangeExpr() {
-        return extractWideRangeExpr;
-    }
-
     public boolean isGroupByAndHavingUseAliasFirst() {
         return groupByAndHavingUseAliasFirst;
     }
@@ -5080,14 +4952,6 @@ public class SessionVariable implements Serializable, 
Writable {
         this.returnObjectDataAsBinary = returnObjectDataAsBinary;
     }
 
-    public boolean isEnableInferPredicate() {
-        return enableInferPredicate;
-    }
-
-    public void setEnableInferPredicate(boolean enableInferPredicate) {
-        this.enableInferPredicate = enableInferPredicate;
-    }
-
     public boolean isEnableProjection() {
         return enableProjection;
     }
@@ -5361,10 +5225,6 @@ public class SessionVariable implements Serializable, 
Writable {
         this.readHiveJsonInOneColumn = readHiveJsonInOneColumn;
     }
 
-    public boolean isDropTableIfCtasFailed() {
-        return dropTableIfCtasFailed;
-    }
-
     public void checkQueryTimeoutValid(String newQueryTimeout) {
         int value = Integer.valueOf(newQueryTimeout);
         if (value <= 0) {
@@ -5437,12 +5297,10 @@ public class SessionVariable implements Serializable, 
Writable {
         this.enableInvertedIndexQuery = enableInvertedIndexQuery;
     }
 
-
     public boolean isEnableCommonExprPushdownForInvertedIndex() {
         return enableCommonExpPushDownForInvertedIndex;
     }
 
-
     public void setEnableCommonExprPushdownForInvertedIndex(boolean 
enableCommonExpPushDownForInvertedIndex) {
         this.enableCommonExpPushDownForInvertedIndex = 
enableCommonExpPushDownForInvertedIndex;
     }
@@ -5799,7 +5657,6 @@ public class SessionVariable implements Serializable, 
Writable {
         Text.writeString(out, root.toString());
     }
 
-
     public void readFields(DataInput in) throws IOException {
         String json = Text.readString(in);
         readFromJson(json);
@@ -5996,14 +5853,6 @@ public class SessionVariable implements Serializable, 
Writable {
         return "";
     }
 
-    public boolean isTraceNereids() {
-        return traceNereids;
-    }
-
-    public void setTraceNereids(boolean traceNereids) {
-        this.traceNereids = traceNereids;
-    }
-
     public boolean isPlayNereidsDump() {
         return planNereidsDump;
     }
@@ -6339,7 +6188,6 @@ public class SessionVariable implements Serializable, 
Writable {
         this.enableMaterializedViewRewrite = enableMaterializedViewRewrite;
     }
 
-
     public String getPreMaterializedViewRewriteStrategy() {
         return preMaterializedViewRewriteStrategy;
     }
@@ -6426,7 +6274,6 @@ public class SessionVariable implements Serializable, 
Writable {
         return ignoreSplitType;
     }
 
-
     public void checkIgnoreSplitType(String value) {
         try {
             IgnoreSplitType.valueOf(value);
@@ -6436,7 +6283,6 @@ public class SessionVariable implements Serializable, 
Writable {
         }
     }
 
-
     public boolean getUseConsistentHashForExternalScan() {
         return useConsistentHashForExternalScan;
     }
@@ -6499,14 +6345,6 @@ public class SessionVariable implements Serializable, 
Writable {
         return useSerialExchange && getEnableLocalExchange();
     }
 
-    public void setDisableInvertedIndexV1ForVaraint(boolean 
disableInvertedIndexV1ForVaraint) {
-        this.disableInvertedIndexV1ForVaraint = 
disableInvertedIndexV1ForVaraint;
-    }
-
-    public boolean getDisableInvertedIndexV1ForVaraint() {
-        return disableInvertedIndexV1ForVaraint;
-    }
-
     @Deprecated
     public void setEnableVariantFlattenNested(boolean 
enableVariantFlattenNested) {
         this.enableVariantFlattenNested = enableVariantFlattenNested;
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java
index 42bea5743e5..315cc43765b 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java
@@ -40,6 +40,7 @@ import org.apache.doris.statistics.util.StatisticsUtil;
 import com.google.common.base.Preconditions;
 import com.google.common.base.Strings;
 import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.ImmutableSortedMap;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
@@ -127,6 +128,32 @@ public class VariableMgr {
     private static final Lock rlock = rwlock.readLock();
     private static final Lock wlock = rwlock.writeLock();
 
+    // Session variables that have been removed from SessionVariable.java but 
may still appear in
+    // user scripts, JDBC client connection init, or older replayed-edit logs. 
Looking up these
+    // names by SET or SELECT @@ silently no-ops instead of throwing 
ERR_UNKNOWN_SYSTEM_VARIABLE,
+    // so a BE-then-FE rolling upgrade does not break existing workloads. All 
entries in this set
+    // must use lowercase to match the case-insensitive comparison.
+    private static final ImmutableSet<String> REMOVED_SESSION_VAR_NAMES = 
ImmutableSet.of(
+            "use_v2_rollup",
+            "rewrite_count_distinct_to_bitmap_hll",
+            "enable_variant_access_in_original_planner",
+            "extract_wide_range_expr",
+            "auto_broadcast_join_threshold",
+            "runtime_filters_max_num",
+            "disable_inverted_index_v1_for_variant",
+            "enable_infer_predicate",
+            "limit_rows_for_single_instance",
+            "nereids_star_schema_support",
+            "enable_cbo_statistics",
+            "enable_eliminate_sort_node",
+            "drop_table_if_ctas_failed",
+            "trace_nereids",
+            "enable_sync_mv_cost_based_rewrite");
+
+    private static boolean isRemovedSessionVar(String varName) {
+        return varName != null && 
REMOVED_SESSION_VAR_NAMES.contains(varName.toLowerCase());
+    }
+
     // Form map from variable name to its field in Java class.
     static {
         // Session value
@@ -280,6 +307,13 @@ public class VariableMgr {
             throws DdlException {
         VarContext varCtx = getVarContext(setVar.getVariable());
         if (varCtx == null) {
+            // Silently ignore variables that have been removed from 
SessionVariable.
+            // This preserves backward compatibility for clients still issuing 
SET on the old name
+            // during a BE-then-FE rolling upgrade.
+            if (isRemovedSessionVar(setVar.getVariable())) {
+                LOG.debug("Ignoring removed session variable: {}", 
setVar.getVariable());
+                return;
+            }
             // Check if the variable is in the MySQL compatibility whitelist
             if (isInMySQLCompatWhitelist(setVar.getVariable())) {
                 // Silently ignore whitelisted variables for MySQL 
compatibility
@@ -325,6 +359,10 @@ public class VariableMgr {
             throws DdlException {
         VarContext varCtx = getVarContext(setVar.getVariable());
         if (varCtx == null) {
+            if (isRemovedSessionVar(setVar.getVariable())) {
+                LOG.debug("Ignoring removed session variable: {}", 
setVar.getVariable());
+                return;
+            }
             // Check if the variable is in the MySQL compatibility whitelist
             if (isInMySQLCompatWhitelist(setVar.getVariable())) {
                 // Silently ignore whitelisted variables for MySQL 
compatibility
@@ -506,6 +544,13 @@ public class VariableMgr {
     public static void fillValue(SessionVariable var, VariableExpr desc) 
throws AnalysisException {
         VarContext ctx = getVarContext(desc.getName());
         if (ctx == null) {
+            if (isRemovedSessionVar(desc.getName())) {
+                // Treat removed session variables as empty string for read 
access,
+                // preserving compatibility with clients that still SELECT 
@@<removed_var>.
+                desc.setType(Type.VARCHAR);
+                desc.setStringValue("");
+                return;
+            }
             
ErrorReport.reportAnalysisException(ErrorCode.ERR_UNKNOWN_SYSTEM_VARIABLE, 
desc.getName());
         }
 
@@ -583,6 +628,9 @@ public class VariableMgr {
     private static String getValue(SessionVariable var, String name, SetType 
setType) throws AnalysisException {
         VarContext ctx = ctxByVarName.get(name);
         if (ctx == null) {
+            if (isRemovedSessionVar(name)) {
+                return "";
+            }
             
ErrorReport.reportAnalysisException(ErrorCode.ERR_UNKNOWN_SYSTEM_VARIABLE, 
name);
         }
 
@@ -606,6 +654,12 @@ public class VariableMgr {
 
     // For Nereids optimizer
     public static @Nullable Literal getLiteral(SessionVariable var, String 
name, SetType setType) {
+        if (isRemovedSessionVar(name)) {
+            // Match the no-op behavior used by setVar/getValue for removed 
session
+            // variables so that SELECT @@<removed_var> doesn't break clients 
during
+            // a BE-then-FE rolling upgrade.
+            return new 
org.apache.doris.nereids.trees.expressions.literal.StringLiteral("");
+        }
         VarContext ctx = getVarContext(name);
         if (ctx == null) {
             return null;
diff --git 
a/regression-test/data/query_p0/set/test_removed_session_variables.out 
b/regression-test/data/query_p0/set/test_removed_session_variables.out
new file mode 100644
index 00000000000..6a4464b966b
--- /dev/null
+++ b/regression-test/data/query_p0/set/test_removed_session_variables.out
@@ -0,0 +1,13 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !select_use_v2_rollup --
+
+
+-- !select_trace_nereids --
+
+
+-- !select_runtime_filters_max_num --
+
+
+-- !select_enable_cbo_statistics --
+
+
diff --git 
a/regression-test/suites/query_p0/set/test_removed_session_variables.groovy 
b/regression-test/suites/query_p0/set/test_removed_session_variables.groovy
new file mode 100644
index 00000000000..4e39984f297
--- /dev/null
+++ b/regression-test/suites/query_p0/set/test_removed_session_variables.groovy
@@ -0,0 +1,87 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("test_removed_session_variables") {
+
+    // Session variables that have been removed from SessionVariable.java.
+    // For backward compatibility (BE-then-FE rolling upgrade), SET on these 
names must
+    // silently no-op and SELECT @@<name> must return an empty string instead 
of throwing
+    // ERR_UNKNOWN_SYSTEM_VARIABLE.
+    def removedVars = [
+            "use_v2_rollup",
+            "rewrite_count_distinct_to_bitmap_hll",
+            "enable_variant_access_in_original_planner",
+            "extract_wide_range_expr",
+            "auto_broadcast_join_threshold",
+            "runtime_filters_max_num",
+            "disable_inverted_index_v1_for_variant",
+            "enable_infer_predicate",
+            "limit_rows_for_single_instance",
+            "nereids_star_schema_support",
+            "enable_cbo_statistics",
+            "enable_eliminate_sort_node",
+            "drop_table_if_ctas_failed",
+            "trace_nereids",
+            "enable_sync_mv_cost_based_rewrite"]
+
+    // Test 1: SET on removed variables silently no-ops (no exception), across 
SET syntaxes.
+    for (String var : removedVars) {
+        sql "set ${var} = 1"
+        sql "set @@${var} = 0"
+        sql "set session ${var} = 1"
+        sql "set @@session.${var} = 0"
+    }
+
+    // Test 2: Case insensitivity - SET still no-ops regardless of case.
+    sql "set USE_V2_ROLLUP = 1"
+    sql "set Trace_Nereids = true"
+    sql "set @@ENABLE_INFER_PREDICATE = 0"
+
+    // Test 3: Combined SET statements mixing removed and normal variables.
+    sql "set use_v2_rollup = 1, query_timeout = 31"
+    sql "set @@trace_nereids = 0, @@enable_infer_predicate = 1"
+
+    // Test 4: A combined SET with a removed variable must not affect the 
normal variable.
+    def originalTimeout = sql "show variables where variable_name = 
'query_timeout'"
+    sql "set runtime_filters_max_num = 10, query_timeout = 12345"
+    def modifiedTimeout = sql "show variables where variable_name = 
'query_timeout'"
+    assertTrue(modifiedTimeout[0][1] == "12345")
+    sql "set query_timeout = ${originalTimeout[0][1]}"
+
+    // Test 5: SELECT @@<removed_var> returns an empty string.
+    order_qt_select_use_v2_rollup "select @@use_v2_rollup"
+    order_qt_select_trace_nereids "select @@trace_nereids"
+    order_qt_select_runtime_filters_max_num "select @@runtime_filters_max_num"
+    order_qt_select_enable_cbo_statistics "select @@enable_cbo_statistics"
+
+    // Test 6: Genuinely unknown variables (not in the removed set) still 
throw.
+    test {
+        sql "set this_variable_never_existed_12345 = 1"
+        exception "Unknown system variable"
+    }
+
+    test {
+        sql "select @@this_variable_never_existed_12345"
+        exception "Unsupported system variable"
+    }
+
+    // Test 7: Normal Doris session variables still work end to end.
+    sql "set query_timeout = 999"
+    def afterSet = sql "show variables where variable_name = 'query_timeout'"
+    assertTrue(afterSet[0][1] == "999")
+    sql "set query_timeout = ${originalTimeout[0][1]}"
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to