{"action":"created","issue":{"url":"https://api.github.com/repos/apache/incubator-quickstep/issues/33","repository_url":"https://api.github.com/repos/apache/incubator-quickstep","labels_url":"https://api.github.com/repos/apache/incubator-quickstep/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/apache/incubator-quickstep/issues/33/comments","events_url":"https://api.github.com/repos/apache/incubator-quickstep/issues/33/events","html_url":"https://github.com/apache/incubator-quickstep/pull/33","id":160329026,"number":33,"title":"BugFix: Update NumQueuedWorkOrders to fix scheduling","user":{"login":"navsan","id":2507243,"avatar_url":"https://avatars.githubusercontent.com/u/2507243?v=3","gravatar_id":"","url":"https://api.github.com/users/navsan","html_url":"https://github.com/navsan","followers_url":"https://api.github.com/users/navsan/followers","following_url":"https://api.github.com/users/navsan/following{/other_user}","gists_url":"https://api.github.com/users/navsan/gists{/gist_id}","starred_url":"https://api.github.com/users/navsan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/navsan/subscriptions","organizations_url":"https://api.github.com/users/navsan/orgs","repos_url":"https://api.github.com/users/navsan/repos","events_url":"https://api.github.com/users/navsan/events{/privacy}","received_events_url":"https://api.github.com/users/navsan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-06-15T03:04:07Z","updated_at":"2016-06-15T04:12:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/incubator-quickstep/pulls/33","html_url":"https://github.com/apache/incubator-quickstep/pull/33","diff_url":"https://github.com/apache/incubator-quickstep/pull/33.diff","patch_url":"https://github.com/apache/incubator-quickstep/pull/33.patch"},"body":"Quickstep scheduling is currently broken (since PR #14). The foreman only schedules work for one worker, leaving all other workers idle. This PR fixes that bug. \r\n\r\nThe foreman maintains the number of queued work orders for each worker in the WorkerDirectory. This state was not being incremented when WorkOrders are dispatched, and not being decremented when WorkOrders are completed. The search for LeastLoadedWorker would therefore always pick the first worker, resulting in serial execution of the entire query. \r\n\r\nIn this PR, I have incremented the number of queued work orders in the Foreman when it dispatches messages. \r\n\r\nWhen a WorkOrderCompletion message arrives, this number must be decremented. However, the worker's thread ID is not available to the Foreman, since PR #14 moved the message deserialization into the PolicyEnforcer. So, in this PR, I've added a pointer to the WorkerDirectory in the PolicyEnforcer. The PolicyEnforcer decrements the number of queued work orders while processing WorkOrderCompletion messages. \r\n\r\nThe WorkerDirectory is not thread-safe, so the decrement should only be done in the Foreman thread. Since the PolicyEnforcer is part of the Foreman thread, this change should be fine. \r\n\r\nTested on CloudLab machine  (40 workers) with a few example queries. \r\n\r\n[A big thanks to @rogersjeffreyl for helping me debug this!]"},"comment":{"url":"https://api.github.com/repos/apache/incubator-quickstep/issues/comments/226083542","html_url":"https://github.com/apache/incubator-quickstep/pull/33#issuecomment-226083542","issue_url":"https://api.github.com/repos/apache/incubator-quickstep/issues/33","id":226083542,"user":{"login":"navsan","id":2507243,"avatar_url":"https://avatars.githubusercontent.com/u/2507243?v=3","gravatar_id":"","url":"https://api.github.com/users/navsan","html_url":"https://github.com/navsan","followers_url":"https://api.github.com/users/navsan/followers","following_url":"https://api.github.com/users/navsan/following{/other_user}","gists_url":"https://api.github.com/users/navsan/gists{/gist_id}","starred_url":"https://api.github.com/users/navsan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/navsan/subscriptions","organizations_url":"https://api.github.com/users/navsan/orgs","repos_url":"https://api.github.com/users/navsan/repos","events_url":"https://api.github.com/users/navsan/events{/privacy}","received_events_url":"https://api.github.com/users/navsan/received_events","type":"User","site_admin":false},"created_at":"2016-06-15T04:12:55Z","updated_at":"2016-06-15T04:12:55Z","body":"Travis failures were due to CMake validation. Build and tests succeeded. I've fixed the validation failure as well now. "}}
{"actor":{"display_login":"navsan"}}