nix-oss opened a new pull request, #1863: URL: https://github.com/apache/cloudberry/pull/1863
<!-- Thank you for your contribution to Apache Cloudberry (Incubating)! --> Fixes #1862 ### What does this PR do? Fix inverted cpuset assignment in `getCpuSetByRole()`. The function returned the wrong cpuset for coordinator and segment roles when the cpuset string contains a semicolon separator (e.g., "0-7;0-15"). This caused incorrect CPU affinity settings on clusters. Additionally, this PR addresses the suggestion from the @my-ship-it to return a palloc'd copy instead of a pointer into the caller's string. A unit test for `getCpuSetByRole()` is also added to guard against future regressions. ### Type of Change - [x] Bug fix (non-breaking change) - [ ] New feature (non-breaking change) - [ ] Breaking change (fix or feature with breaking changes) - [ ] Documentation update ### Test Plan <!-- How did you test these changes? --> - [x] Unit tests added/updated ### Impact <!-- Remove sections that don't apply --> **Performance:** This fix ensures that CPU cores are assigned to the coordinator and segments exactly as configured by the administrator. It prevents unintended usage of cores that may be reserved for other critical system tasks. **User-facing changes:** Users can now successfully set cpuset strings with a semicolon separator (e.g., `ALTER RESOURCE GROUP ... SET CPUSET '4-7;9-17'`) without receiving a "cpu cores unavailable" error. ### Checklist - [x] Followed [contribution guide](https://cloudberry.apache.org/contribute/code) - [ ] Added/updated documentation - [x] Reviewed code for security implications - [ ] This PR contains AI-assisted code generation --- <!-- Join our community: - Mailing list: [[email protected]](https://lists.apache.org/[email protected]) (subscribe: [email protected]) - Discussions: https://github.com/apache/cloudberry/discussions --> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
