Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

playground: fix can not set runtime config in config file & set TiFlash logger level to debug #2346

Merged

Conversation

Lloyd-Pottiger
Copy link
Contributor

@Lloyd-Pottiger Lloyd-Pottiger commented Dec 29, 2023

What problem does this PR solve?

What is changed and how it works?

  1. Fix can not set runtime config in config file specific by --tiflash.config

now:

image image image image
  1. Since TiFlash has changed the default logger level to INFO, explicitly set the TiFlash logger level to DEBUG in TiUP playground to debug more easily.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

  • Has exported function/method change
  • Has exported variable/fields change
  • Has interface methods change
  • Has persistent data change

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

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

Release notes:

NONE

Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
@ti-chi-bot ti-chi-bot bot requested a review from nexustar December 29, 2023 02:01
@ti-chi-bot ti-chi-bot bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 29, 2023
@Lloyd-Pottiger
Copy link
Contributor Author

/cc @JaySon-Huang

Copy link
Contributor

ti-chi-bot bot commented Dec 29, 2023

@Lloyd-Pottiger: GitHub didn't allow me to request PR reviews from the following users: JaySon-Huang.

Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @JaySon-Huang

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@codecov-commenter
Copy link

codecov-commenter commented Dec 29, 2023

Codecov Report

Attention: 38 lines in your changes are missing coverage. Please review.

Comparison is base (0c6dda9) 55.40% compared to head (61ead98) 55.35%.

❗ Current head 61ead98 differs from pull request most recent head 9bf6048. Consider uploading reports for the commit 9bf6048 to get more accurate results

Files Patch % Lines
components/playground/instance/tiflash.go 0.00% 37 Missing ⚠️
components/playground/instance/tiflash_config.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2346      +/-   ##
==========================================
- Coverage   55.40%   55.35%   -0.05%     
==========================================
  Files         329      329              
  Lines       34845    34865      +20     
==========================================
- Hits        19304    19297       -7     
- Misses      13232    13257      +25     
- Partials     2309     2311       +2     
Flag Coverage Δ
playground 15.34% <0.00%> (-0.03%) ⬇️
tiup 33.60% <ø> (-0.05%) ⬇️
unittest 22.34% <ø> (-<0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -139,6 +139,7 @@ func (inst *TiFlashInstance) Start(ctx context.Context, version utils.Version) e
fmt.Sprintf("--path=%s", filepath.Join(inst.Dir, "data")),
fmt.Sprintf("--listen_host=%s", inst.Host),
fmt.Sprintf("--logger.log=%s", inst.LogFile()),
"--logger.level=debug",
Copy link
Contributor

Choose a reason for hiding this comment

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

can we overwrite this config when running playground?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 7ccb33d

Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 29, 2023
@Lloyd-Pottiger Lloyd-Pottiger changed the title playground: set TiFlash logger level to debug playground: fix can not set runtime config in config file & set TiFlash logger level to debug Dec 29, 2023
@Lloyd-Pottiger
Copy link
Contributor Author

/cc @breezewish

@ti-chi-bot ti-chi-bot bot requested a review from breezewish December 29, 2023 03:42
var err error
}
runtimeConfig := [][]string{
{"tmp_path", filepath.Join(inst.Dir, "tmp")},
Copy link
Contributor

Choose a reason for hiding this comment

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

I think tmp_path can be removed, TiFlash's default behavior "${path}/tmp" can handle it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed 8ec2aa8

Comment on lines +154 to +157
userConfig, err := unmarshalConfig(configPath)
if err != nil {
return errors.Trace(err)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

we should continue the following logic when the config file in configPath is not exists

Copy link
Contributor Author

Choose a reason for hiding this comment

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

	configPath := filepath.Join(inst.Dir, "tiflash.toml")
	if err := prepareConfig(
		configPath,
		inst.ConfigPath,
		inst.getConfig(),
	); err != nil {
		return err
	}

configPath always exists.

Copy link
Contributor

Choose a reason for hiding this comment

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

got it

Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
Copy link
Contributor

@JaySon-Huang JaySon-Huang left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

ti-chi-bot bot commented Dec 29, 2023

@JaySon-Huang: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

LGTM

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@breezewish
Copy link
Member

Just curious, in what case do we need to override the runtime config in the config file? AFAIK for TiKV and TiDB these runtime configurations (like port) are also specified via parameters so that it will not be overridden by config files.

Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
@Lloyd-Pottiger
Copy link
Contributor Author

Just curious, in what case do we need to override the runtime config in the config file? AFAIK for TiKV and TiDB these runtime configurations (like port) are also specified via parameters so that it will not be overridden by config files.

case like:

My tiup installed in /data1, but /data1 is full and /data2 is almost empty

@breezewish
Copy link
Member

/lgtm

@ti-chi-bot ti-chi-bot bot added the lgtm label Jan 5, 2024
@Lloyd-Pottiger
Copy link
Contributor Author

/approve

@Lloyd-Pottiger
Copy link
Contributor Author

/assign @kaaaaaaang

@kaaaaaaang kaaaaaaang added this to the v1.14.1 milestone Jan 9, 2024
@kaaaaaaang
Copy link
Collaborator

/approve

@ti-chi-bot ti-chi-bot bot added the approved label Jan 9, 2024
@ti-chi-bot ti-chi-bot bot removed the lgtm label Jan 9, 2024
@kaaaaaaang
Copy link
Collaborator

/lgtm /approve

@kaaaaaaang
Copy link
Collaborator

/lgtm

@ti-chi-bot ti-chi-bot bot added the lgtm label Jan 11, 2024
Copy link
Contributor

ti-chi-bot bot commented Jan 11, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-01-05 01:53:08.00379424 +0000 UTC m=+2394679.041021182: ☑️ agreed by breezewish.
  • 2024-01-09 12:57:08.45415099 +0000 UTC m=+361618.038404678: ✖️🔁 reset by ti-chi-bot[bot].
  • 2024-01-11 08:16:29.645276735 +0000 UTC m=+517579.229530422: ☑️ agreed by kaaaaaaang.

@kaaaaaaang
Copy link
Collaborator

/approve

Copy link
Contributor

ti-chi-bot bot commented Jan 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kaaaaaaang, Lloyd-Pottiger

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot merged commit 77e0b53 into pingcap:master Jan 11, 2024
7 checks passed
kaaaaaaang pushed a commit that referenced this pull request Jan 12, 2024
@Lloyd-Pottiger Lloyd-Pottiger deleted the playground-tiflash-log-level branch January 22, 2024 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants