MXS-2107: Prevent moving of client DCBs with poll_add_dcb
When a DCB is removed and added more than once with poll_add_dcb and poll_remove_dcb, the code previously chose a different thread each time the DCB was added. This violated the assumption is that all DCBs are local to a single worker.
This commit is contained in:
@ -3597,6 +3597,11 @@ int poll_add_dcb(DCB* dcb)
|
||||
// See: https://jira.mariadb.org/browse/MXS-1805 and https://jira.mariadb.org/browse/MXS-1833
|
||||
owner = RoutingWorker::get(RoutingWorker::MAIN);
|
||||
}
|
||||
else if (dcb->state == DCB_STATE_NOPOLLING)
|
||||
{
|
||||
// This DCB was removed and added back to epoll. Assign it to the same worker it started with.
|
||||
owner = static_cast<RoutingWorker*>(dcb->poll.owner);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Round-robin the client connection worker assignment
|
||||
|
||||
Reference in New Issue
Block a user