From 632455456bc19de09949b846300ef01bc7446f07 Mon Sep 17 00:00:00 2001 From: D3Hunter Date: Wed, 24 Aug 2022 18:46:46 +0800 Subject: [PATCH] fix logging --- br/pkg/lightning/backend/kv/session.go | 5 +++-- br/tests/lightning_local_backend/run.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/br/pkg/lightning/backend/kv/session.go b/br/pkg/lightning/backend/kv/session.go index 62ead3b111a50..b817d332faa94 100644 --- a/br/pkg/lightning/backend/kv/session.go +++ b/br/pkg/lightning/backend/kv/session.go @@ -265,12 +265,13 @@ func newSession(options *SessionOptions, logger log.Logger) *session { if options.SysVars != nil { for k, v := range options.SysVars { // since 6.3(current master) tidb checks whether we can set a system variable - // lc_time_names is a read-only variable for now, but might be implemented later. + // lc_time_names is a read-only variable for now, but might be implemented later, + // so we not remove it from defaultImportantVariables and check it in below way. if sv := variable.GetSysVar(k); sv == nil { logger.DPanic("unknown system var", zap.String("key", k)) continue } else if sv.ReadOnly { - logger.Info("skip read-only variable", zap.String("key", k)) + logger.Debug("skip read-only variable", zap.String("key", k)) continue } if err := vars.SetSystemVar(k, v); err != nil { diff --git a/br/tests/lightning_local_backend/run.sh b/br/tests/lightning_local_backend/run.sh index ace19d92036f0..5177f98d1ecba 100755 --- a/br/tests/lightning_local_backend/run.sh +++ b/br/tests/lightning_local_backend/run.sh @@ -82,7 +82,7 @@ set -e export GO_FAILPOINTS='' echo "******** Verify checkpoint no-op ********" -run_lightning --backend local --enable-checkpoint=1 --config "tests/$TEST_NAME/config.toml" --log-file $res_file +run_lightning --backend local --enable-checkpoint=1 --config "tests/$TEST_NAME/config.toml" --log-file $res_file -L debug check_not_contains "failed to set system var" check_not_contains "unknown system var" check_contains "skip read-only variable"