HAWQ-541. When YARN containers disappear from container report, the segment available resource maybe negative
Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/99a307b1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/99a307b1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/99a307b1 Branch: refs/heads/HAWQ-459 Commit: 99a307b185ce0d3821a736ab39855eb4ee08541f Parents: 5152fb0 Author: YI JIN <[email protected]> Authored: Tue Mar 15 14:30:05 2016 +1100 Committer: YI JIN <[email protected]> Committed: Tue Mar 15 14:30:05 2016 +1100 ---------------------------------------------------------------------- src/backend/resourcemanager/resourcepool.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/99a307b1/src/backend/resourcemanager/resourcepool.c ---------------------------------------------------------------------- diff --git a/src/backend/resourcemanager/resourcepool.c b/src/backend/resourcemanager/resourcepool.c index 6a36801..d3a01a4 100644 --- a/src/backend/resourcemanager/resourcepool.c +++ b/src/backend/resourcemanager/resourcepool.c @@ -2396,7 +2396,7 @@ int allocateResourceFromResourcePoolIOBytes2(int32_t nodecount, int segcountact = containerset == NULL ? 0 : containerset->Available.MemoryMB / memory; - if ( segcountact == 0 ) + if ( segcountact <= 0 ) { elog(RMLOG, "Segment %s does not have more resource to allocate. " "This segment is skipped.", @@ -3838,16 +3838,12 @@ void checkGRMContainerStatus(RB_GRMContainerStat ctnstats, int size) Assert( segres->Allocated.MemoryMB >= 0 ); Assert( segres->Allocated.Core >= 0 ); - Assert( segres->Available.MemoryMB >= 0 ); - Assert( segres->Available.Core >= 0 ); minusResourceBundleData(&(ctnset->Allocated), ctn->MemoryMB, ctn->Core); minusResourceBundleData(&(ctnset->Available), ctn->MemoryMB, ctn->Core); Assert( ctnset->Allocated.MemoryMB >= 0 ); Assert( ctnset->Allocated.Core >= 0 ); - Assert( ctnset->Available.MemoryMB >= 0 ); - Assert( ctnset->Available.Core >= 0 ); reorderSegResourceAllocIndex(segres, PQUEMGR->RatioReverseIndex[ridx]); reorderSegResourceAvailIndex(segres, PQUEMGR->RatioReverseIndex[ridx]);
