Skip to content

Mpp maybe take up a lot of memory when SendRequest #40926

@wshwsh12

Description

@wshwsh12

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. Insert some data.
drop table `sli-gauge-metric`;
CREATE TABLE `sli-gauge-metric` (
  `timestamp` bigint(20) NOT NULL,
  `instance` varchar(128) NOT NULL,
  `cluster_id` varchar(128) NOT NULL,
  `metrics` json DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

insert 65536 rows, contains 10000 bytes json text in each row.

  1. Set tiflase replica and wait sync.
  2. Run sql desc analyze select * from `sli-gauge-metric` order by cluster_id;
  3. Use go profile to generate heap graph.

2. What did you expect to see? (Required)

Profile heap only contains the memory of MPP or Sort Executor.

3. What did you see instead (Required)

There are many memory usage in client-go GetRegionError() when recving the FIRST MPPPacket
image

Related code:
https://github.com/tikv/client-go/blob/35416c4c4373bb0ee85e0feef38af777d7b63f4b/tikvrpc/tikvrpc.go#L960

4. What is your TiDB version? (Required)

master

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-6.1This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.affects-6.6affects-7.0affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.severity/majorsig/executionSIG executiontype/bugThe issue is confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions