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

storage: add local indexer scheduler #9383

Conversation

Lloyd-Pottiger
Copy link
Contributor

@Lloyd-Pottiger Lloyd-Pottiger commented Aug 28, 2024

What problem does this PR solve?

Issue Number: ref #9032

Problem Summary:

What is changed and how it works?

Extract LocalIndexerScheduler from https://github.com/tidbcloud/tiflash-cse/pull/203 to reduce the difficulty of code review. Meanwhile, LocalIndexerScheduler::Task::dmfile_ids is changed to LocalIndexerScheduler::Task::file_ids, which means we use page ids to identify each task, so we can add task for ColumnFileTiny later.

storage: add local indexer scheduler

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 bot added 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. labels Aug 28, 2024
@breezewish
Copy link
Member

LocalIndexerScheduler::Task::dmfile_ids is changed to LocalIndexerScheduler::Task::page_ids

Maybe need some better design (or names), since after logical split the left and right segment will hold the same dmfile_id but different page_id.

@Lloyd-Pottiger
Copy link
Contributor Author

Lloyd-Pottiger commented Aug 29, 2024

LocalIndexerScheduler::Task::dmfile_ids is changed to LocalIndexerScheduler::Task::page_ids

Maybe need some better design (or names), since after logical split the left and right segment will hold the same dmfile_id but different page_id.

@breezewish rename to

    // The file id of the DMFile.
    struct DMFileID
    {
        explicit DMFileID(PageIdU64 id_)
            : id(id_)
        {}
        PageIdU64 id;
    };
    // The page id of the ColumnFileTiny.
    struct ColumnFileTinyID
    {
        explicit ColumnFileTinyID(PageIdU64 id_)
            : id(id_)
        {}
        PageIdU64 id;
    };
    using FileID = std::variant<DMFileID, ColumnFileTinyID>;


std::unique_lock lock(mutex);

const auto internal_task = std::make_shared<InternalTask>(InternalTask{
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like internal_task will not be shared, how about using unique_ptr ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But internal_task should be copy-able

Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
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

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Sep 4, 2024
Copy link
Member

@CalvinNeo CalvinNeo left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

ti-chi-bot bot commented Sep 4, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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

The pull request process is described here

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

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 Sep 4, 2024
Copy link
Contributor

ti-chi-bot bot commented Sep 4, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-09-04 08:51:37.697110388 +0000 UTC m=+434422.215163310: ☑️ agreed by JaySon-Huang.
  • 2024-09-04 11:27:39.341103479 +0000 UTC m=+443783.859156401: ☑️ agreed by CalvinNeo.

@JaySon-Huang
Copy link
Contributor

/test pull-integration-test

@ti-chi-bot ti-chi-bot bot merged commit 4fac01c into pingcap:feature/vector-index Sep 4, 2024
5 of 7 checks passed
@Lloyd-Pottiger Lloyd-Pottiger deleted the Add-LocalIndexerScheduler branch September 9, 2024 02:39
@JaySon-Huang JaySon-Huang mentioned this pull request Sep 30, 2024
12 tasks
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.

5 participants