Skip to content

Conversation

@Peiyingy
Copy link
Member

Description

Following the work in #783 to introduce caching in HaGatewayManager, this PR adds a write buffer mechanism to QueryHistoryManager. With this change, if the database becomes unavailable, Trino-Gateway can continue to route queries using the cached Trino cluster data while temporarily storing query history records in the write buffer. When the database is available again, the buffered history entries will be flushed. This allows Trino-Gateway to avoid using the database as a single point of failure and improves overall resiliency.

This approach has already been implemented and validated in production at LinkedIn.

Testing

  • mvn clean install

@cla-bot
Copy link

cla-bot bot commented Nov 11, 2025

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Peiying Ye.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@Peiyingy Peiyingy force-pushed the query-history-write-buffer branch from 0703b78 to 0512583 Compare November 11, 2025 00:39
@cla-bot
Copy link

cla-bot bot commented Nov 11, 2025

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Peiying Ye.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@Peiyingy Peiyingy force-pushed the query-history-write-buffer branch from 0512583 to 8c52dd0 Compare November 11, 2025 00:40
@cla-bot cla-bot bot added the cla-signed label Nov 11, 2025
trigger build
@Peiyingy Peiyingy force-pushed the query-history-write-buffer branch from 85776ef to caab5db Compare November 12, 2025 19:00
@Peiyingy Peiyingy marked this pull request as ready for review November 12, 2025 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant