Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Owner OOM when upstream TiDB has too many tables #1386

Closed
liuzix opened this issue Feb 1, 2021 · 7 comments · Fixed by #5144
Closed

Owner OOM when upstream TiDB has too many tables #1386

liuzix opened this issue Feb 1, 2021 · 7 comments · Fixed by #5144
Assignees
Labels
affects-5.1 area/ticdc Issues or PRs related to TiCDC. severity/moderate type/bug The issue is confirmed as a bug.

Comments

@liuzix
Copy link
Contributor

liuzix commented Feb 1, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a recipe for reproducing the error.
  • Prepare a TiDB cluster with 40k+ tables, create 8 changefeeds, each of which only replicates a few tables (< 10).
  1. What did you expect to see?
  • That replication goes smoothly, and that memory consumption is not affected by the number of unreplicated tables.
  1. What did you see instead?
  • Owner runs out of memory.
  1. Versions of the cluster

    • TiCDC version (execute cdc version):

      5.0.0-rc
      
@liuzix liuzix added the type/bug The issue is confirmed as a bug. label Feb 1, 2021
@amyangfei amyangfei added the priority/P0 The issue has P0 priority. label Feb 4, 2021
@amyangfei
Copy link
Contributor

Design document (internal only): Design: TiCDC Optimization for Large Number of Unreplicated Tables

@lonng
Copy link
Contributor

lonng commented May 27, 2021

I think this issue should not be marked as severity/critical because support a large number of tables is not our design goal.

This issue should be marked as a feature request.

@IANTHEREAL @amyangfei @overvenus How do you think?

@IANTHEREAL
Copy link
Collaborator

IANTHEREAL commented May 27, 2021

How many tables do we define as a large number of tables?

As many tables as tidb can support, we should support as many tables as we can. This can refer to the definition of TiDB; in addition, we need to support incremental data backup in Q2/Q3. By then, this goal will definitely be accomplished.

@AkiraXie AkiraXie added the area/ticdc Issues or PRs related to TiCDC. label Dec 6, 2021
@overvenus overvenus assigned overvenus and unassigned liuzix Dec 7, 2021
@overvenus overvenus added severity/moderate and removed severity/major priority/P0 The issue has P0 priority. labels Dec 8, 2021
@overvenus
Copy link
Member

For now, OOM only occurs when upstream TiDB 1) has many tables and DDL frequently, it's not the case for most users, change to severity/moderate.

@overvenus
Copy link
Member

In #4068, we found that truncating tables also triggers the issue.

Reproduce steps:

mysql -h $HOST -P $PORT -u root -E -e 'create database if not exists truncate500;'

for i in $(seq 1 500); do {
    mysql -h $HOST -P $PORT -u root -E -e "
CREATE TABLE if not exists truncate500.orders_$i (
  o_id int(11) NOT NULL,
  o_d_id int(11) NOT NULL,
  o_w_id int(11) NOT NULL,
  o_c_id int(11) DEFAULT NULL,
  o_entry_d datetime DEFAULT NULL,
  o_carrier_id int(11) DEFAULT NULL,
  o_ol_cnt int(11) DEFAULT NULL,
  o_all_local int(11) DEFAULT NULL,
  PRIMARY KEY (o_w_id,o_d_id,o_id),
  KEY idx_order (o_w_id,o_d_id,o_c_id,o_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;";
} done

for i in $(seq 0 25000); do {
    t=$(( i % 500 ))
    mysql -h $HOST -P $PORT -u root -E -e "TRUNCATE TABLE truncate500.orders_$t;"
} done

@nongfushanquan
Copy link
Contributor

/label affects-5.1

@nongfushanquan
Copy link
Contributor

/unassign @overvenus
/assign @hicqu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.1 area/ticdc Issues or PRs related to TiCDC. severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.