Skip to content

Commit

Permalink
config, sessionctx: deprecate streaming config (pingcap#25906)
Browse files Browse the repository at this point in the history
  • Loading branch information
wshwsh12 authored Jul 15, 2021
1 parent 05bedf7 commit 702ee7c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
10 changes: 6 additions & 4 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions executor/show_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion sessionctx/variable/sysvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}},
Expand Down
2 changes: 1 addition & 1 deletion sessionctx/variable/tidb_vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 702ee7c

Please sign in to comment.