Skip to content

active_set_soft_limit in MinTso scheduler does not work as expected. #7692

@windtalker

Description

@windtalker

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

active_set_soft_limit is expected to limit the active query count even if thread_soft_limit is not reached.
For example, if active_set_soft_limit is set to 10, and currently, the there is 10 running queries, then any new comming query should not be scheduled except that the new comming query is a query with min_tso.
But in current implementation:

auto check_for_not_min_tso = (active_set.size() < active_set_soft_limit || query_id <= *active_set.rbegin()) && (estimated_thread_usage + needed_threads <= thread_soft_limit);

Even if active_set_soft_limit is already reached, the schedule will still allow new task to running if the tso of current task is less than the max_tso in current active set(active_set.size() < active_set_soft_limit || query_id <= *active_set.rbegin()).

2. What did you expect to see? (Required)

3. What did you see instead (Required)

4. What is your TiFlash version? (Required)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions