From 702ee7c15f00841cb6a0f471bd30e377cd166d40 Mon Sep 17 00:00:00 2001 From: Shenghui Wu <793703860@qq.com> Date: Thu, 15 Jul 2021 17:03:33 +0800 Subject: [PATCH] config, sessionctx: deprecate streaming config (#25906) --- config/config.go | 10 ++++++---- executor/show_test.go | 3 +++ sessionctx/variable/sysvar.go | 3 ++- sessionctx/variable/tidb_vars.go | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/config/config.go b/config/config.go index 13593298b3bac..77ac4b3cd3ea4 100644 --- a/config/config.go +++ b/config/config.go @@ -100,10 +100,11 @@ type Config struct { MemQuotaQuery int64 `toml:"mem-quota-query" json:"mem-quota-query"` // TempStorageQuota describe the temporary storage Quota during query exector when OOMUseTmpStorage is enabled // If the quota exceed the capacity of the TempStoragePath, the tidb-server would exit with fatal error - TempStorageQuota int64 `toml:"tmp-storage-quota" json:"tmp-storage-quota"` // Bytes - EnableStreaming bool `toml:"enable-streaming" json:"enable-streaming"` - EnableBatchDML bool `toml:"enable-batch-dml" json:"enable-batch-dml"` - TxnLocalLatches tikvcfg.TxnLocalLatches `toml:"-" json:"-"` + TempStorageQuota int64 `toml:"tmp-storage-quota" json:"tmp-storage-quota"` // Bytes + // Deprecated + EnableStreaming bool `toml:"-" json:"-"` + EnableBatchDML bool `toml:"enable-batch-dml" json:"enable-batch-dml"` + TxnLocalLatches tikvcfg.TxnLocalLatches `toml:"-" json:"-"` // Set sys variable lower-case-table-names, ref: https://dev.mysql.com/doc/refman/5.7/en/identifier-case-sensitivity.html. // TODO: We actually only support mode 2, which keeps the original case, but the comparison is case-insensitive. LowerCaseTableNames int `toml:"lower-case-table-names" json:"lower-case-table-names"` @@ -718,6 +719,7 @@ var deprecatedConfig = map[string]struct{}{ "enable-redact-log": {}, // use variable tidb_redact_log instead "tikv-client.copr-cache.enable": {}, "alter-primary-key": {}, // use NONCLUSTERED keyword instead + "enable-streaming": {}, } func isAllDeprecatedConfigItems(items []string) bool { diff --git a/executor/show_test.go b/executor/show_test.go index c8157366d85a4..120497e797a04 100644 --- a/executor/show_test.go +++ b/executor/show_test.go @@ -1301,6 +1301,9 @@ func (s *testSuite5) TestShowVar(c *C) { // Test Hidden tx_read_ts res = tk.MustQuery("show variables like '%tx_read_ts'") c.Check(res.Rows(), HasLen, 0) + // Test Hidden tidb_enable_streaming + res = tk.MustQuery("show variables like '%tidb_enable_streaming%';") + c.Check(res.Rows(), HasLen, 0) } func (s *testSuite5) TestIssue19507(c *C) { diff --git a/sessionctx/variable/sysvar.go b/sessionctx/variable/sysvar.go index 25874ab9ac197..a891da3926bcb 100644 --- a/sessionctx/variable/sysvar.go +++ b/sessionctx/variable/sysvar.go @@ -1106,7 +1106,8 @@ var defaultSysVars = []*SysVar{ appendDeprecationWarning(vars, TiDBMemQuotaIndexLookupJoin, TiDBMemQuotaQuery) return normalizedValue, nil }}, - {Scope: ScopeSession, Name: TiDBEnableStreaming, Value: Off, Type: TypeBool, skipInit: true, SetSession: func(s *SessionVars, val string) error { + // Deprecated: tidb_enable_streaming + {Scope: ScopeSession, Name: TiDBEnableStreaming, Value: Off, Type: TypeBool, skipInit: true, Hidden: true, SetSession: func(s *SessionVars, val string) error { s.EnableStreaming = TiDBOptOn(val) return nil }}, diff --git a/sessionctx/variable/tidb_vars.go b/sessionctx/variable/tidb_vars.go index 1fe33360c6b14..f7141e2919d61 100644 --- a/sessionctx/variable/tidb_vars.go +++ b/sessionctx/variable/tidb_vars.go @@ -135,7 +135,7 @@ const ( // tidb_disable_txn_auto_retry disables transaction auto retry. TiDBDisableTxnAutoRetry = "tidb_disable_txn_auto_retry" - // tidb_enable_streaming enables TiDB to use streaming API for coprocessor requests. + // Deprecated: tidb_enable_streaming enables TiDB to use streaming API for coprocessor requests. TiDBEnableStreaming = "tidb_enable_streaming" // tidb_enable_chunk_rpc enables TiDB to use Chunk format for coprocessor requests.