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

PageStorage: Fix unstable rename test #5762

Merged
merged 18 commits into from
Sep 5, 2022

Conversation

JaySon-Huang
Copy link
Contributor

@JaySon-Huang JaySon-Huang commented Sep 1, 2022

What problem does this PR solve?

Issue Number: close #5761

Problem Summary: as the issue descript

What is changed and how it works?

  • Disallow non-atomic rename table by RUNTIME_ASSERT
  • Remove tests that perform non-atomic rename, rewrite them to test the logic of atomic rename
    • Rewrite raft/schema/rename_tables.test by SchemaSyncTest.RenameTables
    • Rewrite raft/schema/partition_table_restart.test by SchemaSyncTest.PartitionTableRestart
    • Rewrite a part of raft/txn_mock/partition_table.test by SchemaSyncTest.RenamePartitionTable

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

Remove useless rename on read test

Signed-off-by: JaySon-Huang <[email protected]>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 1, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • flowbehappy
  • 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.

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. do-not-merge/needs-triage-completed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 1, 2022
Signed-off-by: JaySon-Huang <[email protected]>
Signed-off-by: JaySon-Huang <[email protected]>
@ti-chi-bot ti-chi-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 1, 2022
@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Sep 2, 2022

Coverage for changed files

Filename                                                       Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Databases/test/gtest_database.cpp                                  250                77    69.20%          19                 0   100.00%         722                 8    98.89%          54                43    20.37%
Debug/MockSchemaGetter.h                                            11                 0   100.00%           7                 0   100.00%          37                 0   100.00%           6                 0   100.00%
Debug/MockTiDB.cpp                                                 163                81    50.31%          38                12    68.42%         497               194    60.97%         104                65    37.50%
Debug/MockTiDB.h                                                    12                 2    83.33%          12                 2    83.33%          25                 9    64.00%           0                 0         -
Server/RaftConfigParser.h                                            1                 0   100.00%           1                 0   100.00%           1                 0   100.00%           0                 0         -
Storages/DeltaMerge/DeltaMergeStore.cpp                           1677               598    64.34%          67                 7    89.55%        2147               546    74.57%         754               326    56.76%
Storages/DeltaMerge/tests/gtest_dm_delta_merge_store.cpp           863               314    63.62%          62                 1    98.39%        2726                69    97.47%         246               168    31.71%
Storages/DeltaMerge/tests/gtest_dm_storage_delta_merge.cpp         198                43    78.28%          18                 0   100.00%         684                12    98.25%          56                28    50.00%
Storages/PathPool.cpp                                              540               261    51.67%          82                20    75.61%         772               200    74.09%         198                86    56.57%
Storages/PathPool.h                                                 14                 2    85.71%          14                 2    85.71%          16                 2    87.50%           0                 0         -
Storages/StorageDeltaMerge.cpp                                     711               276    61.18%          59                21    64.41%        1298               555    57.24%         364               198    45.60%
Storages/Transaction/PDTiKVClient.h                                  9                 4    55.56%           1                 0   100.00%          25                 9    64.00%           4                 3    25.00%
Storages/Transaction/TMTContext.cpp                                 62                40    35.48%          34                17    50.00%         159               103    35.22%          14                11    21.43%
Storages/Transaction/TMTContext.h                                    3                 2    33.33%           3                 2    33.33%           3                 2    33.33%           0                 0         -
TestUtils/TiFlashTestEnv.cpp                                        31                 4    87.10%           4                 0   100.00%          70                 9    87.14%          14                 6    57.14%
TiDB/Schema/SchemaBuilder.cpp                                      979               432    55.87%          48                14    70.83%        1079               511    52.64%         416               231    44.47%
TiDB/Schema/TiDBSchemaSyncer.h                                     201               105    47.76%          13                 5    61.54%         147                58    60.54%          52                30    42.31%
TiDB/Schema/tests/gtest_schema_sync.cpp                            148               100    32.43%          15                 0   100.00%         201                10    95.02%          24                17    29.17%
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                             5873              2341    60.14%         497               103    79.28%       10609              2297    78.35%        2306              1212    47.44%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18604      8258             55.61%    214833  84862        60.50%

full coverage report (for internal network access only)

