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

test(KVStore): Support Proxy's apply pattern on normal write and compact log #5623

Merged
merged 54 commits into from
Sep 26, 2022

Conversation

CalvinNeo
Copy link
Member

@CalvinNeo CalvinNeo commented Aug 15, 2022

Signed-off-by: CalvinNeo [email protected]

What problem does this PR solve?

Issue Number: ref #5170

Problem Summary:

MockRaftStoreProxy will act like TiFlash Proxy:

  1. Functions like normalWrite/compactLog to generate and "commit" raft entries.
  2. Functions like doApply to apply raft entries.
  3. Functions like replay to replay raft entries from last applied index.

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

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 15, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • breezewish
  • solotzg

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 do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. labels Aug 15, 2022
@CalvinNeo
Copy link
Member Author

/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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 15, 2022
@ti-chi-bot ti-chi-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 22, 2022
Signed-off-by: CalvinNeo <[email protected]>
@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 24, 2022
}
}

if (cond.fail_before_kvstore) return;
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe use FailPointHelper and fiu_do_on instead of passing a FailCond to mock the failure?

Copy link
Member Author

Choose a reason for hiding this comment

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

I am afraid that failpoints take its effects on the whole program, by giving a explicit fail condition for every write can provide more flexibility in such tests.

f
Signed-off-by: CalvinNeo <[email protected]>
@CalvinNeo CalvinNeo force-pushed the enrich-tests branch 8 times, most recently from 33e98c8 to 61fd7d4 Compare August 25, 2022 09:01
f
Signed-off-by: CalvinNeo <[email protected]>
f
Signed-off-by: CalvinNeo <[email protected]>
Signed-off-by: CalvinNeo <[email protected]>
f
Signed-off-by: CalvinNeo <[email protected]>
f
Signed-off-by: CalvinNeo <[email protected]>
@ti-chi-bot
Copy link
Member

@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

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.

@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Sep 26, 2022
@CalvinNeo
Copy link
Member Author

/merge

@ti-chi-bot
Copy link
Member

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

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.

Commit hash: dd3ef16

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

/run-all-tests

@CalvinNeo
Copy link
Member Author

/run-unit-test

@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Sep 26, 2022
@CalvinNeo
Copy link
Member Author

/merge

@ti-chi-bot
Copy link
Member

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

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.

Commit hash: 5289e03

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 26, 2022
Signed-off-by: CalvinNeo <[email protected]>
@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Sep 26, 2022
@CalvinNeo
Copy link
Member Author

/merge

@ti-chi-bot
Copy link
Member

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

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.

Commit hash: 5f1fb29

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

/rebuild

@CalvinNeo
Copy link
Member Author

/run-integration-test

@sre-bot
Copy link
Collaborator

sre-bot commented Sep 26, 2022

Coverage for changed files

Filename                                         Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Debug/MockRaftStoreProxy.cpp                         129                 4    96.90%          38                 0   100.00%         382                18    95.29%          76                 8    89.47%
Debug/MockRaftStoreProxy.h                             7                 0   100.00%           7                 0   100.00%          21                 0   100.00%           0                 0         -
Storages/Transaction/KVStore.h                         5                 3    40.00%           5                 3    40.00%           5                 3    40.00%           0                 0         -
Storages/Transaction/Region.cpp                      353                12    96.60%          61                 1    98.36%         639                27    95.77%         136                35    74.26%
Storages/Transaction/Region.h                         20                 2    90.00%          10                 2    80.00%          28                 2    92.86%          14                 4    71.43%
Storages/Transaction/RegionMeta.cpp                   95                 8    91.58%          44                 1    97.73%         298                24    91.95%          48                12    75.00%
Storages/Transaction/RegionMeta.h                      1                 0   100.00%           1                 0   100.00%           7                 0   100.00%           0                 0         -
Storages/Transaction/tests/gtest_kvstore.cpp         314                 7    97.77%          32                 2    93.75%        1450                38    97.38%           6                 1    83.33%
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                924                36    96.10%         198                 9    95.45%        2830               112    96.04%         280                60    78.57%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18357      7512             59.08%    214843  77246        64.05%

full coverage report (for internal network access only)

@sre-bot
Copy link
Collaborator

sre-bot commented Sep 26, 2022

Coverage for changed files

Filename                                         Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Debug/MockRaftStoreProxy.cpp                         129                 4    96.90%          38                 0   100.00%         382                18    95.29%          76                 8    89.47%
Debug/MockRaftStoreProxy.h                             7                 0   100.00%           7                 0   100.00%          21                 0   100.00%           0                 0         -
Storages/Transaction/KVStore.h                         5                 3    40.00%           5                 3    40.00%           5                 3    40.00%           0                 0         -
Storages/Transaction/Region.cpp                      353                12    96.60%          61                 1    98.36%         639                27    95.77%         136                35    74.26%
Storages/Transaction/Region.h                         20                 2    90.00%          10                 2    80.00%          28                 2    92.86%          14                 4    71.43%
Storages/Transaction/RegionMeta.cpp                   95                 8    91.58%          44                 1    97.73%         298                24    91.95%          48                12    75.00%
Storages/Transaction/RegionMeta.h                      1                 0   100.00%           1                 0   100.00%           7                 0   100.00%           0                 0         -
Storages/Transaction/tests/gtest_kvstore.cpp         314                 7    97.77%          32                 2    93.75%        1450                38    97.38%           6                 1    83.33%
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                924                36    96.10%         198                 9    95.45%        2830               112    96.04%         280                60    78.57%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18357      7514             59.07%    214843  77228        64.05%

full coverage report (for internal network access only)

@sre-bot
Copy link
Collaborator

sre-bot commented Sep 26, 2022

Coverage for changed files

Filename                                         Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Debug/MockRaftStoreProxy.cpp                         129                 4    96.90%          38                 0   100.00%         382                18    95.29%          76                 8    89.47%
Debug/MockRaftStoreProxy.h                             7                 0   100.00%           7                 0   100.00%          21                 0   100.00%           0                 0         -
Storages/Transaction/KVStore.h                         5                 3    40.00%           5                 3    40.00%           5                 3    40.00%           0                 0         -
Storages/Transaction/Region.cpp                      353                12    96.60%          61                 1    98.36%         639                27    95.77%         136                35    74.26%
Storages/Transaction/Region.h                         20                 2    90.00%          10                 2    80.00%          28                 2    92.86%          14                 4    71.43%
Storages/Transaction/RegionMeta.cpp                   95                 8    91.58%          44                 1    97.73%         298                24    91.95%          48                12    75.00%
Storages/Transaction/RegionMeta.h                      1                 0   100.00%           1                 0   100.00%           7                 0   100.00%           0                 0         -
Storages/Transaction/tests/gtest_kvstore.cpp         314                 7    97.77%          32                 2    93.75%        1450                38    97.38%           6                 1    83.33%
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                924                36    96.10%         198                 9    95.45%        2830               112    96.04%         280                60    78.57%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18357      7514             59.07%    214843  77272        64.03%

full coverage report (for internal network access only)

@CalvinNeo
Copy link
Member Author

/run-integration-test

@ti-chi-bot ti-chi-bot merged commit 3bdb49e into pingcap:master Sep 26, 2022
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/XXL Denotes a PR that changes 1000+ 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.

6 participants