You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by zu...@apache.org on 2017/03/10 12:21:50 UTC

[1/2] incubator-quickstep git commit: Minor refactored the registration process between Foreman and Shiftboss. [Forced Update!]

Repository: incubator-quickstep
Updated Branches:
  refs/heads/fix-admit-queries-bug cc6855e72 -> 59c2184bd (forced update)


Minor refactored the registration process between Foreman and Shiftboss.


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/a5c68dd0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/a5c68dd0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/a5c68dd0

Branch: refs/heads/fix-admit-queries-bug
Commit: a5c68dd088cf45bb210b0257dfe291669712e7ba
Parents: c9be13b
Author: Zuyu Zhang <zu...@apache.org>
Authored: Fri Mar 10 04:21:15 2017 -0800
Committer: Zuyu Zhang <zu...@apache.org>
Committed: Fri Mar 10 04:21:15 2017 -0800

----------------------------------------------------------------------
 query_execution/Shiftboss.cpp                                    | 4 ++--
 .../tests/DistributedExecutionGeneratorTestRunner.cpp            | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/a5c68dd0/query_execution/Shiftboss.cpp
----------------------------------------------------------------------
diff --git a/query_execution/Shiftboss.cpp b/query_execution/Shiftboss.cpp
index 01c81b2..905464f 100644
--- a/query_execution/Shiftboss.cpp
+++ b/query_execution/Shiftboss.cpp
@@ -158,8 +158,6 @@ void Shiftboss::run() {
     ThreadUtil::BindToCPU(cpu_id_);
   }
 
-  processShiftbossRegistrationResponseMessage();
-
   AnnotatedMessage annotated_message;
   tmb::message_type_id message_type;
   for (;;) {
@@ -322,6 +320,8 @@ void Shiftboss::registerWithForeman() {
   tmb::MessageBus::SendStatus send_status =
       bus_global_->Send(shiftboss_client_id_global_, all_addresses, style, move(message));
   DCHECK(send_status == tmb::MessageBus::SendStatus::kOK);
+
+  processShiftbossRegistrationResponseMessage();
 }
 
 void Shiftboss::processShiftbossRegistrationResponseMessage() {

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/a5c68dd0/query_optimizer/tests/DistributedExecutionGeneratorTestRunner.cpp
----------------------------------------------------------------------
diff --git a/query_optimizer/tests/DistributedExecutionGeneratorTestRunner.cpp b/query_optimizer/tests/DistributedExecutionGeneratorTestRunner.cpp
index 0eeb83f..be04c50 100644
--- a/query_optimizer/tests/DistributedExecutionGeneratorTestRunner.cpp
+++ b/query_optimizer/tests/DistributedExecutionGeneratorTestRunner.cpp
@@ -110,6 +110,7 @@ DistributedExecutionGeneratorTestRunner::DistributedExecutionGeneratorTestRunner
   // could receive a registration message from the latter.
   foreman_ = make_unique<ForemanDistributed>(*block_locator_, &bus_, test_database_loader_->catalog_database(),
                                              nullptr /* query_processor */);
+  foreman_->start();
 
   // We don't use the NUMA aware version of worker code.
   const vector<numa_node_id> numa_nodes(1 /* Number of worker threads per instance */,
@@ -140,8 +141,6 @@ DistributedExecutionGeneratorTestRunner::DistributedExecutionGeneratorTestRunner
     storage_managers_.push_back(move(storage_manager));
   }
 
-  foreman_->start();
-
   for (int i = 0; i < kNumInstances; ++i) {
     data_exchangers_[i].start();
     shiftbosses_[i]->start();


[2/2] incubator-quickstep git commit: Fixed the admitQueries bug.

Posted by zu...@apache.org.
Fixed the admitQueries bug.


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/59c2184b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/59c2184b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/59c2184b

Branch: refs/heads/fix-admit-queries-bug
Commit: 59c2184bd14a5b275191078a0772e167cda1d2a9
Parents: a5c68dd
Author: Zuyu Zhang <zu...@apache.org>
Authored: Fri Mar 10 00:19:58 2017 -0800
Committer: Zuyu Zhang <zu...@apache.org>
Committed: Fri Mar 10 04:21:41 2017 -0800

----------------------------------------------------------------------
 query_execution/PolicyEnforcerBase.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/59c2184b/query_execution/PolicyEnforcerBase.cpp
----------------------------------------------------------------------
diff --git a/query_execution/PolicyEnforcerBase.cpp b/query_execution/PolicyEnforcerBase.cpp
index 1ffde4d..324bcb3 100644
--- a/query_execution/PolicyEnforcerBase.cpp
+++ b/query_execution/PolicyEnforcerBase.cpp
@@ -157,12 +157,15 @@ void PolicyEnforcerBase::removeQuery(const std::size_t query_id) {
 
 bool PolicyEnforcerBase::admitQueries(
     const std::vector<QueryHandle*> &query_handles) {
+  bool all_queries_admitted = true;
   for (QueryHandle *curr_query : query_handles) {
-    if (!admitQuery(curr_query)) {
-      return false;
+    if (all_queries_admitted) {
+      all_queries_admitted = admitQuery(curr_query);
+    } else {
+      waiting_queries_.push(curr_query);
     }
   }
-  return true;
+  return all_queries_admitted;
 }
 
 void PolicyEnforcerBase::recordTimeForWorkOrder(