Skip to content

storage: Add more checks for ingestFiles#6375

Merged
ti-chi-bot merged 7 commits intopingcap:masterfrom
breezewish:wenxuan/ingest_check_not_overlap
Nov 29, 2022
Merged

storage: Add more checks for ingestFiles#6375
ti-chi-bot merged 7 commits intopingcap:masterfrom
breezewish:wenxuan/ingest_check_not_overlap

Conversation

@breezewish
Copy link
Member

@breezewish breezewish commented Nov 28, 2022

What problem does this PR solve?

Issue Number: ref #5237

Problem Summary:

What is changed and how it works?

  1. Add check: Check files passed in are ordered and not overlapped.

  2. Add check: Check files' range is contained by the ingest range (the ingest range is the region's range).

    Reason: The content of a ColumnFileBig can be only stripped by the segment range (at the read time), not any other range. If the ingest range is smaller than the files' range, for example: ingest_range = [0, 100) and file_data_range = [50, 200), [50, 200) will be still ingested, while [0, 100) will be cleared (if clear_data_in_range = true).

    To avoid surprising results later, we simply forbid this case now.

    Note: Although we specified a stripped range to ingestColumnFiles https://github.com/pingcap/tiflash/blob/09e3a9e2413189070740af58430a9c1da7fe9b72/dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp#LL849 , the stripped range is only used for delete data, instead of stripping the output.

    This check is risky. We need some time for E2E tests to verify whether there are some unintentional edge cases.

    Currently TiKV has similar checks:

    image
  3. Introduce ingestFiles to the dm test framework, so that we can write related tests easier.

    As a result, test DeltaMergeStoreRWTest/IngestEmptyFileLists is migrated to StoreIngestTest/EmptyFileLists, simplified using new test framework.

  4. Add tests to verify check 1 and check 2, based on the test framework above.

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 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 Nov 28, 2022
Signed-off-by: Wish <breezewish@outlook.com>
@breezewish
Copy link
Member Author

/run-all-tests

@breezewish
Copy link
Member Author

/run-unit-test

Copy link
Contributor

@JaySon-Huang JaySon-Huang left a comment

Choose a reason for hiding this comment

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

LGTM with minor comment

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Nov 29, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JaySon-Huang
  • 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 the status/LGT1 Indicates that a PR has LGTM 1. label Nov 29, 2022
Signed-off-by: Wish <breezewish@outlook.com>
@JaySon-Huang
Copy link
Contributor

Will tikv's multi-rocksdb instances feature break the assumption added here (in the future)?

@breezewish
Copy link
Member Author

Will tikv's multi-rocksdb instances feature break the assumption added here (in the future)?

Currently no, the MultiRaft's data must be strictly matched with the Raft group's boundary.

@breezewish
Copy link
Member Author

/run-all-tests

@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 Nov 29, 2022
@breezewish
Copy link
Member Author

/merge

@ti-chi-bot
Copy link
Member

@breezewish: 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: 8514195

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 29, 2022
@ti-chi-bot ti-chi-bot merged commit c32b7f6 into pingcap:master Nov 29, 2022
@breezewish breezewish deleted the wenxuan/ingest_check_not_overlap branch November 29, 2022 09:35
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/LGT2 Indicates that a PR has LGTM 2.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants