Skip to content

Enhance some debug utils#8225

Merged
ti-chi-bot[bot] merged 48 commits intopingcap:masterfrom
CalvinNeo:fix-some-debug
Oct 23, 2023
Merged

Enhance some debug utils#8225
ti-chi-bot[bot] merged 48 commits intopingcap:masterfrom
CalvinNeo:fix-some-debug

Conversation

@CalvinNeo
Copy link
Member

@CalvinNeo CalvinNeo commented Oct 19, 2023

What problem does this PR solve?

Issue Number: close #4646

Problem Summary:

  1. Make mock proxy's persistence pattern more similar to reality
  2. Remove and aggregate abundant initializing procedures
  3. Clear some codes in MockRaftStoreProxy
  4. Introduce MockFFIImpls(originally in MockRaftStoreProxy.cpp) and MockReadIndex(originally in class MockRaftStoreProxy)
  5. Add extra msg for RegionException

What is changed and how it works?

Check List

Tests

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

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

CalvinNeo and others added 30 commits October 11, 2023 17:06
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
f
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
z
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
z
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
z
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
z
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
f
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
a
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
z
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
a
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
f
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@CalvinNeo
Copy link
Member Author

/run-all-tests

Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@CalvinNeo
Copy link
Member Author

/run-all-tests

Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@CalvinNeo
Copy link
Member Author

/run-all-tests

Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@CalvinNeo
Copy link
Member Author

/run-all-tests

@CalvinNeo CalvinNeo requested a review from hongyunyan October 20, 2023 07:52
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Comment on lines +36 to +43
static inline void validate(
KVStore & kvs,
std::unique_ptr<MockRaftStoreProxy> & proxy_instance,
UInt64 region_id,
MockSSTGenerator & cf_data,
ColumnFamilyType cf,
int sst_size,
int key_count)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
static inline void validate(
KVStore & kvs,
std::unique_ptr<MockRaftStoreProxy> & proxy_instance,
UInt64 region_id,
MockSSTGenerator & cf_data,
ColumnFamilyType cf,
int sst_size,
int key_count)
static inline void validate(
KVStore & kvs,
std::unique_ptr<MockRaftStoreProxy> & proxy_instance,
UInt64 region_id,
MockSSTGenerator & cf_data,
ColumnFamilyType cf,
int sst_size,
int key_count)

Can you add some comments to explain what kind of data/fields this function validate?

{
RegionException::UnavailableRegions fail_region_ids;
RegionException::RegionReadStatus fail_status = RegionException::RegionReadStatus::OK;
std::string fail_extra_msg;
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 "err_msg" or "error_msg" is more native speaking in English

Copy link
Member Author

Choose a reason for hiding this comment

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

The previous variables are all begin with fail

log,
"Check after snapshot acquired from storage, region_id={} version={} handle_range={} status={}",
"Check after snapshot acquired from storage, region_id={} version={} handle_range={} status={} "
"fail_msg={}",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"fail_msg={}",
"err_msg={}",

Copy link
Member Author

Choose a reason for hiding this comment

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

This message is extra, the final error msg is construncted in UnavailableRegions

CalvinNeo and others added 3 commits October 23, 2023 13:02
Co-authored-by: JaySon <tshent@qq.com>
f
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@CalvinNeo
Copy link
Member Author

/run-all-tests

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Oct 23, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Oct 23, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JaySon-Huang, JinheLin

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

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [JaySon-Huang,JinheLin]

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 added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Oct 23, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Oct 23, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-10-23 06:12:38.488737058 +0000 UTC m=+2242356.075847202: ☑️ agreed by JinheLin.
  • 2023-10-23 06:25:31.434049143 +0000 UTC m=+2243129.021159290: ☑️ agreed by JaySon-Huang.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Oct 23, 2023

@CalvinNeo: 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

trigger some heavy tests which will not run always when PR updated.

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.

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 ti-chi-bot bot merged commit 938f04e into pingcap:master Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Breakdown the "dbms/src/Storages/Transaction" module

3 participants