Skip to content

Conversation

minhancao
Copy link
Contributor

@minhancao minhancao commented Sep 9, 2025

Fixing recording of query to external db sources like MySQL or InfluxDB.

When running with concurrent streams, not all queries were recorded successfully to the database like MySQL due to the timeToExit signal channel being received first which would prematurely end the loop that records the query to the database even though that resultChan is not done receiving all the queries report yet.

Fix was to close the resultChan and modify the loop to allow for full processing of the resultChan even if the timeToExit signal channel was received.

Example:
Ran pbench locally.
100 streams of 70 simple queries = 7000 queries expected to be reported
only 6984 queries were reported in the queries_ran column
https://grafana.ibm.prestodb.dev/d/cf1f9e9c-9c17-4f82-804c-4cdc99e14f37/run-comparison?orgId=1&var-base_run=mcao_pbench_main_stream_test_biday3_sf1_250909-104401&var-target_run=None&var-query_idx=0&from=now-30d&to=now&refresh=5s

NOTE:
For some reason, when running the pbench jenkins pipeline, it does accurately reports the number of queries ran.

https://ci.ibm.prestodb.dev/job/presto-performance/job/presto-performance/job/pipeline-pbench-ibm-concurrency-testing/21/

https://grafana.ibm.prestodb.dev/d/cf1f9e9c-9c17-4f82-804c-4cdc99e14f37/run-comparison?orgId=1&var-base_run=mcao_biday3_sf1_prestissimo_100streams_run_simple_test_for_allen_pbench_no_random_dup_250908-211518&var-target_run=None&var-query_idx=0&from=now-30d&to=now&refresh=5s

When running with concurrent streams, not all queries were recorded
successfully to the database like MySQL due to the timeToExit signal
channel being received first which would prematurely end the loop
that records the query to the database even though that resultChan
is not done receiving all the queries report yet.

Fix was to close the resultChan and modify the loop to allow for full
processing of the resultChan even if the timeToExit signal channel was
received.
@minhancao minhancao self-assigned this Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant