Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

config: change redact log parameter name #547

Merged
merged 3 commits into from
Jan 13, 2021

Conversation

lichunzhu
Copy link
Contributor

What problem does this PR solve?

In #538, we added the redact-log parameter.

The redact log parameter name is different from TiKV's and PD's.
https://github.com/tikv/tikv/blob/master/etc/config-template.toml#L846
In TiKV it's redact-info-log configuration in config file.
https://github.com/tikv/pd/blob/master/server/config/config.go#L1373
In PD it's redact-info-log configuration in config file.

What is changed and how it works?

Change redact-log to redact-info-log.

Check List

Tests

  • Unit test
  • Integration test

Side effects

  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

@lichunzhu lichunzhu added Should Update Docs Should update docs after this PR is merged. Remove this label once the docs are updated status/PTAL This PR is ready for review. Add this label back after committing new changes labels Jan 12, 2021
@lichunzhu lichunzhu changed the title change redact log parameter name config: change redact log parameter name Jan 12, 2021
Copy link
Member

@overvenus overvenus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems redact-log will be released in v4.0.10 and v5.0.0-rc, please confirm @glorv .

@lichunzhu
Copy link
Contributor Author

Seems redact-log will be released in v4.0.10 and v5.0.0-rc, please confirm @glorv .

I have checked release-4.0 and release-5.0-rc. #538 is not cherry-picked.

@glorv
Copy link
Contributor

glorv commented Jan 12, 2021

LGTM

@ti-srebot ti-srebot added the status/LGT1 One reviewer already commented LGTM (LGTM1) label Jan 12, 2021
@@ -45,7 +45,7 @@ type Config struct {
// Maximum number of old log files to retain.
FileMaxBackups int `toml:"max-backups" json:"max-backups"`
// Redact sensitive logs during the whole process
RedactLog bool `toml:"redact-log" json:"redact-log"`
RedactLog bool `toml:"redact-info-log" json:"redact-info-log"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to preserve compatibility for 5.0-rc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5.0-rc doesn't have this feature

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we want to be consistent with PD it should be placed inside the [security] section 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable.

@@ -144,7 +144,7 @@ func LoadGlobalConfig(args []string, extraFlags func(*flag.FlagSet)) (*GlobalCon

logLevel := flagext.ChoiceVar(fs, "L", "", `log level: info, debug, warn, error, fatal (default info)`, "", "info", "debug", "warn", "warning", "error", "fatal")
logFilePath := fs.String("log-file", "", "log file path")
redactLog := fs.Bool("redact-log", false, "whether to redact sensitive info in log")
redactLog := fs.Bool("redact-info-log", false, "whether to redact sensitive info in log")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to preserve compatibility for 5.0-rc

Copy link
Contributor

@glorv glorv Jan 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we also cherry-pick this commit to release-5.0-rc?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should pick both this commit and #538 to 5.0-rc. But we can do it in next version.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, we only need to cherry-pick this commit to release-4.0

@kennytm
Copy link
Collaborator

kennytm commented Jan 13, 2021

LGTM

@ti-srebot ti-srebot added status/LGT2 Two reviewers already commented LGTM, ready for merge (LGTM2) and removed status/LGT1 One reviewer already commented LGTM (LGTM1) labels Jan 13, 2021
@glorv glorv merged commit 0c9788e into pingcap:master Jan 13, 2021
@lichunzhu lichunzhu deleted the changeRedactName branch January 13, 2021 10:20
glorv pushed a commit that referenced this pull request Jan 13, 2021
* change redact log parameter name

* address comment

* update lightning.toml
glorv added a commit that referenced this pull request Jan 13, 2021
* change redact log parameter name

* address comment

* update lightning.toml

Co-authored-by: Chunzhu Li <lichunzhu@stu.xjtu.edu.cn>
glorv pushed a commit that referenced this pull request Jan 29, 2021
* change redact log parameter name

* address comment

* update lightning.toml
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Should Update Docs Should update docs after this PR is merged. Remove this label once the docs are updated status/LGT2 Two reviewers already commented LGTM, ready for merge (LGTM2) status/PTAL This PR is ready for review. Add this label back after committing new changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants