Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
River2000i committed Dec 18, 2024
1 parent 8eb2320 commit a68e2fb
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 30 deletions.
4 changes: 0 additions & 4 deletions dm/config/task_converters.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,6 @@ func OpenAPITaskToSubTaskConfigs(task *openapi.Task, toDBCfg *dbconfig.DBConfig,
SSLKeyBytes: []byte(fullCfg.Security.SslKeyContent),
CertAllowedCN: certAllowedCN,
}
// TODO: Just a workround for using SslContent cannot verify ceritificates when lightning use pdctl lib access PD server
if err := subTaskCfg.LoaderConfig.Security.WriteFiles(subTaskCfg.Name); err != nil {
return nil, terror.ErrOpenAPICommonError.Generatef("Save tls config files files, message=%s", err.Error())
}
}
if fullCfg.RangeConcurrency != nil {
subTaskCfg.LoaderConfig.RangeConcurrency = *fullCfg.RangeConcurrency
Expand Down
20 changes: 11 additions & 9 deletions dm/loader/lightning.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ func NewLightning(cfg *config.SubTaskConfig, cli *clientv3.Client, workerName st
// MakeGlobalConfig converts subtask config to lightning global config.
func MakeGlobalConfig(cfg *config.SubTaskConfig) *lcfg.GlobalConfig {
lightningCfg := lcfg.NewGlobalConfig()
if cfg.LoaderConfig.Security != nil {
lightningCfg.Security.CAPath = cfg.LoaderConfig.Security.SSLCA
lightningCfg.Security.CertPath = cfg.LoaderConfig.Security.SSLCert
lightningCfg.Security.KeyPath = cfg.LoaderConfig.Security.SSLKey
if cfg.To.Security != nil {
lightningCfg.Security.CABytes = cfg.To.Security.SSLCABytes
lightningCfg.Security.CertBytes = cfg.To.Security.SSLCertBytes
lightningCfg.Security.KeyBytes = cfg.To.Security.SSLKeyBytes
}
lightningCfg.TiDB.Host = cfg.To.Host
lightningCfg.TiDB.Psw = cfg.To.Password
Expand Down Expand Up @@ -279,7 +279,9 @@ func (l *LightningLoader) runLightning(ctx context.Context, cfg *lcfg.Config) (e
if l.cfg.LoaderConfig.ImportMode == config.LoadModePhysical {
opts = append(opts, lserver.WithDupIndicator(&hasDup))
}

l.logger.Debug("ssl content debug", zap.Any("task cfg", cfg))
l.logger.Debug("ssl content debug", zap.String("ca content", string(cfg.Security.CABytes)), zap.String("cert content", string(cfg.Security.CertBytes)), zap.String("key content", string(cfg.Security.KeyBytes)))
l.logger.Debug("ssl content debug", zap.String("ca content", string(cfg.TiDB.Security.CABytes)), zap.String("cert content", string(cfg.TiDB.Security.CertBytes)), zap.String("key content", string(cfg.TiDB.Security.KeyBytes)))
err = l.core.RunOnceWithOptions(taskCtx, cfg, opts...)
failpoint.Inject("LoadDataSlowDown", nil)
failpoint.Inject("LoadDataSlowDownByTask", func(val failpoint.Value) {
Expand Down Expand Up @@ -330,10 +332,10 @@ func GetLightningConfig(globalCfg *lcfg.GlobalConfig, subtaskCfg *config.SubTask
return nil, err
}
cfg.TiDB.Security = &globalCfg.Security
if subtaskCfg.To.Security != nil {
cfg.TiDB.Security.CAPath = subtaskCfg.To.Security.SSLCA
cfg.TiDB.Security.CertPath = subtaskCfg.To.Security.SSLCert
cfg.TiDB.Security.KeyPath = subtaskCfg.To.Security.SSLKey
if subtaskCfg.LoaderConfig.Security != nil {
cfg.Security.CABytes = subtaskCfg.LoaderConfig.Security.SSLCABytes
cfg.Security.CertBytes = subtaskCfg.LoaderConfig.Security.SSLCertBytes
cfg.Security.KeyBytes = subtaskCfg.LoaderConfig.Security.SSLKeyBytes
}
// TableConcurrency is adjusted to the value of RegionConcurrency
// when using TiDB backend.
Expand Down
34 changes: 17 additions & 17 deletions dm/tests/openapi/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1215,26 +1215,26 @@ function run() {
run_dm_worker $WORK_DIR/worker2 $WORKER2_PORT $cur/conf/dm-worker2.toml
check_rpc_alive $cur/../bin/check_worker_online 127.0.0.1:$WORKER2_PORT

test_relay
test_source

test_shard_task
test_multi_tasks
test_noshard_task
test_dump_and_load_task
test_task_templates
test_noshard_task_dump_status
test_complex_operations_of_source_and_task
test_task_with_ignore_check_items
test_delete_task_with_stopped_downstream
test_start_task_with_condition
test_stop_task_with_condition
test_reverse_https
test_full_mode_task
# test_relay
# test_source

# test_shard_task
# test_multi_tasks
# test_noshard_task
# test_dump_and_load_task
# test_task_templates
# test_noshard_task_dump_status
# test_complex_operations_of_source_and_task
# test_task_with_ignore_check_items
# test_delete_task_with_stopped_downstream
# test_start_task_with_condition
# test_stop_task_with_condition
# test_reverse_https
# test_full_mode_task
test_tls

# NOTE: this test case MUST running at last, because it will offline some members of cluster
test_cluster
# test_cluster
}

cleanup_data openapi
Expand Down

0 comments on commit a68e2fb

Please sign in to comment.