Merged
Conversation
Generate jobs for gather pid stat. Each job contain no more then JobsPerQuery pid's and belongs to a single host. Jobs should be processed in a worker pool witch context, use for it alitto/pond - good enough to this work. Here we add only worker pool without actual start working pool and doing some actual work.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds initial master-side infrastructure for collecting per-PID procfs stats by grouping session PIDs into per-host batches and executing requests via a worker pool, while also refactoring how session listing is injected into background components.
Changes:
- Introduces
GatherProcfsStat/processProcfsRequestswith host grouping and pond-based worker pool submission. - Refactors
BackgroundStorageto own aStatActivityListerdependency (and adjusts callers/tests accordingly). - Extracts and reuses a shared gRPC client connection cache helper in
internal/master/utils.go.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/master/utils.go | Adds shared cached gRPC connection helper for master package. |
| internal/master/procfs.go | Implements job grouping + worker-pool execution for procfs PID stat RPCs. |
| internal/master/procfs_test.go | Adds unit tests for job grouping, request building, and pool behavior. |
| internal/master/deps.go | Extends statActivityLister with ListAllSessions. |
| internal/master/background.go | Moves session lister dependency into BackgroundStorage and updates refresh flow/InitBG wiring. |
| internal/grpc/testutils_test.go | Updates test server wiring to new BackgroundStorage + master info server signatures. |
| internal/grpc/set_get_query_info_parallel_test.go | Updates BackgroundStorage constructor usage and dialer setup. |
| internal/grpc/mocks_test.go | Extends test mock to satisfy updated lister usage in BackgroundStorage. |
| internal/grpc/get_master_info.go | Switches session refresh to use backgroundStorage’s lister; updates constructor signature. |
| internal/grpc/actions_test.go | Updates BackgroundStorage constructor call site. |
| internal/app/app.go | Wires real stat activity lister into BackgroundStorage; updates master info server construction and InitBG call. |
| go.mod / go.sum | Adds github.com/alitto/pond dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…oken loop structure in GatherProcfsStat Agent-Logs-Url: https://github.com/open-gpdb/yagpcc/sessions/3c612e77-c1ba-4bbc-9773-cc035b3b8310 Co-authored-by: leborchuk <63977577+leborchuk@users.noreply.github.com>
Agent-Logs-Url: https://github.com/open-gpdb/yagpcc/sessions/3c612e77-c1ba-4bbc-9773-cc035b3b8310 Co-authored-by: leborchuk <63977577+leborchuk@users.noreply.github.com>
vovik0134
requested changes
Apr 29, 2026
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.
Generate jobs for gather pid stat. Each job contain no more then JobsPerQuery pid's and belongs to a single host.
Jobs should be processed in a worker pool witch context, use for it alitto/pond - good enough to this work.
Here we add only worker pool without actual start working pool and doing some actual work.
Tests were generated. But I manually checked all of them - looks good.
Also refactor using statActivityLister - place links to it in background worker, no need to pass it as a parameter in every function.