Signed-off-by: JaySon-Huang <[email protected]>
Signed-off-by: JaySon-Huang <[email protected]>
@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

@JaySon-Huang JaySon-Huang requested a review from lidezhu September 2, 2022 10:59
Signed-off-by: JaySon-Huang <[email protected]>
@sre-bot
Copy link
Collaborator

sre-bot commented Sep 2, 2022

Coverage for changed files

Filename                                                       Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Databases/test/gtest_database.cpp                                  250                77    69.20%          19                 0   100.00%         722                 8    98.89%          54                43    20.37%
Debug/MockSchemaGetter.h                                            11                 0   100.00%           7                 0   100.00%          37                 0   100.00%           6                 0   100.00%
Debug/MockTiDB.cpp                                                 163                81    50.31%          38                12    68.42%         497               194    60.97%         104                65    37.50%
Debug/MockTiDB.h                                                    12                 2    83.33%          12                 2    83.33%          25                 9    64.00%           0                 0         -
Server/RaftConfigParser.h                                            1                 0   100.00%           1                 0   100.00%           1                 0   100.00%           0                 0         -
Storages/DeltaMerge/DeltaMergeStore.cpp                           1677               590    64.82%          67                 5    92.54%        2147               521    75.73%         754               318    57.82%
Storages/DeltaMerge/tests/gtest_dm_delta_merge_store.cpp           863               314    63.62%          62                 1    98.39%        2726                69    97.47%         246               168    31.71%
Storages/DeltaMerge/tests/gtest_dm_storage_delta_merge.cpp         198                43    78.28%          18                 0   100.00%         684                12    98.25%          56                28    50.00%
Storages/PathPool.cpp                                              540               261    51.67%          82                20    75.61%         772               200    74.09%         198                86    56.57%
Storages/PathPool.h                                                 14                 2    85.71%          14                 2    85.71%          16                 2    87.50%           0                 0         -
Storages/StorageDeltaMerge.cpp                                     711               276    61.18%          59                21    64.41%        1298               555    57.24%         364               198    45.60%
Storages/Transaction/PDTiKVClient.h                                  9                 4    55.56%           1                 0   100.00%          25                 9    64.00%           4                 3    25.00%
Storages/Transaction/TMTContext.cpp                                 62                40    35.48%          34                17    50.00%         159               103    35.22%          14                11    21.43%
Storages/Transaction/TMTContext.h                                    3                 2    33.33%           3                 2    33.33%           3                 2    33.33%           0                 0         -
TestUtils/TiFlashTestBasic.h                                         4                 0   100.00%           2                 0   100.00%          12                 0   100.00%           2                 0   100.00%
TestUtils/TiFlashTestEnv.cpp                                        45                 5    88.89%           7                 0   100.00%         109                11    89.91%          22                 6    72.73%
TestUtils/TiFlashTestEnv.h                                          17                 2    88.24%           4                 0   100.00%          27                 3    88.89%          12                 3    75.00%
TiDB/Schema/SchemaBuilder.cpp                                      979               432    55.87%          48                14    70.83%        1079               511    52.64%         416               231    44.47%
TiDB/Schema/TiDBSchemaSyncer.h                                     201               105    47.76%          13                 5    61.54%         147                58    60.54%          52                30    42.31%
TiDB/Schema/tests/gtest_schema_sync.cpp                             76                28    63.16%          15                 0   100.00%         201                10    95.02%          24                17    29.17%
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                             5836              2264    61.21%         506               101    80.04%       10687              2277    78.69%        2328              1207    48.15%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18605      8255             55.63%    214848  84803        60.53%

full coverage report (for internal network access only)

Signed-off-by: JaySon-Huang <[email protected]>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 5, 2022
@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Sep 5, 2022

Coverage for changed files

Filename                                                       Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Databases/test/gtest_database.cpp                                  250                77    69.20%          19                 0   100.00%         722                 8    98.89%          54                43    20.37%
Debug/MockSchemaGetter.h                                            11                 0   100.00%           7                 0   100.00%          37                 0   100.00%           6                 0   100.00%
Debug/MockTiDB.cpp                                                 163                81    50.31%          38                12    68.42%         497               194    60.97%         104                65    37.50%
Debug/MockTiDB.h                                                    12                 2    83.33%          12                 2    83.33%          25                 9    64.00%           0                 0         -
Server/RaftConfigParser.h                                            1                 0   100.00%           1                 0   100.00%           1                 0   100.00%           0                 0         -
Storages/DeltaMerge/DeltaMergeStore.cpp                           1678               589    64.90%          67                 5    92.54%        2157               521    75.85%         752               316    57.98%
Storages/DeltaMerge/DeltaMergeStore.h                               41                12    70.73%          19                 3    84.21%         107                29    72.90%          42                 9    78.57%
Storages/DeltaMerge/tests/gtest_dm_delta_merge_store.cpp           863               314    63.62%          62                 1    98.39%        2726                69    97.47%         246               168    31.71%
Storages/DeltaMerge/tests/gtest_dm_storage_delta_merge.cpp         198                43    78.28%          18                 0   100.00%         684                12    98.25%          56                28    50.00%
Storages/PathPool.cpp                                              540               268    50.37%          82                21    74.39%         772               213    72.41%         198                89    55.05%
Storages/PathPool.h                                                 14                 2    85.71%          14                 2    85.71%          16                 2    87.50%           0                 0         -
Storages/StorageDeltaMerge.cpp                                     711               276    61.18%          59                21    64.41%        1300               555    57.31%         364               198    45.60%
Storages/Transaction/PDTiKVClient.h                                  9                 4    55.56%           1                 0   100.00%          25                 9    64.00%           4                 3    25.00%
Storages/Transaction/TMTContext.cpp                                 62                40    35.48%          34                17    50.00%         159               103    35.22%          14                11    21.43%
Storages/Transaction/TMTContext.h                                    3                 2    33.33%           3                 2    33.33%           3                 2    33.33%           0                 0         -
TestUtils/TiFlashTestBasic.h                                         4                 0   100.00%           2                 0   100.00%          12                 0   100.00%           2                 0   100.00%
TestUtils/TiFlashTestEnv.cpp                                        45                 5    88.89%           7                 0   100.00%         109                11    89.91%          22                 6    72.73%
TestUtils/TiFlashTestEnv.h                                          17                 2    88.24%           4                 0   100.00%          27                 3    88.89%          12                 3    75.00%
TiDB/Schema/SchemaBuilder.cpp                                      979               432    55.87%          48                14    70.83%        1079               511    52.64%         416               231    44.47%
TiDB/Schema/TiDBSchemaSyncer.h                                     201               105    47.76%          13                 5    61.54%         147                58    60.54%          52                30    42.31%
TiDB/Schema/tests/gtest_schema_sync.cpp                             76                28    63.16%          15                 0   100.00%         201                10    95.02%          24                17    29.17%
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                             5878              2282    61.18%         525               105    80.00%       10806              2319    78.54%        2368              1217    48.61%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18644      8255             55.72%    215568  84831        60.65%

full coverage report (for internal network access only)

Copy link
Contributor

@lidezhu lidezhu 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 Sep 5, 2022
@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.

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: 7bba09a

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 5, 2022
@sre-bot
Copy link
Collaborator

sre-bot commented Sep 5, 2022

Coverage for changed files

Filename                                    Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Databases/test/gtest_database.cpp               250                77    69.20%          19                 0   100.00%         722                 8    98.89%          54                43    20.37%
Debug/MockSchemaGetter.h                         11                 0   100.00%           7                 0   100.00%          37                 0   100.00%           6                 0   100.00%
Debug/MockTiDB.cpp                              163                81    50.31%          38                12    68.42%         497               194    60.97%         104                65    37.50%
Debug/MockTiDB.h                                 12                 2    83.33%          12                 2    83.33%          25                 9    64.00%           0                 0         -
Server/RaftConfigParser.h                         1                 0   100.00%           1                 0   100.00%           1                 0   100.00%           0                 0         -
Storages/PathPool.cpp                           540               268    50.37%          82                21    74.39%         773               213    72.45%         198                89    55.05%
Storages/Transaction/PDTiKVClient.h               9                 4    55.56%           1                 0   100.00%          25                 9    64.00%           4                 3    25.00%
Storages/Transaction/TMTContext.cpp              62                40    35.48%          34                17    50.00%         159               103    35.22%          14                11    21.43%
Storages/Transaction/TMTContext.h                 3                 2    33.33%           3                 2    33.33%           3                 2    33.33%           0                 0         -
TestUtils/TiFlashTestBasic.h                      4                 0   100.00%           2                 0   100.00%          12                 0   100.00%           2                 0   100.00%
TestUtils/TiFlashTestEnv.cpp                     45                 5    88.89%           7                 0   100.00%         109                11    89.91%          22                 6    72.73%
TestUtils/TiFlashTestEnv.h                       17                 2    88.24%           4                 0   100.00%          27                 3    88.89%          12                 3    75.00%
TiDB/Schema/SchemaBuilder.cpp                   979               432    55.87%          48                14    70.83%        1079               511    52.64%         416               231    44.47%
TiDB/Schema/TiDBSchemaSyncer.h                  201               105    47.76%          13                 5    61.54%         147                58    60.54%          52                30    42.31%
TiDB/Schema/tests/gtest_schema_sync.cpp          76                28    63.16%          15                 0   100.00%         201                10    95.02%          24                17    29.17%
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                          2373              1046    55.92%         286                73    74.48%        3817              1131    70.37%         908               498    45.15%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18663      8255             55.77%    215905  84883        60.69%

full coverage report (for internal network access only)

@ti-chi-bot
Copy link
Member

@JaySon-Huang: 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.

@sre-bot
Copy link
Collaborator

sre-bot commented Sep 5, 2022

Coverage for changed files

Filename                                    Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Databases/test/gtest_database.cpp               250                77    69.20%          19                 0   100.00%         722                 8    98.89%          54                43    20.37%
Debug/MockSchemaGetter.h                         11                 0   100.00%           7                 0   100.00%          37                 0   100.00%           6                 0   100.00%
Debug/MockTiDB.cpp                              163                81    50.31%          38                12    68.42%         497               194    60.97%         104                65    37.50%
Debug/MockTiDB.h                                 12                 2    83.33%          12                 2    83.33%          25                 9    64.00%           0                 0         -
Server/RaftConfigParser.h                         1                 0   100.00%           1                 0   100.00%           1                 0   100.00%           0                 0         -
Storages/PathPool.cpp                           540               268    50.37%          82                21    74.39%         773               213    72.45%         198                89    55.05%
Storages/Transaction/PDTiKVClient.h               9                 4    55.56%           1                 0   100.00%          25                 9    64.00%           4                 3    25.00%
Storages/Transaction/TMTContext.cpp              62                40    35.48%          34                17    50.00%         159               103    35.22%          14                11    21.43%
Storages/Transaction/TMTContext.h                 3                 2    33.33%           3                 2    33.33%           3                 2    33.33%           0                 0         -
TestUtils/TiFlashTestBasic.h                      4                 0   100.00%           2                 0   100.00%          12                 0   100.00%           2                 0   100.00%
TestUtils/TiFlashTestEnv.cpp                     45                 5    88.89%           7                 0   100.00%         109                11    89.91%          22                 6    72.73%
TestUtils/TiFlashTestEnv.h                       17                 2    88.24%           4                 0   100.00%          27                 3    88.89%          12                 3    75.00%
TiDB/Schema/SchemaBuilder.cpp                   979               432    55.87%          48                14    70.83%        1079               511    52.64%         416               231    44.47%
TiDB/Schema/TiDBSchemaSyncer.h                  201               105    47.76%          13                 5    61.54%         147                58    60.54%          52                30    42.31%
TiDB/Schema/tests/gtest_schema_sync.cpp          76                28    63.16%          15                 0   100.00%         201                10    95.02%          24                17    29.17%
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                          2373              1046    55.92%         286                73    74.48%        3817              1131    70.37%         908               498    45.15%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18663      8256             55.76%    215905  84893        60.68%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit 3fb87c7 into pingcap:master Sep 5, 2022
@JaySon-Huang JaySon-Huang deleted the fix_rename_test branch September 5, 2022 11:17
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.

PageStorage: unstable rename test in ut and mock tests
6 participants