Repository: incubator-hawq Updated Branches: refs/heads/master 649828ff7 -> 1469782ed
HAWQ-687. The segment resource increase pending counter is not adjusted correctly when failing to increase resource quota Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/1469782e Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/1469782e Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/1469782e Branch: refs/heads/master Commit: 1469782edd0552e1635952a9677ac38241665257 Parents: 649828f Author: YI JIN <[email protected]> Authored: Tue Apr 19 13:51:36 2016 +1000 Committer: YI JIN <[email protected]> Committed: Tue Apr 19 13:51:36 2016 +1000 ---------------------------------------------------------------------- .../resourcemanager/communication/rmcomm_RM2RMSEG.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1469782e/src/backend/resourcemanager/communication/rmcomm_RM2RMSEG.c ---------------------------------------------------------------------- diff --git a/src/backend/resourcemanager/communication/rmcomm_RM2RMSEG.c b/src/backend/resourcemanager/communication/rmcomm_RM2RMSEG.c index a726723..a79bd6c 100644 --- a/src/backend/resourcemanager/communication/rmcomm_RM2RMSEG.c +++ b/src/backend/resourcemanager/communication/rmcomm_RM2RMSEG.c @@ -627,6 +627,11 @@ void processContainersAfterIncreaseMemoryQuota(GRMContainerSet ctns, bool accept PRESPOOL->AddPendingContainerCount--; elog(LOG, "AddPendingContainerCount minus 1, current value %d", PRESPOOL->AddPendingContainerCount); + + /* This container can not generate additional increase pending */ + minusResourceBundleData(&(ctn->Resource->IncPending), + ctn->MemoryMB, + ctn->Core); /* * Add container to ToKickContainers if lifetime is not too long. * If the resource manager is not in clean up phase, directly drop @@ -635,16 +640,14 @@ void processContainersAfterIncreaseMemoryQuota(GRMContainerSet ctns, bool accept if( !isCleanGRMResourceStatus() && ctn->Life < RESOURCE_CONTAINER_MAX_LIFETIME ) { - /* This container can not generate additional increase pending */ - minusResourceBundleData(&(ctn->Resource->IncPending), - ctn->MemoryMB, - ctn->Core); addGRMContainerToToBeAccepted(ctn); } /* Add container to KickedContainers if lifetime is long enough */ else { - removePendingResourceRequestInRootQueue(ctn->MemoryMB, ctn->Core, false); + removePendingResourceRequestInRootQueue(ctn->MemoryMB, + ctn->Core, + false); addGRMContainerToKicked(ctn); } }
