trino icon indicating copy to clipboard operation
trino copied to clipboard

Fix a hot loop in DirectExchangeClient

Open surajkn opened this issue 1 year ago • 3 comments
trafficstars

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`)

surajkn avatar May 20 '24 18:05 surajkn

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

cla-bot[bot] avatar May 20 '24 18:05 cla-bot[bot]

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

xkrogen avatar May 20 '24 21:05 xkrogen

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

surajkn avatar May 21 '24 08:05 surajkn

Thanks @surajkn

sopel39 avatar Jun 04 '24 09:06 sopel39