-
Notifications
You must be signed in to change notification settings - Fork 152
Closed
Description
Create a new service trait and implementation in worker-executor-service-base with two public operations (in pseudo code):
get-running-workers(template_id, filter) -> vec<metadata>scan-workers(template_id, filter, precise, cursor) -> option<(cursor, vec<metadata>)>
This service should have a default “live implementation”, which:
- uses the
ActiveWorkersto enumerate all workers in memory - uses a combination of
Redisand theWorkerServiceto perform theSCANto lazily enumerate all workers
Both operations should use a common implementation of applying the filter to the chunk of worker metadata.
We should have a precise bool flag (or some mode enum with two modes for now) with the following meaning:
- When it is
true,scan-workersmust check every worker metadata’s cached part (WorkerStatusRecordin the code) to see if it’soplog_indexis the same as the oplog’s size (requires aXLENredis operation - to be done throughOplogService). If not, an up-to-dateWorkerStatusRecordneeds to be generatedcalculate_last_known_status. This needs to be done before applying the filters (at least that part of the filter which is related to status)