1

As we know, if a query ask resource manager to get resource but can not get enough resource(below than the minimal numbers of vsegs), it will still ask resource in the next round. For example, if a query ask 1000 vsegs at first time, but it only get 20 vsegs. As the minimal number of vsegs which the query can run is 100, will it ask 80 vsegs the next time and always keep the 20 vsegs?

  • 1
    As Lili Ma and huan zhang said, if Query1 ask 100 vsegs (minimal numbers of vsegs which query1 can run), but there are only 20 vsegs for resource manager and Query1 will hang and wait for enough vsegs. However, if there is Query2 arriving which only needs 10 vsegs, will Query2 can get vsegs from resource manager to run immediately or wait after Query1 to run or fail? – Chunling Wang Jul 20 '16 at 03:19

4 Answers4

1

No, resource will not be kept by session in HAWQ. When there is not enough vsegs, the query will hang to wait for the resource arrival and after the timeout, the query will fail.

huan zhang
  • 11
  • 1
0

I guess hawq will keep the 20 resource slots and continue to request 80 resource slots more. But this will cause starvation. And resource manager should be able to detect this.

ztao1987
  • 71
  • 7
0

Yes, Hubert is right. When Query dispatcher requires resource from Resource Manager(short as RM), it will identify min_segment_count(short as N1) and max_segment_count(short as N2), which means that if RM has enough N2 available virtual segments, it can return N2 virtual segments. But if RM doesn't have N2 available virtual segments, but has >= N1 available segments, it can return the available virtual segments back. If its available segment number is less than N1, the request will hang.

In short term, request(N1, N2), and RM judge available virtual segments number N

{

if N >= N2 return N2;

else if N >= N1 return N1;

else hang until there are enough resources.

}

Lili Ma
  • 81
  • 3
  • @chunling, if query2 is later than query1 and they two are in the same resource queue, it will wait until query1 has gain enough resource. This is the default behavior. Thanks – Lili Ma Jul 20 '16 at 05:42
0

But if query1 and query2 are in the different resource queues, it determined by the proportion of the resource queues.

amy
  • 1
  • 1
  • So can I understand like this? In same resource queue, queries execute by order, and in different resource queues, they execute by the proportion of the resource queues independently. – Chunling Wang Jul 21 '16 at 08:53