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

txn: remove scheduler #4098

Merged
merged 31 commits into from
May 20, 2019
Merged

txn: remove scheduler #4098

merged 31 commits into from
May 20, 2019

Conversation

hicqu
Copy link
Contributor

@hicqu hicqu commented Jan 21, 2019

What have you changed? (mandatory)

Reomve scheduler thread. So in the current implement introduced by this PR, callers dispatch messages to schedule-worker directly instead of scheduler first.

What are the type of the changes? (mandatory)

Improvement.

How has this PR been tested? (mandatory)

Unit tests and integration tests.

Does this PR affect documentation (docs) update? (mandatory)

No.

Does this PR affect tidb-ansible update? (mandatory)

No.

siddontang and others added 3 commits December 22, 2018 18:25
Signed-off-by: siddontang <siddontang@gmail.com>
Signed-off-by: qupeng <qupeng@pingcap.com>
@zhangjinpeng87
Copy link
Member

Please provide some bench results.

@BusyJay BusyJay changed the title No scheduler txn: remove scheduler Jan 21, 2019
src/storage/txn/scheduler.rs Outdated Show resolved Hide resolved
src/storage/txn/scheduler.rs Show resolved Hide resolved
@overvenus overvenus added component/storage Component: Storage, Scheduler, etc. sig/transaction SIG: Transaction component/performance Component: Performance labels Jan 30, 2019
@zhouqiang-cl
Copy link
Contributor

/test

hicqu added 3 commits May 7, 2019 17:41
Signed-off-by: qupeng <qupeng@pingcap.com>
Signed-off-by: qupeng <qupeng@pingcap.com>
hicqu and others added 3 commits May 8, 2019 14:20
Signed-off-by: qupeng <qupeng@pingcap.com>
Signed-off-by: qupeng <qupeng@pingcap.com>
@hicqu
Copy link
Contributor Author

hicqu commented May 8, 2019

/release

@sre-bot
Copy link
Contributor

sre-bot commented May 8, 2019

Signed-off-by: qupeng <qupeng@pingcap.com>
Connor1996
Connor1996 previously approved these changes May 17, 2019
Copy link
Member

@Connor1996 Connor1996 left a comment

Choose a reason for hiding this comment

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

LGTM


fn dequeue_task(&self, cid: u64) -> Task {
let mut tasks = self.task_contexts[id_index(cid)].lock().unwrap();
let task = tasks.get_mut(&cid).unwrap().task.take().unwrap();
Copy link
Member

@zhangjinpeng87 zhangjinpeng87 May 20, 2019

Choose a reason for hiding this comment

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

I think use remove directly is more clear.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is an Option<Task> in TaskContext. When getting a snapshot we need to get the inner Task but leave the TaskContext.

}
}

fn dequeue_task_context(&self, cid: u64) -> TaskContext {
Copy link
Member

Choose a reason for hiding this comment

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

Seems duplicate with dequeue_task?

hicqu and others added 2 commits May 20, 2019 10:49
Signed-off-by: qupeng <qupeng@pingcap.com>
Signed-off-by: qupeng <qupeng@pingcap.com>
zhangjinpeng87
zhangjinpeng87 previously approved these changes May 20, 2019
Copy link
Member

@zhangjinpeng87 zhangjinpeng87 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
Member

@Connor1996 Connor1996 left a comment

Choose a reason for hiding this comment

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

LGTM

@hicqu hicqu merged commit 4aacf5b into tikv:master May 20, 2019
@hicqu hicqu deleted the no-scheduler branch May 20, 2019 04:51
jswh pushed a commit to jswh/tikv that referenced this pull request May 27, 2019
Signed-off-by: qupeng <qupeng@pingcap.com>
sticnarf pushed a commit to sticnarf/tikv that referenced this pull request Oct 27, 2019
Signed-off-by: qupeng <qupeng@pingcap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/performance Component: Performance component/storage Component: Storage, Scheduler, etc. priority/high Priority: High sig/transaction SIG: Transaction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants