forked from taskcluster/taskcluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0073.yml
84 lines (84 loc) · 3.86 KB
/
0073.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
version: 73
description: include worker manager data to in queue worker responses
migrationScript: |
begin
grant select on workers to $db_user_prefix$_queue;
end
downgradeScript: |
begin
revoke select on queue_workers from $db_user_prefix$_queue;
end
methods:
get_queue_worker_tqid_with_last_date_active:
deprecated: true
get_queue_workers_tqid_with_last_date_active:
deprecated: true
get_queue_worker_with_wm_join:
description: |-
Get a non-expired queue worker by worker_pool_id, worker_group, and worker_id.
Workers are not considered expired until after their quarantine date expires.
This also performs an outer join with the worker_manager.worker table for more data.
mode: read
serviceName: worker_manager
args: task_queue_id_in text, worker_group_in text, worker_id_in text, expires_in timestamptz
returns: table(worker_pool_id text, worker_group text, worker_id text, quarantine_until timestamptz, expires timestamptz, first_claim timestamptz, recent_tasks jsonb, last_date_active timestamptz, state text, capacity int4, provider_id text, etag uuid)
body: |-
begin
return query
select
queue_workers.task_queue_id as worker_pool_id,
queue_workers.worker_group,
queue_workers.worker_id,
queue_workers.quarantine_until,
queue_workers.expires,
queue_workers.first_claim,
queue_workers.recent_tasks,
queue_workers.last_date_active,
workers.state,
workers.capacity,
workers.provider_id,
public.gen_random_uuid()
from queue_workers
full outer join workers on workers.worker_id = queue_workers.worker_id
where
queue_workers.task_queue_id = task_queue_id_in and
queue_workers.worker_group = worker_group_in and
queue_workers.worker_id = worker_id_in and
(queue_workers.expires > expires_in or queue_workers.quarantine_until > expires_in);
end
get_queue_workers_with_wm_join:
description: |-
Get non-expired queue workers ordered by worker_pool_id, worker_group, and worker_id.
Workers are not considered expired until after their quarantine date expires.
If the pagination arguments are both NULL, all rows are returned.
Otherwise, page_size rows are returned at offset page_offset.
This also performs an outer join with the worker_manager.worker table for more data.
mode: read
serviceName: worker_manager
args: task_queue_id_in text, expires_in timestamptz, page_size_in integer, page_offset_in integer
returns: table(worker_pool_id text, worker_group text, worker_id text, quarantine_until timestamptz, expires timestamptz, first_claim timestamptz, recent_tasks jsonb, last_date_active timestamptz, state text, capacity int4, provider_id text, etag uuid)
body: |-
begin
return query
select
queue_workers.task_queue_id as worker_pool_id,
queue_workers.worker_group,
queue_workers.worker_id,
queue_workers.quarantine_until,
queue_workers.expires,
queue_workers.first_claim,
queue_workers.recent_tasks,
queue_workers.last_date_active,
workers.state,
workers.capacity,
workers.provider_id,
public.gen_random_uuid()
from queue_workers
full outer join workers on workers.worker_id = queue_workers.worker_id
where
(queue_workers.task_queue_id = task_queue_id_in or get_queue_workers_with_wm_join.task_queue_id_in is null) and
((queue_workers.expires > expires_in and queue_workers.quarantine_until < expires_in) or get_queue_workers_with_wm_join.expires_in is null)
order by worker_pool_id, worker_group, worker_id
limit get_page_limit(page_size_in)
offset get_page_offset(page_offset_in);
end