A query statement reports an error: Packet is too large to send

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 一个查询语句报错Packet is too large to send

| username: TiDBer_645tgTrB

[TiDB Usage Environment] Production Environment
[TiDB Version] v7.1.1
[Reproduction Path] A query statement
[Encountered Problem: Phenomenon and Impact] When querying, an error is reported: ERROR 1105 (HY000): other error for mpp stream: From MPP<query:<query_ts:1717471917932626263, local_query_id:4185, server_id:3116552, start_ts:450224958435753985>,task_id:3>: Code: 49, e.displayText() = DB::Exception: Check size < max_packet_size failed: Packet is too large to send, size : 2183771461, e.what() = DB::Exception,
No similar errors were found, most of them mentioned insertion exceptions. This query seems to be restricted, but no relevant parameter configuration was found.
Configured maximum query memory usage limit to 5G.
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page

[Attachments: Screenshots/Logs/Monitoring]

| username: 有猫万事足 | Original post link

This max_packet_size cannot be configured; it is a hardcoded value. It is fixed at 2^31 = 2,147,483,648.
The size you are currently trying to send is 2,183,771,461, which indeed exceeds the limit.

Why does this packet exceed 2GB? It’s very strange.

| username: Kongdom | Original post link

Refer to this and take a look.

| username: 像风一样的男子 | Original post link

I’m curious, if a query result is 2GB, how long would it take to transfer? Which user would wait for that?
If it’s returned to the browser for display, wouldn’t the browser crash immediately?

| username: TiDBer_645tgTrB | Original post link

Turning off MPP will stop the errors.

| username: Kongdom | Original post link

:thinking: It should still be caused by scanning a large table.