pingcap / tiflash

The analytical engine for TiDB and TiDB Cloud. Try free: https://tidbcloud.com/free-trial
https://docs.pingcap.com/tidb/stable/tiflash-overview
Apache License 2.0
944 stars 410 forks source link

storage: add local indexer scheduler #9383

Closed Lloyd-Pottiger closed 1 month ago

Lloyd-Pottiger commented 1 month ago

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

Side effects

Documentation

Release note

None
breezewish commented 1 month ago

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 commented 1 month ago

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>;
ti-chi-bot[bot] commented 1 month ago

[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](https://github.com/pingcap/tiflash/blob/feature/vector-index/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[bot] commented 1 month ago

[LGTM Timeline notifier]

Timeline:

JaySon-Huang commented 1 month ago

/test pull-integration-test