Repository navigation
Add job/get_worker_rows for the harvester workers of a job - #880
Merged
Merged
Conversation
The live-case harness explains why a job stayed long in a state, and a
'starting' stay can wait on the job's harvester worker. No endpoint gives
the workers of a job, and getWorkersForJob, which Watcher uses, returns []
on a database error, the same as a job without workers.
- GET /v1/job/get_worker_rows returns the Harvester_Workers rows that
Harvester_Rel_Jobs_Workers relates to job_id, joined as getWorkersForJob
joins them, ordered by harvesterID and workerID and cut at 1000 rows
with truncated, with as_of, like task/get_dataset_rows.
- Every column of the table is returned: those of WorkerSpec plus
pilotStartTime, pilotEndTime, pilotStatus and pilotStatusSyncTime, which
the pilot sets. They stay out of WorkerSpec, since updateWorkers sets
every key of harvester's data that WorkerSpec has.
- A database error answers {"error": code}.
- The read touches one partition of the relations, whose PandaID index is
local to the PandaID partitions, and the global primary key of the
workers, so it takes no probe budget.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new API endpoint to retrieve the current worker rows associated with a PanDA job, along with its backend implementation and thorough testing. The main focus is on exposing all columns from the
Harvester_Workerstable (plus pilot-specific columns) for a given job, with robust error handling and result truncation. The changes also include comprehensive unit and integration tests to ensure correctness.Key changes:
API Additions and Testing
get_worker_rowsinjob_api.pyto fetch all current Harvester worker rows for a given job, with documentation and structured response indicating truncation and read time. [1] [2]Backend Implementation
get_job_worker_rowsinWorkerModule, returning all columns fromHarvester_Workers(plus pilot columns), handling database errors, and supporting result truncation. [1] [2]JOB_WORKER_ROW_COLUMNSto specify the exact columns returned, ensuring consistency and preventing accidental overwrites.Unit Testing
worker_rows_tests.pywith detailed tests for the backend logic, covering normal operation, truncation, error handling, and SQL generation for both Oracle and Postgres backends.Minor Improvements