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

bug: (Primary/Secondary)The secondary database is disconnected from the primary database due to execution of unsupported DDL statements. #1345

Closed
3 tasks done
haitaoguan opened this issue Mar 1, 2023 · 0 comments · Fixed by #1351
Assignees
Labels
A-bug Something isn't working

Comments

@haitaoguan
Copy link
Collaborator

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

  • I confirm there is no existing issue for this

Describe the problem

###master
mysql> create table ttt(id int primary key,name varchar(10),key idx_name(name));
Query OK, 0 rows affected (0.01 sec)

mysql> show create table ttt\G
*************************** 1. row ***************************
       Table: ttt
Create Table: CREATE TABLE `ttt` (
  `id` int(11) NOT NULL,
  `name` varchar(10) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
1 row in set (0.00 sec)

mysql> alter table ttt rename index idx_name to new_idx_name;
Query OK, 0 rows affected (0.00 sec)
Records: 0  Duplicates: 0  Warnings: 0

###slave
mysql> show slave status\G
.....
      Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
           Master_Retry_Count: 86400
                  Master_Bind:
      Last_IO_Error_Timestamp:
     Last_SQL_Error_Timestamp:
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set: 4a1f94f1-6fac-11ed-aa3d-46a07fb8ee2c:1-2
            Executed_Gtid_Set: 4a1f94f1-6fac-11ed-aa3d-46a07fb8ee2c:1
                Auto_Position: 1
         Replicate_Rewrite_DB:
                 Channel_Name:
           Master_TLS_Version:
注:可以看到 Executed_Gtid_Set 比 Retrieved_Gtid_Set 少1,这是因为重命名索引的 DDL 被忽略了,下一步在主上删除索引。

###master
mysql> show create table ttt\G
*************************** 1. row ***************************
       Table: ttt
Create Table: CREATE TABLE `ttt` (
  `id` int(11) NOT NULL,
  `name` varchar(10) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `new_idx_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
1 row in set (0.00 sec)

mysql> drop index new_idx_name on ttt;
Query OK, 0 rows affected (0.01 sec)
Records: 0  Duplicates: 0  Warnings: 0

###slave
mysql> show slave status\G
......
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 1091
               Last_SQL_Error: Coordinator stopped because there were error(s) in the worker(s). The most recent failure being: Worker 1 failed executing transaction '4a1f94f1-6fac-11ed-aa3d-46a07fb8ee2c:3' at master log mybinlog.000001, end_log_pos 714. See error log and/or performance_schema.replication_applier_status_by_worker table for more details about this failure or others, if any.
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 40
                  Master_UUID: 4a1f94f1-6fac-11ed-aa3d-46a07fb8ee2c
             Master_Info_File: /stonedb57/install/data/master.info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State:
           Master_Retry_Count: 86400
                  Master_Bind:
      Last_IO_Error_Timestamp:
     Last_SQL_Error_Timestamp: 230301 14:53:44
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set: 4a1f94f1-6fac-11ed-aa3d-46a07fb8ee2c:1-3
            Executed_Gtid_Set: 4a1f94f1-6fac-11ed-aa3d-46a07fb8ee2c:1
                Auto_Position: 1
         Replicate_Rewrite_DB:
                 Channel_Name:
           Master_TLS_Version:

mysql> select * from performance_schema.replication_applier_status_by_worker\G
*************************** 1. row ***************************
         CHANNEL_NAME:
            WORKER_ID: 1
            THREAD_ID: NULL
        SERVICE_STATE: OFF
LAST_SEEN_TRANSACTION: 4a1f94f1-6fac-11ed-aa3d-46a07fb8ee2c:3
    LAST_ERROR_NUMBER: 1091
   LAST_ERROR_MESSAGE: Worker 1 failed executing transaction '4a1f94f1-6fac-11ed-aa3d-46a07fb8ee2c:3' at master log mybinlog.000001, end_log_pos 714; Error 'Can't DROP 'new_idx_name'; check that column/key exists' on query. Default database: 'db'. Query: 'drop index new_idx_name on ttt'
 LAST_ERROR_TIMESTAMP: 2023-03-01 14:53:44

Expected behavior

No response

How To Reproduce

No response

Environment

build information as follow:
Repository address: https://github.com/stoneatom/stonedb.git:stonedb-5.7-dev
Branch name: stonedb-5.7-dev
Last commit ID: f8df638
Last commit time: Date: Mon Feb 27 19:36:39 2023 +0800
Build time: Date: Tue Feb 28 10:02:51 CST 2023

Are you interested in submitting a PR to solve the problem?

  • Yes, I will!
@haitaoguan haitaoguan added the A-bug Something isn't working label Mar 1, 2023
@wisehead wisehead added this to the stonedb_5.7_v1.0.3 milestone Mar 1, 2023
konghaiya added a commit to konghaiya/stonedb that referenced this issue Mar 2, 2023
…oneatom#1345)

Modify points:
1. Add (RENAME_INDEX) unsupported judgment conditions
2. Remove the redundant filtering logic in (log_event. cpp)
@mergify mergify bot closed this as completed in #1351 Mar 7, 2023
mergify bot pushed a commit that referenced this issue Mar 7, 2023
)

Modify points:
1. Add (RENAME_INDEX) unsupported judgment conditions
2. Remove the redundant filtering logic in (log_event. cpp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants