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

TiCDC panicked when handling update events with enable-old-value=false #6198

Closed
zhaoxinyu opened this issue Jul 6, 2022 · 10 comments · Fixed by #6403
Closed

TiCDC panicked when handling update events with enable-old-value=false #6198

zhaoxinyu opened this issue Jul 6, 2022 · 10 comments · Fixed by #6403
Assignees

Comments

@zhaoxinyu
Copy link
Contributor

What did you do?

  1. set enable-old-value = false in changefeed configuration file.
  2. create a table with generated columns
  3. execute update DMLs in upstream TiDB

What did you expect to see?

TiCDC can properly handle this case and panic does not happen.

What did you see instead?

TiCDC panicked

Versions of the cluster

Upstream TiDB cluster version (execute SELECT tidb_version(); in a MySQL client):

5.4.1

Upstream TiKV version (execute tikv-server --version):

5.4.1

TiCDC version (execute cdc version):

5.4.1
@zhaoxinyu zhaoxinyu added area/ticdc Issues or PRs related to TiCDC. type/bug The issue is confirmed as a bug. labels Jul 6, 2022
@zhaoxinyu
Copy link
Contributor Author

/assign @zhaoxinyu

@nongfushanquan
Copy link
Contributor

/assign @hi-rustin

@nongfushanquan
Copy link
Contributor

/unassign @zhaoxinyu

@Rustin170506
Copy link
Member

You can reproduction with these steps:

  1. start tidb and ticdc cluser
  2. create a changefeed and disable the old value
  3. create table
CREATE TABLE person2 (
    name VARCHAR(255) NOT NULL PRIMARY KEY,
    address_info JSON,
    city VARCHAR(64) AS (JSON_UNQUOTE(JSON_EXTRACT(address_info, '$.city'))),
    KEY (city)
);
  1. insert data
INSERT INTO person2 (name, address_info) VALUES ('Morgan', JSON_OBJECT('city', 'Canada'));
  1. Continuously updated data
#!/bin/bash

for ((i = 1; i <= 1000000000000; i++)); do
	mysql --comments --host 127.0.0.1 --port 4000 -u root --password="" <update.sql
done
use test;
UPDATE person2 set name='Morgan' where name='test';
UPDATE person2 set name='test' where name='Morgan';
  1. Continuously DDL
#!/bin/bash

for ((i = 1; i <= 1000000000000; i++)); do
	mysql --comments --host 127.0.0.1 --port 4000 -u root --password="" <add.sql
done
use test;
ALTER TABLE person2 ADD c1 int;
ALTER TABLE person2 DROP COLUMN c1;
  1. TiCDC Panic

@Rustin170506
Copy link
Member

The reason is:

if !exist && !fillWithDefaultValue {

When we execute the add column DDL, the data not exist and fillWithDefaultValue is false.

@nongfushanquan
Copy link
Contributor

#6403

@nongfushanquan
Copy link
Contributor

/close

@ti-chi-bot
Copy link
Member

@nongfushanquan: Closing this issue.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@MimeLyc
Copy link

MimeLyc commented Jul 25, 2022

/remove-label affects-6.2

@seiya-annie
Copy link

/found customer

@ti-chi-bot ti-chi-bot bot added the report/customer Customers have encountered this bug. label Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants