Skip to content

Commit

Permalink
fix(mysql): dbbackup 物理备份去掉 safe-slave 选项 #3832
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlook authored and zhangzhw8 committed Apr 7, 2024
1 parent 771bb47 commit 7bdf501
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ INSERT INTO `tb_config_file_def` (`id`, `namespace`, `conf_type`, `conf_file`, `
INSERT INTO `tb_config_file_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_type_lc`, `conf_file_lc`, `level_names`, `level_versioned`, `conf_name_validate`, `conf_value_validate`, `value_type_strict`, `namespace_info`, `version_keep_limit`, `version_keep_days`, `conf_name_order`, `description`, `created_at`, `updated_at`, `updated_by`) VALUES (172,'rediscomm','config','heartbeat','配置','心跳相关的配置','pub,plat,app,module,cluster','cluster',1,1,0,'Tendisplus',5,365,0,'心跳相关的配置','2023-02-28 15:01:19','2023-04-06 11:59:44','');
INSERT INTO `tb_config_file_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_type_lc`, `conf_file_lc`, `level_names`, `level_versioned`, `conf_name_validate`, `conf_value_validate`, `value_type_strict`, `namespace_info`, `version_keep_limit`, `version_keep_days`, `conf_name_order`, `description`, `created_at`, `updated_at`, `updated_by`) VALUES (125,'rediscomm','config','hotkey','大key相关配置','hotkey','pub,plat,app,module,cluster','cluster',1,1,0,'rediscomm',5,365,0,'大key相关配置','2022-11-29 14:51:54','2023-06-30 17:29:23','');
INSERT INTO `tb_config_file_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_type_lc`, `conf_file_lc`, `level_names`, `level_versioned`, `conf_name_validate`, `conf_value_validate`, `value_type_strict`, `namespace_info`, `version_keep_limit`, `version_keep_days`, `conf_name_order`, `description`, `created_at`, `updated_at`, `updated_by`) VALUES (127,'rediscomm','config','keymod','key模式相关配置','keymod','pub,plat,app,module,cluster','cluster',1,1,0,'rediscomm',5,365,0,'key模式相关配置','2022-11-29 14:51:54','2023-06-30 17:29:16','');
INSERT INTO `tb_config_file_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_type_lc`, `conf_file_lc`, `level_names`, `level_versioned`, `conf_name_validate`, `conf_value_validate`, `value_type_strict`, `namespace_info`, `version_keep_limit`, `version_keep_days`, `conf_name_order`, `description`, `created_at`, `updated_at`, `updated_by`) VALUES (338,'rediscomm','config','maxmemory_set','配置','maxmemory设置的配置','pub,plat,app,module,cluster','cluster',1,1,0,'tendisCache',5,365,0,NULL,'2024-03-27 18:54:28','2024-03-27 18:54:28','');
INSERT INTO `tb_config_file_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_type_lc`, `conf_file_lc`, `level_names`, `level_versioned`, `conf_name_validate`, `conf_value_validate`, `value_type_strict`, `namespace_info`, `version_keep_limit`, `version_keep_days`, `conf_name_order`, `description`, `created_at`, `updated_at`, `updated_by`) VALUES (173,'rediscomm','config','monitor','配置','监控相关的配置','pub,plat,app,module,cluster','cluster',1,1,0,'Tendisplus',5,365,0,'监控相关的配置','2023-02-28 15:01:19','2023-04-06 11:59:44','');
/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */;
/*!50112 PREPARE s FROM @disable_bulk_load */;
Expand Down Expand Up @@ -95,6 +96,10 @@ INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (12975,'rediscomm','config','hotkey','duration_seconds','int','30',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2022-11-29 15:00:02','2022-11-29 17:08:30',0);
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (13938,'rediscomm','config','hotkey','top_count','int','10','','',1,0,0,0,0,NULL,NULL,NULL,-1,NULL,NULL,'2023-02-28 15:01:19','2023-02-28 15:01:19',0);
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (12974,'rediscomm','config','hotkye','top_count','int','10',NULL,'',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2022-11-29 15:00:02','2022-11-29 17:08:30',0);
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (22906,'rediscomm','config','maxmemory_set','bk_biz_id_blacklist','STRING','','','',1,0,0,0,0,NULL,NULL,NULL,-1,NULL,NULL,'2024-03-27 18:54:28','2024-03-28 11:36:36',0);
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (22907,'rediscomm','config','maxmemory_set','domains_blacklist','STRING','','','',1,0,0,0,0,NULL,NULL,NULL,-1,NULL,NULL,'2024-03-27 18:54:28','2024-03-27 18:54:28',0);
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (22905,'rediscomm','config','maxmemory_set','master_used_memory_change_percent','INT','20','[0,1000]','RANGE',1,0,0,0,0,NULL,NULL,NULL,-1,NULL,NULL,'2024-03-27 18:54:28','2024-03-27 18:54:28',0);
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (22904,'rediscomm','config','maxmemory_set','master_used_memory_change_threshold','STRING','200MB','','',1,0,0,0,0,NULL,NULL,NULL,-1,NULL,NULL,'2024-03-27 18:54:28','2024-03-27 18:54:28',0);
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (15965,'rediscomm','config','monitor','bkmonitor_event_data_id','INT','542898','','',1,0,0,0,0,NULL,NULL,NULL,-1,NULL,NULL,'2023-04-06 11:54:33','2023-04-06 11:54:33',0);
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (15966,'rediscomm','config','monitor','bkmonitor_event_token','STRING','8108b6fe1c8343ca8d6538652242d439','','',1,0,0,0,0,NULL,NULL,NULL,-1,NULL,NULL,'2023-04-06 11:54:33','2023-04-06 11:54:33',0);
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (15968,'rediscomm','config','monitor','bkmonitor_metirc_token','STRING','4301571541434e1091cb70af6164ee67','','',1,0,0,0,0,NULL,NULL,NULL,-1,NULL,NULL,'2023-04-06 11:54:33','2023-04-06 11:54:33',0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1084,9 +1084,7 @@ INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (15503,'tendbcluster','dbconf','Spider-1','mysqld.relay_log_recovery','INT','1','1 | 0','ENUM',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-03-09 17:55:11','2023-04-19 15:10:13',0);
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (15508,'tendbcluster','dbconf','Spider-1','mysqld.server_id','STRING','{{.Mysqld.ServerId}}',NULL,'',2,0,0,0,1,'{{mysqld.server_id}}',NULL,NULL,-1,NULL,NULL,'2023-03-09 17:55:11','2023-03-28 18:01:00',0);
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (15510,'tendbcluster','dbconf','Spider-1','mysqld.skip-name-resolve','STRING','true','true | false','ENUM',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-03-09 17:55:11','2023-03-09 18:37:22',0);
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (15511,'tendbcluster','dbconf','Spider-1','mysqld.slave_compressed_protocol','INT','1','1 | 0','ENUM',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-03-09 17:55:11','2023-04-19 15:11:00',0);
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (15512,'tendbcluster','dbconf','Spider-1','mysqld.slave_exec_mode','STRING','STRICT','|STRICT|IDEMPOTENT','ENUM',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2023-03-09 17:55:11','2023-04-19 15:10:13',0);
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (15514,'tendbcluster','dbconf','Spider-1','mysqld.slave_parallel_workers','INT','0','0| 1| 2| 4| 8| 16| 32| 64','ENUM',1,0,0,0,0,NULL,NULL,NULL,-1,NULL,NULL,'2023-03-09 17:55:11','2024-03-26 10:25:20',0);
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (15515,'tendbcluster','dbconf','Spider-1','mysqld.slow_launch_time','INT','2','[1,10]','RANGE',-1,0,0,0,0,NULL,NULL,NULL,-1,NULL,'If creating a thread takes longer than this many seconds, the server increments the Slow_launch_threads status variable','2023-03-09 17:55:11','2023-03-09 17:55:11',0);
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (15516,'tendbcluster','dbconf','Spider-1','mysqld.slow_query_log','STRING','ON','ON | OFF','ENUM',1,0,0,0,0,NULL,NULL,NULL,-1,NULL,NULL,'2023-03-09 17:55:11','2023-04-17 15:00:55',0);
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (15517,'tendbcluster','dbconf','Spider-1','mysqld.slow_query_log_file','STRING','{{.Mysqld.Logdir}}/slow-query.log',NULL,'',2,0,0,0,1,'{{mysqld.slow_query_log_file}}',NULL,NULL,-1,NULL,NULL,'2023-03-09 17:55:11','2023-03-28 18:00:48',0);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DELETE FROM tb_config_file_def WHERE namespace='tendbcomm';
DELETE FROM tb_config_name_def WHERE namespace='tendbcomm' AND (flag_encrypt!=1 or value_default like '{{%');
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
--
-- Dumping data for table `tb_config_file_def`
--
-- WHERE: namespace='tendbcommon'
-- WHERE: namespace='tendbcomm'

INSERT INTO `tb_config_file_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_type_lc`, `conf_file_lc`, `level_names`, `level_versioned`, `conf_name_validate`, `conf_value_validate`, `value_type_strict`, `namespace_info`, `version_keep_limit`, `version_keep_days`, `conf_name_order`, `description`, `created_at`, `updated_at`, `updated_by`) VALUES (335,'tendbcomm','backup','backup_client','配置','备份客户端相关的配置','plat,app,bk_cloud_id,city',NULL,1,1,0,NULL,5,365,0,NULL,'2024-03-25 16:35:58','2024-03-25 16:59:32',NULL);
/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */;
/*!50112 PREPARE s FROM @disable_bulk_load */;
/*!50112 EXECUTE s */;
Expand Down Expand Up @@ -59,8 +60,13 @@
--
-- Dumping data for table `tb_config_name_def`
--
-- WHERE: namespace='tendbcommon' AND (flag_encrypt!=1 or value_default like '{{%')
-- WHERE: namespace='tendbcomm' AND (flag_encrypt!=1 or value_default like '{{%')

INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (22885,'tendbcomm','backup','backup_client','binlogbackup.keep_days','INT','15','[1, 60]','RANGE',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2022-11-29 15:00:02','2024-03-25 16:41:50',0);
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (22888,'tendbcomm','backup','backup_client','binlogbackup.keep_storage_tag','STRING','INCREMENT_BACKUP','','',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2022-11-29 15:00:02','2024-03-25 16:52:07',0);
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (22884,'tendbcomm','backup','backup_client','default_storage_type','STRING','','hdfs | cos |','ENUM',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2022-11-29 15:00:02','2022-11-29 17:08:30',0);
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (22886,'tendbcomm','backup','backup_client','fullbackup.keep_days','INT','25','[1, 60]','RANGE',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2022-11-29 15:00:02','2024-03-25 16:41:03',0);
INSERT INTO `tb_config_name_def` (`id`, `namespace`, `conf_type`, `conf_file`, `conf_name`, `value_type`, `value_default`, `value_allowed`, `value_type_sub`, `flag_status`, `flag_disable`, `flag_locked`, `flag_encrypt`, `need_restart`, `value_formula`, `extra_info`, `conf_name_lc`, `order_index`, `since_version`, `description`, `created_at`, `updated_at`, `stage`) VALUES (22887,'tendbcomm','backup','backup_client','fullbackup.keep_storage_tag','STRING','MYSQL_FULL_BACKUP','','',1,0,0,0,1,NULL,NULL,NULL,-1,NULL,NULL,'2022-11-29 15:00:02','2024-03-26 10:26:25',0);
/*!50112 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load = @old_rocksdb_bulk_load', 'SET @dummy_rocksdb_bulk_load = 0') */;
/*!50112 PREPARE s FROM @disable_bulk_load */;
/*!50112 EXECUTE s */;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ func (p *PhysicalDumper) Execute(enableTimeOut bool) error {

if strings.ToLower(p.cnf.Public.MysqlRole) == cst.RoleSlave {
args = append(args, []string{
"--slave-info", "--safe-slave-backup",
"--slave-info",
//"--safe-slave-backup",
}...)
}

Expand Down

0 comments on commit 7bdf501

Please sign in to comment.