polardb / polardbx-sql

PolarDB-X is a cloud native distributed SQL Database designed for high concurrency, massive storage, complex querying scenarios.
Apache License 2.0
1.54k stars 325 forks source link

I ran benchmark but got trapped in a trouble, error message would be pasted followed. #20

Closed adzfolc closed 2 years ago

adzfolc commented 2 years ago

alter table bmsql_district add constraint d_warehouse_fkey foreign key (d_w_id) references bmsql_warehouse (w_id); [134bc68428001000][192.168.10.221:10413][db_test]Failed to execute the DDL task. Caused by: ERR-CODE: [PXC-4636][ERR_DDL_JOB_ERROR] Not all physical DDLs have been executed successfully: 1 expected, 0 done, 1 failed. Caused by: ERR-CODE: [PXC-4614][ERR_EXECUTE_ON_MYSQL] Error occurs when execute on GROUP 'DB_TEST_SINGLE_GROUP' ATOM 'dskey_db_test_single_group#pxc_test-dn-0#192.168.10.221-17298#db_test_single': Failed to open the referenced table 'bmsql_warehouse' ;ERR-CODE: [PXC-4614][ERR_EXECUTE_ON_MYSQL] Error occurs when execute on GROUP 'DB_TEST_SINGLE_GROUP' ATOM 'dskey_db_test_single_group#pxc_test-dn-0#192.168.10.221-17298#db_test_single': Failed to open the referenced table 'bmsql_warehouse' . alter table bmsql_customer add constraint c_district_fkey foreign key (c_w_id, c_d_id) references bmsql_district (d_w_id, d_id); [134bc6855f801000][192.168.10.221:10413][db_test]Failed to execute the DDL task. Caused by: ERR-CODE: [PXC-4636][ERR_DDL_JOB_ERROR] Not all physical DDLs have been executed successfully: 1 expected, 0 done, 1 failed. Caused by: ERR-CODE: [PXC-4614][ERR_EXECUTE_ON_MYSQL] Error occurs when execute on GROUP 'DB_TEST_SINGLE_GROUP' ATOM 'dskey_db_test_single_group#pxc_test-dn-0#192.168.10.221-17298#db_test_single': Failed to open the referenced table 'bmsql_district' ;ERR-CODE: [PXC-4614][ERR_EXECUTE_ON_MYSQL] Error occurs when execute on GROUP 'DB_TEST_SINGLE_GROUP' ATOM 'dskey_db_test_single_group#pxc_test-dn-0#192.168.10.221-17298#db_test_single': Failed to open the referenced table 'bmsql_district' . alter table bmsql_history add constraint h_customer_fkey foreign key (h_c_w_id, h_c_d_id, h_c_id) references bmsql_customer (c_w_id, c_d_id, c_id); [134bc68699001000][192.168.10.221:10413][db_test]Failed to execute the DDL task. Caused by: ERR-CODE: [PXC-4636][ERR_DDL_JOB_ERROR] Not all physical DDLs have been executed successfully: 1 expected, 0 done, 1 failed. Caused by: ERR-CODE: [PXC-4614][ERR_EXECUTE_ON_MYSQL] Error occurs when execute on GROUP 'DB_TEST_SINGLE_GROUP' ATOM 'dskey_db_test_single_group#pxc_test-dn-0#192.168.10.221-17298#db_test_single': Failed to open the referenced table 'bmsql_customer' ;ERR-CODE: [PXC-4614][ERR_EXECUTE_ON_MYSQL] Error occurs when execute on GROUP 'DB_TEST_SINGLE_GROUP' ATOM 'dskey_db_test_single_group#pxc_test-dn-0#192.168.10.221-17298#db_test_single': Failed to open the referenced table 'bmsql_customer' . alter table bmsql_history add constraint h_district_fkey foreign key (h_w_id, h_d_id) references bmsql_district (d_w_id, d_id); [134bc687cf401000][192.168.10.221:10413][db_test]ERR-CODE: [PXC-4644][ERR_PENDING_DDL_JOB_EXISTS] Another DDL job '1390423191423291392' with operation 'ALTER_TABLE' is pending on db_test.bmsql_history in db_test. Please use SHOW DDL to check it, and then recover or rollback it using RECOVER DDL or ROLLBACK DDL, or just remove it using REMOVE DDL if you confirm that the pending job can be discarded. alter table bmsql_new_order add constraint no_order_fkey foreign key (no_w_id, no_d_id, no_o_id) references bmsql_oorder (o_w_id, o_d_id, o_id); [134bc688d1001000][192.168.10.221:10413][db_test]Failed to execute the DDL task. Caused by: ERR-CODE: [PXC-4636][ERR_DDL_JOB_ERROR] Not all physical DDLs have been executed successfully: 1 expected, 0 done, 1 failed. Caused by: ERR-CODE: [PXC-4614][ERR_EXECUTE_ON_MYSQL] Error occurs when execute on GROUP 'DB_TEST_SINGLE_GROUP' ATOM 'dskey_db_test_single_group#pxc_test-dn-0#192.168.10.221-17298#db_test_single': Failed to open the referenced table 'bmsql_oorder' ;ERR-CODE: [PXC-4614][ERR_EXECUTE_ON_MYSQL] Error occurs when execute on GROUP 'DB_TEST_SINGLE_GROUP' ATOM 'dskey_db_test_single_group#pxc_test-dn-0#192.168.10.221-17298#db_test_single': Failed to open the referenced table 'bmsql_oorder' . alter table bmsql_oorder add constraint o_customer_fkey foreign key (o_w_id, o_d_id, o_c_id) references bmsql_customer (c_w_id, c_d_id, c_id); [134bc68a08001000][192.168.10.221:10413][db_test]Failed to execute the DDL task. Caused by: ERR-CODE: [PXC-4636][ERR_DDL_JOB_ERROR] Not all physical DDLs have been executed successfully: 1 expected, 0 done, 1 failed. Caused by: ERR-CODE: [PXC-4614][ERR_EXECUTE_ON_MYSQL] Error occurs when execute on GROUP 'DB_TEST_SINGLE_GROUP' ATOM 'dskey_db_test_single_group#pxc_test-dn-0#192.168.10.221-17298#db_test_single': Failed to open the referenced table 'bmsql_customer' ;ERR-CODE: [PXC-4614][ERR_EXECUTE_ON_MYSQL] Error occurs when execute on GROUP 'DB_TEST_SINGLE_GROUP' ATOM 'dskey_db_test_single_group#pxc_test-dn-0#192.168.10.221-17298#db_test_single': Failed to open the referenced table 'bmsql_customer' . alter table bmsql_order_line add constraint ol_order_fkey foreign key (ol_w_id, ol_d_id, ol_o_id) references bmsql_oorder (o_w_id, o_d_id, o_id); [134bc68b3f001000][192.168.10.221:10413][db_test]Failed to execute the DDL task. Caused by: ERR-CODE: [PXC-4636][ERR_DDL_JOB_ERROR] Not all physical DDLs have been executed successfully: 1 expected, 0 done, 1 failed. Caused by: ERR-CODE: [PXC-4614][ERR_EXECUTE_ON_MYSQL] Error occurs when execute on GROUP 'DB_TEST_SINGLE_GROUP' ATOM 'dskey_db_test_single_group#pxc_test-dn-0#192.168.10.221-17298#db_test_single': Failed to open the referenced table 'bmsql_oorder' ;ERR-CODE: [PXC-4614][ERR_EXECUTE_ON_MYSQL] Error occurs when execute on GROUP 'DB_TEST_SINGLE_GROUP' ATOM 'dskey_db_test_single_group#pxc_test-dn-0#192.168.10.221-17298#db_test_single': Failed to open the referenced table 'bmsql_oorder' . alter table bmsql_order_line add constraint ol_stock_fkey foreign key (ol_supply_w_id, ol_i_id) references bmsql_stock (s_w_id, s_i_id); [134bc68c77001000][192.168.10.221:10413][db_test]ERR-CODE: [PXC-4644][ERR_PENDING_DDL_JOB_EXISTS] Another DDL job '1390423211413344256' with operation 'ALTER_TABLE' is pending on db_test.bmsql_order_line in db_test. Please use SHOW DDL to check it, and then recover or rollback it using RECOVER DDL or ROLLBACK DDL, or just remove it using REMOVE DDL if you confirm that the pending job can be discarded. alter table bmsql_stock add constraint s_warehouse_fkey foreign key (s_w_id) references bmsql_warehouse (w_id); [134bc68d78801000][192.168.10.221:10413][db_test]Failed to execute the DDL task. Caused by: ERR-CODE: [PXC-4636][ERR_DDL_JOB_ERROR] Not all physical DDLs have been executed successfully: 1 expected, 0 done, 1 failed. Caused by: ERR-CODE: [PXC-4614][ERR_EXECUTE_ON_MYSQL] Error occurs when execute on GROUP 'DB_TEST_SINGLE_GROUP' ATOM 'dskey_db_test_single_group#pxc_test-dn-0#192.168.10.221-17298#db_test_single': Failed to open the referenced table 'bmsql_warehouse' ;ERR-CODE: [PXC-4614][ERR_EXECUTE_ON_MYSQL] Error occurs when execute on GROUP 'DB_TEST_SINGLE_GROUP' ATOM 'dskey_db_test_single_group#pxc_test-dn-0#192.168.10.221-17298#db_test_single': Failed to open the referenced table 'bmsql_warehouse' . alter table bmsql_stock add constraint s_item_fkey foreign key (s_i_id) references bmsql_item (i_id); [134bc68eaf001000][192.168.10.221:10413][db_test]ERR-CODE: [PXC-4644][ERR_PENDING_DDL_JOB_EXISTS] Another DDL job '1390423220942802944' with operation 'ALTER_TABLE' is pending on db_test.bmsql_stock in db_test. Please use SHOW DDL to check it, and then recover or rollback it using RECOVER DDL or ROLLBACK DDL, or just remove it using REMOVE DDL if you confirm that the pending job can be discarded.

adzfolc commented 2 years ago

Yesterday I faced up with the same question, i tried several ways while none of them be useful: 图片

adzfolc commented 2 years ago

PolardbX topology yml 图片 Server 220 info 图片 Server 221 info 图片 Server 222 info 图片

earayu commented 2 years ago

"foreign key" is not supported by now.

PolarDB-X didn't ban this kind of syntax, it's a bug. Will fix it later.

To solve your problem, you can cancel the DDL JOB by modifying the metadata. Replace the question mark by actual job_id, you can get it from: show ddl .

/*+TDDL:node('__META_DB__')*/update ddl_engine set supported_commands=3 where job_id = ?;
/*+TDDL:node('__META_DB__')*/update ddl_engine_task set state='READY' where name = 'AlterTablePhyDdlTask' and job_id = ?;
cancel ddl ?;
adzfolc commented 2 years ago

Does PolarX support sysbench gramma?

agapple commented 2 years ago

You can refer to the test steps of TPC-C

Benchmarsksql does not support mysql protocol by default, and some modifications need to be made. You can download our version of benchmarsksql, including table definitions tpcc.tar.gz