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

tracker(dm): add task name to unistore folder name #5341

Merged
merged 7 commits into from
May 10, 2022

Conversation

lance6716
Copy link
Contributor

Signed-off-by: lance6716 lance6716@gmail.com

What problem does this PR solve?

Issue Number: ref #5334

What is changed and how it works?

sometimes unistore folder is abnormally big, we add task name to the folder name to know which task it belongs.

Also, clean that folder for unit tests by Close()

Check List

Tests

  • Unit test

Code changes

Side effects

Related changes

Release note

 `None`.

Signed-off-by: lance6716 <lance6716@gmail.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented May 6, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • D3Hunter
  • lichunzhu

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the release-note-none Denotes a PR that doesn't merit a release note. label May 6, 2022
@lance6716 lance6716 added the area/dm Issues or PRs related to DM. label May 6, 2022
@ti-chi-bot ti-chi-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 6, 2022
@codecov-commenter
Copy link

codecov-commenter commented May 6, 2022

Codecov Report

Merging #5341 (f95886d) into master (687e248) will decrease coverage by 0.0316%.
The diff coverage is 53.7070%.

Flag Coverage Δ
cdc 60.9393% <53.7070%> (+0.3407%) ⬆️
dm 52.2553% <ø> (-0.2143%) ⬇️

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

@@               Coverage Diff                @@
##             master      #5341        +/-   ##
================================================
- Coverage   56.1240%   56.0923%   -0.0317%     
================================================
  Files           522        527         +5     
  Lines         65325      69193      +3868     
================================================
+ Hits          36663      38812      +2149     
- Misses        25094      26666      +1572     
- Partials       3568       3715       +147     

Copy link
Contributor

@lichunzhu lichunzhu left a comment

Choose a reason for hiding this comment

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

Rest LGTM

@@ -149,7 +149,7 @@ func NewTracker(ctx context.Context, task string, sessionCfg map[string]string,
}
}

storePath, err = ioutil.TempDir("./", "schema-tracker")
storePath, err = ioutil.TempDir("./", task+"-schema-tracker")
Copy link
Contributor

Choose a reason for hiding this comment

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

What about using a sub-directory?

BTW, I think we should add a data-dir configuration for dm-worker. We have relay-dir,dump-dir, and schema-tracker file directories now, but all the default values of them are the dm-worker binary's dir. For TiUP data-dir and deploy-dir are separated which looks a bit weird.

Maybe we can do this in the next PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do it later, if we can't find the root cause we will change the implementation, so that configuration will be deprecated soon.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label May 10, 2022
Copy link
Contributor

@lichunzhu lichunzhu left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels May 10, 2022
@lance6716
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: f95886d

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label May 10, 2022
@lance6716
Copy link
Contributor Author

/run-dm-integration-test

@lance6716
Copy link
Contributor Author

/hold

failed to create schema tracker" RawCause:"mkdirtemp ab?c/b%c\303\213d-schema-tracker: pattern contains path separator\

@ti-chi-bot ti-chi-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 10, 2022
Signed-off-by: lance6716 <lance6716@gmail.com>
@ti-chi-bot ti-chi-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed status/can-merge Indicates a PR has been approved by a committer. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 10, 2022
@lance6716
Copy link
Contributor Author

/unhold
/run-dm-integration-test

@ti-chi-bot ti-chi-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 10, 2022
@lance6716
Copy link
Contributor Author

PTAL for b3afb8c

@D3Hunter @lichunzhu

@lichunzhu
Copy link
Contributor

PTAL for b3afb8c

@D3Hunter @lichunzhu

Will this cause different tasks to have the same schema-tracker file name? What about using dumpling's template https://github.com/pingcap/tidb/blob/master/dumpling/export/prepare.go#L68

@lance6716
Copy link
Contributor Author

lance6716 commented May 10, 2022

PTAL for b3afb8c
@D3Hunter @lichunzhu

Will this cause different tasks to have the same schema-tracker file name? What about using dumpling's template https://github.com/pingcap/tidb/blob/master/dumpling/export/prepare.go#L68

ioutil.TempDir will append different suffix for them, so we can only roughly tell them apart.

https://github.com/pingcap/tidb/blob/master/dumpling/export/prepare.go#L68 it's too complicated, I can't understand what it's doing 😢 Can you give an example how to use it for a string input?

@lichunzhu
Copy link
Contributor

ioutil.TempDir will append different suffix for them, so we can only roughly tell them apart.

https://github.com/pingcap/tidb/blob/master/dumpling/export/prepare.go#L68 it's too complicated, I can't understand what it's doing 😢 Can you give an example how to use it for a string input?

pingcap/dumpling#131 (comment)
It can escape the special characters in the object names.
e.g.: table-partition/TICASE-2024 will be replaced by table-partition%2FTICASE-2024.
It seems that we don't need this name for debugging, so I think the current implementation is okay.

Signed-off-by: lance6716 <lance6716@gmail.com>
@lance6716
Copy link
Contributor Author

531cbbd

@lichunzhu PTAL

Copy link
Contributor

@lichunzhu lichunzhu left a comment

Choose a reason for hiding this comment

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

LGTM

@lance6716
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 531cbbd

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label May 10, 2022
@ti-chi-bot
Copy link
Member

@lance6716: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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 ti-community-infra/tichi repository.

'>': {}, ',': {}, '.': {}, '?': {}, '/': {}, ' ': {},
}

func newTmpFolderForTracker(task string) (string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why not use url.PathEscape

@D3Hunter
Copy link
Contributor

/hold

@ti-chi-bot ti-chi-bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. and removed status/can-merge Indicates a PR has been approved by a committer. labels May 10, 2022
Signed-off-by: lance6716 <lance6716@gmail.com>
@ti-chi-bot ti-chi-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 10, 2022
@D3Hunter
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: e5715e0

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label May 10, 2022
@lance6716
Copy link
Contributor Author

/unhold

@ti-chi-bot ti-chi-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 10, 2022
@D3Hunter
Copy link
Contributor

/run-verify

1 similar comment
@lance6716
Copy link
Contributor Author

/run-verify

@ti-chi-bot ti-chi-bot merged commit 57c19c8 into pingcap:master May 10, 2022
@lance6716 lance6716 deleted the tracker-folder-name branch October 13, 2022 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dm Issues or PRs related to DM. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants