pingcap / pingcap/docs

Changing `tidb_enable_parallel_hashagg_spill` to `OFF` does not report errors

Open
#18,871 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
617
Forks
724
Avg merge
2d 10h
Merged PRs (30d)
223

Description

Error Report

Please answer the following questions before submitting your issue. Thanks!

  1. What is the URL/path of the document related to this issue?
    https://docs.pingcap.com/tidb/dev/system-variables#tidb_enable_parallel_hashagg_spill-new-in-v800

This variable controls whether TiDB supports disk spill for the parallel HashAgg algorithm. When it is ON, the HashAgg operator can automatically trigger data spill based on memory usage under any parallel conditions, thus balancing performance and data throughput. It is not recommended to set this variable to OFF. Starting from v8.2.0, setting it to OFF will report an error. This variable will be deprecated in a future release.

  1. How would you like to improve it?

Actually, changing tidb_enable_parallel_hashagg_spill value at session level does not raise errors. It just raises a warning. Also, changing tidb_enable_parallel_hashagg_spill` value at global level is accepted without any warnings/errors.

Steps to reproduce
  1. Startup tiup playground v8.3.0
% tiup playground v8.3.0
  1. Connect to the tiup playground instance
mysql --comments --host 127.0.0.1 --port 4000 -u root
  1. Run these statements to see if changing tidb_enable_parallel_hashagg_spill value to OFF raises any errors as documented.
mysql> select @@global.tidb_enable_parallel_hashagg_spill, @@session.tidb_enable_parallel_hashagg_spill;
+---------------------------------------------+----------------------------------------------+
| @@global.tidb_enable_parallel_hashagg_spill | @@session.tidb_enable_parallel_hashagg_spill |
+---------------------------------------------+----------------------------------------------+
|                                           1 |                                            1 |
+---------------------------------------------+----------------------------------------------+
1 row in set (0.00 sec)

mysql> set tidb_enable_parallel_hashagg_spill = off;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+-----------------------------------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                                               |
+---------+------+-----------------------------------------------------------------------------------------------------------------------+
| Warning | 1681 | tidb_enable_parallel_hashagg_spill will be removed in the future and hash aggregate spill will be enabled by default. |
+---------+------+-----------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> select @@global.tidb_enable_parallel_hashagg_spill, @@session.tidb_enable_parallel_hashagg_spill;
+---------------------------------------------+----------------------------------------------+
| @@global.tidb_enable_parallel_hashagg_spill | @@session.tidb_enable_parallel_hashagg_spill |
+---------------------------------------------+----------------------------------------------+
|                                           1 |                                            0 |
+---------------------------------------------+----------------------------------------------+
1 row in set (0.00 sec)

mysql> set global tidb_enable_parallel_hashagg_spill = off;
Query OK, 0 rows affected (0.02 sec)

mysql> show warnings;
Empty set (0.00 sec)

mysql> select @@global.tidb_enable_parallel_hashagg_spill, @@session.tidb_enable_parallel_hashagg_spill;
+---------------------------------------------+----------------------------------------------+
| @@global.tidb_enable_parallel_hashagg_spill | @@session.tidb_enable_parallel_hashagg_spill |
+---------------------------------------------+----------------------------------------------+
|                                           0 |                                            0 |
+---------------------------------------------+----------------------------------------------+
1 row in set (0.00 sec)

mysql>
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v8.3.0
Edition: Community
Git Commit Hash: 1a0c3ac3292fff7742faa0c00a662ccb66ba40db
Git Branch: HEAD
UTC Build Time: 2024-08-20 10:23:00
GoVersion: go1.21.10
Race Enabled: false
Check Table Before Drop: false
Store: tikv
1 row in set (0.00 sec)

mysql>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked system-variables documentation and reproduce the session- and global-level SET statements on TiDB v8.3.0 using the commands shown. Compare the observed warning and error behavior with the documented claim; done means the documentation and actual behavior agree, with the discrepancy resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
databases, documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.