trino
trino copied to clipboard
Fix a hot loop in DirectExchangeClient
Description
The fix changes queuedClients to LinkedHashSet, this helps with the filter condition in scheduleRequestIfNecessary. In addition two for loops are modified to become one loop on Iterator.
Additional context and related issues
We experienced some performance regression as a result of https://github.com/trinodb/trino/commit/1ef442738fc51d1d7cf167bf6ca413378d928026 and this is an attempt to fix the same.
Release notes
( ) This is not user-visible or is docs only, and no release notes are required. (x ) Release notes are required. Please propose a release note for me. ( ) Release notes are required, with the following suggested text:
# Section
* Fix some things. ({issue}`issuenumber`)
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla
Quick note about the performance regression -- what we observed was that on larger heavily-loaded clusters (hundreds of nodes), this became a severe issue causing cluster-wide degradation in performance.
We've been running this fix on all of our clusters for 9+ months now and have seen full recovery to performance before https://github.com/trinodb/trino/commit/1ef442738fc51d1d7cf167bf6ca413378d928026
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla
Have sent the completed CLA form to [email protected], waiting for the request to be reviewed and approved
Thanks @surajkn