Skip to content

Align Resource Group Tables with Trino v476 #713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

yardenc2003
Copy link

@yardenc2003 yardenc2003 commented Jun 26, 2025

Description

This PR updates the resource groups–related tables to match the schemas used by Trino (v476).

Additional context and related issues

Since version 14, automatic database migrations have been enabled in the gateway (I believe in this PR).
This causes conflicts (different Flyway migration checksums) with the automatic migrations triggered during Trino’s startup. As a result, when sharing the database between the gateway and one or more Trino instances, migration immediately fails.

If we decide to enable only the gateway migrations, we must ensure the schemas match Trino’s. Otherwise, it fails due to missing columns. This PR addresses that schema alignment.

Refers this issue.

a Few Disclaimers

  • I believe we need to disable one of the migrations (either Trino's or the gateway's) or at least document this. Currently, it does not work with the default configuration if resource groups are enabled and Trino shares the database with the gateway.
  • I have not verified compatibility with older Trino versions that haven’t updated their schemas while the gateway has, only with v476 for the different db implementations.
  • I had to reduce the maximum length of the environment column in exact_match_source_selectors in Oracle to match Trino’s schema. This change might be unsafe and prone to failures.
  • I have not updated either the UI forms for resource groups/selectors creation or the underlying SQL statements (DAO classes). I wasn’t sure if this effort was worthwhile, given that this feature is about to be removed from the gateway and the existing implementation has issues updating via the UI.

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.

@cla-bot cla-bot bot added the cla-signed label Jun 26, 2025
@RoeyoOgen RoeyoOgen requested review from posulliv and mosabua June 27, 2025 12:53
@oneonestar
Copy link
Member

We should allow gateway to be used with old and new version of Trino (or a mix of both).
I'd prefer disable the migration on Resource Group tables.

@xkrogen
Copy link
Member

xkrogen commented Jul 16, 2025

I'd prefer disable the migration on Resource Group tables.

+1 -- the owner of these tables is the Trino Coordinator, not the GW. The GW should not attempt to perform schema changes on these tables.

We should allow gateway to be used with old and new version of Trino (or a mix of both).

+1 the GW should be able to handle multiple schema versions of this DB

@mosabua
Copy link
Member

mosabua commented Jul 16, 2025

I agree that we should disable automatic updates from Trino Gateway.

I would go one step further .. and we agreed on that already .. Trino Gateway should not have UI to manage the resource group data .. it should move to the Trino UI, specifically the new preview UI.

Separately if we need some sort of concept and tooling around resource use in Trino Gateway (and we do) we should implement something new that works properly for multiple clusters and more.

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.

4 participants