Skip to content

Refine some interface & bug fixes for page stress testing#3062

Merged
ti-chi-bot merged 14 commits intopingcap:masterfrom
JaySon-Huang:refine_page_stress
Sep 14, 2021
Merged

Refine some interface & bug fixes for page stress testing#3062
ti-chi-bot merged 14 commits intopingcap:masterfrom
JaySon-Huang:refine_page_stress

Conversation

@JaySon-Huang
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #xxx

Problem Summary:

What is changed and how it works?

Proposal: xxx

What's Changed:

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch:

Check List

Tests

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

Side effects

Release note

None

Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 9, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • lidezhu

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.

Details

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 release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 9, 2021
/*Just for no warming*/
/*Just for no warning*/
}
tracker.setDescription(description().c_str());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a use after free bug

Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Copy link
Contributor

@jiaqizho jiaqizho left a comment

Choose a reason for hiding this comment

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

Anyway, I'm not sure if we already have a code style manual or are already developing it. So in many places, I subconsciously define it in the style of C.

Summarized the following points:

  1. Check the explicit in class construction
  2. Check const in function which in class
  3. Do not use (int) to forced transfer type
  4. Check the semicolon after the class member
  5. Case-check-in name

And I am also kindly seeking your code style suggestion. Thanks a lot.

/*Just for no warning*/
}
tracker.setDescription(description().c_str());
auto peak = current_memory_tracker->getPeak();
Copy link
Contributor

@jiaqizho jiaqizho Sep 10, 2021

Choose a reason for hiding this comment

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

I am changing this logic, mainly because subsequent changes need to support more metrics dump.

for now, PSMetricsDumper only supports CurrentMetrics::MemoryTracking, and i will add CurrentMetrics::PSMVCCSnapshotsList to check snapshots number. So we still need use PSMetricsDumper to get peak.

auto workload = creator(options);
LOG_INFO(StressEnv::logger, fmt::format("Start Running {} , {}", name, workload->desc()));
workload->run();
if (!workload->verify())
Copy link
Contributor

Choose a reason for hiding this comment

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

I was wondering whether it is C++ style that callback function should start with on, it looks more like Java style. If the callbacks all use on as a prefix, then I think that including verify and run also need to be prefixed with on?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IMO, a function that does something is better to be named as an action.
I expected the function "failed" to be a function that returns a status that the worker is failed or not until I look at the implementation.
And I expected the function "result" to be a function that returns a string or something that represents a "result". But actually, it dumps the result inside the function.

Copy link
Contributor

Choose a reason for hiding this comment

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

ack

@JaySon-Huang
Copy link
Contributor Author

JaySon-Huang commented Sep 13, 2021

Actually, the following 4 points are checked by the clang-tidy:

  1. Check the explicit in class construction
  2. Check const in function which in class
  3. Do not use (int) to forced transfer type
  4. Case-check-in name
    • Camel-Case for class, struct, function, type aliasing name
    • Snake-Case for member variables, local variables
    • Do not add prefix/suffix for member variables (for example, prefix "m_" or suffix "_")

We introduce clang-tidy into CI by #2834, but now it is temporarily disabled since there are too many warnings

  • Check the semicolon after the class member functions

Seems that clang-tidy can not check it either 😂

@jiaqizho
Copy link
Contributor

Actually, the following 4 points are checked by the clang-tidy:

  1. Check the explicit in class construction

  2. Check const in function which in class

  3. Do not use (int) to forced transfer type

  4. Case-check-in name

    • Camel-Case for class, struct, function, type aliasing name
    • Snake-Case for member variables, local variables
    • Do not add prefix/suffix for member variables (for example, prefix "m_" or suffix "_")

We introduce clang-tidy into CI by #2834, but now it is temporarily disabled since there are too many warnings

  • Check the semicolon after the class member functions
    Seems that clang-tidy can not check it either 😂

great to know that 😂.

Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
@jiaqizho
Copy link
Contributor

LGTM

@JaySon-Huang JaySon-Huang self-assigned this Sep 14, 2021
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
@ti-chi-bot
Copy link
Member

@jiaqizho: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

Details

In response to this:

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.

Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 14, 2021
@JaySon-Huang
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

@JaySon-Huang: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and 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.

If you have any questions about the PR merge process, please refer to pr process.

Details

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.

@ti-chi-bot
Copy link
Member

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

DetailsCommit hash: dc3c71b

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 14, 2021
@ti-chi-bot ti-chi-bot merged commit 9741f06 into pingcap:master Sep 14, 2021
@JaySon-Huang JaySon-Huang deleted the refine_page_stress branch September 14, 2021 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1. type/testing Issue or PR for testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants