postgres icon indicating copy to clipboard operation
postgres copied to clipboard

feature: testing the creation of auth_trgm to give auth own pg_trgm

Open samrose opened this issue 1 month ago • 4 comments

The goal:

Allow access to pg_trgm extension for auth service while not intruding on customer/user usage of pg_trgm

This pr will copy and use some files from pg_trgm to make a version that is specific for auth service to turn on and use.

By packaging this way will be kept in sync with postgres and default pg_trgm

we also limit to auth schema and make not relocatable.

samrose avatar Nov 19 '25 20:11 samrose

========================================
Scenario 1: Create and Delete Project
========================================
PR: https://github.com/supabase/postgres/pull/1931
Engines: 15 17 17-oriole
Region: us-east-1

----------------------------------------
Testing PostgresEngine: 15
Project Name: test-scenario-1-pg15-1765407112
----------------------------------------
[15] Creating project with PR version...
INSERT 0 0
UPDATE 1
                  version                  |  region   |   provider_image_id   | release_channel | postgres_engine
-------------------------------------------+-----------+-----------------------+-----------------+-----------------
 supabase-postgres-15.14.1.053-auth-trgm-6 | us-east-1 | ami-084804bc3d2412139 | ga              | 15
(1 row)


http://localhost:8082/project/xrzqxrarzxukufkjlkqr
Database status is not yet available, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is now ACTIVE_HEALTHY
[15] Project created successfully
[15] Deleting project...
Project deleted
[15] Project deleted successfully

----------------------------------------
Testing PostgresEngine: 17
Project Name: test-scenario-1-pg17-1765407196
----------------------------------------
[17] Creating project with PR version...
INSERT 0 0
UPDATE 1
                 version                  |  region   |   provider_image_id   | release_channel | postgres_engine
------------------------------------------+-----------+-----------------------+-----------------+-----------------
 supabase-postgres-17.6.1.053-auth-trgm-6 | us-east-1 | ami-038a01ff8f8f4d55c | ga              | 17
(1 row)


http://localhost:8082/project/jdvmvynrxceqhulcdycj
Database status is not yet available, waiting...
Database status is currently UNKNOWN, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is now ACTIVE_HEALTHY
[17] Project created successfully
[17] Deleting project...
Project deleted
[17] Project deleted successfully

----------------------------------------
Testing PostgresEngine: 17-oriole
Project Name: test-scenario-1-pg17-oriole-1765407295
----------------------------------------
[17-oriole] Creating project with PR version...
INSERT 0 0
UPDATE 1
                      version                      |  region   |   provider_image_id   | release_channel | postgres_engine
---------------------------------------------------+-----------+-----------------------+-----------------+-----------------
 supabase-postgres-17.6.0.010-orioledb-auth-trgm-6 | us-east-1 | ami-07d9963e51a987401 | ga              | 17-oriole
(1 row)


http://localhost:8082/project/bwzghrmjbtxaneoxbyfq
Database status is not yet available, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is now ACTIVE_HEALTHY
[17-oriole] Project created successfully
[17-oriole] Deleting project...
Project deleted
[17-oriole] Project deleted successfully

========================================
Scenario 1: PASSED
========================================

LGUG2Z avatar Dec 10 '25 22:12 LGUG2Z

========================================
Scenario 2: GA Status, Pause and Restore
========================================
PR: https://github.com/supabase/postgres/pull/1931
Engines: 15 17 17-oriole
Region: us-east-1

----------------------------------------
Step 1: Ensuring all PR versions have GA status
----------------------------------------
[15] Inserting version 15.14.1.053-auth-trgm-6 with GA status...
INSERT 0 0
UPDATE 1
                  version                  |  region   |   provider_image_id   | release_channel | postgres_engine
-------------------------------------------+-----------+-----------------------+-----------------+-----------------
 supabase-postgres-15.14.1.053-auth-trgm-6 | us-east-1 | ami-084804bc3d2412139 | ga              | 15
(1 row)


[17] Inserting version 17.6.1.053-auth-trgm-6 with GA status...
INSERT 0 0
UPDATE 1
                 version                  |  region   |   provider_image_id   | release_channel | postgres_engine
------------------------------------------+-----------+-----------------------+-----------------+-----------------
 supabase-postgres-17.6.1.053-auth-trgm-6 | us-east-1 | ami-038a01ff8f8f4d55c | ga              | 17
(1 row)


[17-oriole] Inserting version 17.6.0.010-orioledb-auth-trgm-6 with GA status...
INSERT 0 0
UPDATE 1
                      version                      |  region   |   provider_image_id   | release_channel | postgres_engine
---------------------------------------------------+-----------+-----------------------+-----------------+-----------------
 supabase-postgres-17.6.0.010-orioledb-auth-trgm-6 | us-east-1 | ami-07d9963e51a987401 | ga              | 17-oriole
(1 row)


All versions inserted with GA status

----------------------------------------
Testing PostgresEngine: 15
Project Name: test-scenario-2-pg15-1765407496
Version: 15.14.1.053-auth-trgm-6
----------------------------------------
[15] Creating project with PR version...
INSERT 0 0
UPDATE 1
                  version                  |  region   |   provider_image_id   | release_channel | postgres_engine
-------------------------------------------+-----------+-----------------------+-----------------+-----------------
 supabase-postgres-15.14.1.053-auth-trgm-6 | us-east-1 | ami-084804bc3d2412139 | ga              | 15
(1 row)


http://localhost:8082/project/dwgqftyoqhmbjjeggfoo
Database status is not yet available, waiting...
Database status is currently UNKNOWN, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is now ACTIVE_HEALTHY
[15] Project created successfully
[15] Pausing project...
Project paused
Pause status is currently PAUSING, waiting...
Pause status is currently PAUSING, waiting...
Pause status is currently PAUSING, waiting...
Pause status is now INACTIVE
[15] Project paused successfully
[15] Restoring project...
{
  "id": 18,
  "status": "INACTIVE",
  "organization_id": 1,
  "region": "us-east-1",
  "cloud_provider": "AWS"
}
Restoration status is currently INACTIVE, waiting...
Restoration status is currently COMING_UP, waiting...
Restoration status is currently COMING_UP, waiting...
Restoration status is currently COMING_UP, waiting...
Restoration status is currently RESTORING, waiting...
Restoration status is currently RESTORING, waiting...
Restoration status is currently RESTORING, waiting...
Restoration status is now ACTIVE_HEALTHY
[15] Project restored successfully
[15] Deleting project...
Project deleted
[15] Project deleted successfully

----------------------------------------
Testing PostgresEngine: 17
Project Name: test-scenario-2-pg17-1765408260
Version: 17.6.1.053-auth-trgm-6
----------------------------------------
[17] Creating project with PR version...
INSERT 0 0
UPDATE 1
                 version                  |  region   |   provider_image_id   | release_channel | postgres_engine
------------------------------------------+-----------+-----------------------+-----------------+-----------------
 supabase-postgres-17.6.1.053-auth-trgm-6 | us-east-1 | ami-038a01ff8f8f4d55c | ga              | 17
(1 row)


http://localhost:8082/project/ywcqxdniljevafzowcdt
Database status is not yet available, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is now ACTIVE_HEALTHY
[17] Project created successfully
[17] Pausing project...
Project paused
Pause status is currently PAUSING, waiting...
Pause status is currently PAUSING, waiting...
Pause status is currently PAUSING, waiting...
Pause status is now INACTIVE
[17] Project paused successfully
[17] Restoring project...
{
  "id": 19,
  "status": "INACTIVE",
  "organization_id": 1,
  "region": "us-east-1",
  "cloud_provider": "AWS"
}
Restoration status is currently INACTIVE, waiting...
Restoration status is currently COMING_UP, waiting...
Restoration status is currently COMING_UP, waiting...
Restoration status is currently COMING_UP, waiting...
Restoration status is currently RESTORING, waiting...
Restoration status is currently RESTORING, waiting...
Restoration status is currently RESTORING, waiting...
Restoration status is now ACTIVE_HEALTHY
[17] Project restored successfully
[17] Deleting project...
Project deleted
[17] Project deleted successfully

----------------------------------------
Testing PostgresEngine: 17-oriole
Project Name: test-scenario-2-pg17-oriole-1765408974
Version: 17.6.0.010-orioledb-auth-trgm-6
----------------------------------------
[17-oriole] Creating project with PR version...
INSERT 0 0
UPDATE 1
                      version                      |  region   |   provider_image_id   | release_channel | postgres_engine
---------------------------------------------------+-----------+-----------------------+-----------------+-----------------
 supabase-postgres-17.6.0.010-orioledb-auth-trgm-6 | us-east-1 | ami-07d9963e51a987401 | ga              | 17-oriole
(1 row)


http://localhost:8082/project/tyinnpaqoxedhohralus
Database status is not yet available, waiting...
Database status is currently UNKNOWN, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is now ACTIVE_HEALTHY
[17-oriole] Project created successfully
[17-oriole] Pausing project...
Project paused
Pause status is currently PAUSING, waiting...
Pause status is currently PAUSING, waiting...
Pause status is currently PAUSING, waiting...
Pause status is now INACTIVE
[17-oriole] Project paused successfully
[17-oriole] Restoring project...
{
  "id": 20,
  "status": "INACTIVE",
  "organization_id": 1,
  "region": "us-east-1",
  "cloud_provider": "AWS"
}
Restoration status is currently INACTIVE, waiting...
Restoration status is currently COMING_UP, waiting...
Restoration status is currently COMING_UP, waiting...
Restoration status is currently COMING_UP, waiting...
Restoration status is currently RESTORING, waiting...
Restoration status is currently RESTORING, waiting...
Restoration status is currently RESTORING, waiting...
Restoration status is now ACTIVE_HEALTHY
[17-oriole] Project restored successfully
[17-oriole] Deleting project...
Project deleted
[17-oriole] Project deleted successfully

========================================
Scenario 2: PASSED
========================================

LGUG2Z avatar Dec 10 '25 23:12 LGUG2Z

========================================
Scenario 3: Upgrade PG15 to PG17
========================================
PR: https://github.com/supabase/postgres/pull/1931
Project Name: test-scenario-3-upgrade-1765417566
Region: us-east-1

----------------------------------------
Step 1: Setting all PR versions to WITHDRAWN status
----------------------------------------
Inserting PG15 version 15.14.1.053-auth-trgm-6 as withdrawn...
INSERT 0 0
UPDATE 1
                  version                  |  region   |   provider_image_id   | release_channel | postgres_engine
-------------------------------------------+-----------+-----------------------+-----------------+-----------------
 supabase-postgres-15.14.1.053-auth-trgm-6 | us-east-1 | ami-084804bc3d2412139 | withdrawn       | 15
(1 row)


Inserting PG17 version 17.6.1.053-auth-trgm-6 as withdrawn...
INSERT 0 0
UPDATE 1
                 version                  |  region   |   provider_image_id   | release_channel | postgres_engine
------------------------------------------+-----------+-----------------------+-----------------+-----------------
 supabase-postgres-17.6.1.053-auth-trgm-6 | us-east-1 | ami-038a01ff8f8f4d55c | withdrawn       | 17
(1 row)


Inserting PG17-oriole version 17.6.0.010-orioledb-auth-trgm-6 as withdrawn...
INSERT 0 0
UPDATE 1
                      version                      |  region   |   provider_image_id   | release_channel | postgres_engine
---------------------------------------------------+-----------+-----------------------+-----------------+-----------------
 supabase-postgres-17.6.0.010-orioledb-auth-trgm-6 | us-east-1 | ami-07d9963e51a987401 | withdrawn       | 17-oriole
(1 row)


All versions set to withdrawn status

----------------------------------------
Step 2: Creating project at PostgresEngine 15
----------------------------------------
http://localhost:8082/project/yalqvvmfurvzqovgbppq
Database status is not yet available, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is now ACTIVE_HEALTHY
Project created successfully at PG15

----------------------------------------
Step 3: Setting all PR versions to GA status
----------------------------------------
Updating PG15 version 15.14.1.053-auth-trgm-6 to GA...
INSERT 0 0
UPDATE 1
                  version                  |  region   |   provider_image_id   | release_channel | postgres_engine
-------------------------------------------+-----------+-----------------------+-----------------+-----------------
 supabase-postgres-15.14.1.053-auth-trgm-6 | us-east-1 | ami-084804bc3d2412139 | ga              | 15
(1 row)


Updating PG17 version 17.6.1.053-auth-trgm-6 to GA...
INSERT 0 0
UPDATE 1
                 version                  |  region   |   provider_image_id   | release_channel | postgres_engine
------------------------------------------+-----------+-----------------------+-----------------+-----------------
 supabase-postgres-17.6.1.053-auth-trgm-6 | us-east-1 | ami-038a01ff8f8f4d55c | ga              | 17
(1 row)


Updating PG17-oriole version 17.6.0.010-orioledb-auth-trgm-6 to GA...
INSERT 0 0
UPDATE 1
                      version                      |  region   |   provider_image_id   | release_channel | postgres_engine
---------------------------------------------------+-----------+-----------------------+-----------------+-----------------
 supabase-postgres-17.6.0.010-orioledb-auth-trgm-6 | us-east-1 | ami-07d9963e51a987401 | ga              | 17-oriole
(1 row)


All versions updated to GA status

----------------------------------------
Step 4: Checking upgrade eligibility
----------------------------------------
{
  "eligible": true,
  "current_app_version": "supabase-postgres-15.14.1.054",
  "current_app_version_release_channel": "ga",
  "latest_app_version": "supabase-postgres-17.6.1.053-auth-trgm-6",
  "target_upgrade_versions": [
    {
      "postgres_version": "17",
      "release_channel": "ga",
      "app_version": "supabase-postgres-17.6.1.053-auth-trgm-6"
    },
    {
      "postgres_version": "17",
      "release_channel": "internal",
      "app_version": "supabase-postgres-17.6.1.062"
    }
  ],
  "duration_estimate_hours": 1,
  "legacy_auth_custom_roles": [],
  "objects_to_be_dropped": [],
  "unsupported_extensions": [],
  "user_defined_objects_in_internal_schemas": []
}

----------------------------------------
Step 5: Upgrading from PG15 to PG17 (GA channel)
----------------------------------------
Upgrade status is not yet available, waiting...
Upgrade status is not yet available, waiting...
Upgrade status is currently 1_started, waiting...
Upgrade status is currently 1_started, waiting...
Upgrade status is currently 1_started, waiting...
Upgrade status is currently 1_started, waiting...
Upgrade status is currently 1_started, waiting...
Upgrade status is currently 1_started, waiting...
Upgrade status is currently 1_started, waiting...
Upgrade status is currently 1_started, waiting...
Upgrade status is currently 1_started, waiting...
Upgrade status is currently 1_started, waiting...
Upgrade status is currently 1_started, waiting...
Upgrade status is currently 2_launched_upgraded_instance, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 6_completed_data_upgrade, waiting...
Upgrade status is currently 8_attached_volume_to_upgraded_instance, waiting...
Upgrade status is currently 8_attached_volume_to_upgraded_instance, waiting...
Upgrade status is currently 8_attached_volume_to_upgraded_instance, waiting...
Upgrade status is now 9_completed_upgrade
Project upgraded successfully to PG17

----------------------------------------
Step 6: Deleting project
----------------------------------------
Project deleted
Project deleted successfully

========================================
Scenario 3: PASSED
========================================

LGUG2Z avatar Dec 11 '25 02:12 LGUG2Z

❯ ./test-scenario-4.sh
========================================
Scenario 4: Upgrade PG17 to Latest PG17
========================================
PR: https://github.com/supabase/postgres/pull/1931
Project Name: test-scenario-4-upgrade-1765418628
Region: us-east-1

----------------------------------------
Step 1: Setting all PR versions to WITHDRAWN status
----------------------------------------
Inserting PG15 version 15.14.1.053-auth-trgm-6 as withdrawn...
INSERT 0 0
UPDATE 1
                  version                  |  region   |   provider_image_id   | release_channel | postgres_engine
-------------------------------------------+-----------+-----------------------+-----------------+-----------------
 supabase-postgres-15.14.1.053-auth-trgm-6 | us-east-1 | ami-084804bc3d2412139 | withdrawn       | 15
(1 row)


Inserting PG17 version 17.6.1.053-auth-trgm-6 as withdrawn...
INSERT 0 0
UPDATE 1
                 version                  |  region   |   provider_image_id   | release_channel | postgres_engine
------------------------------------------+-----------+-----------------------+-----------------+-----------------
 supabase-postgres-17.6.1.053-auth-trgm-6 | us-east-1 | ami-038a01ff8f8f4d55c | withdrawn       | 17
(1 row)


Inserting PG17-oriole version 17.6.0.010-orioledb-auth-trgm-6 as withdrawn...
INSERT 0 0
UPDATE 1
                      version                      |  region   |   provider_image_id   | release_channel | postgres_engine
---------------------------------------------------+-----------+-----------------------+-----------------+-----------------
 supabase-postgres-17.6.0.010-orioledb-auth-trgm-6 | us-east-1 | ami-07d9963e51a987401 | withdrawn       | 17-oriole
(1 row)


All versions set to withdrawn status

----------------------------------------
Step 2: Creating project at PostgresEngine 17
----------------------------------------
http://localhost:8082/project/zidxpbbldfcsogridese
Database status is not yet available, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is currently COMING_UP, waiting...
Database status is now ACTIVE_HEALTHY
Project created successfully at PG17

----------------------------------------
Step 3: Setting all PR versions to GA status
----------------------------------------
Updating PG15 version 15.14.1.053-auth-trgm-6 to GA...
INSERT 0 0
UPDATE 1
                  version                  |  region   |   provider_image_id   | release_channel | postgres_engine
-------------------------------------------+-----------+-----------------------+-----------------+-----------------
 supabase-postgres-15.14.1.053-auth-trgm-6 | us-east-1 | ami-084804bc3d2412139 | ga              | 15
(1 row)


Updating PG17 version 17.6.1.053-auth-trgm-6 to GA...
INSERT 0 0
UPDATE 1
                 version                  |  region   |   provider_image_id   | release_channel | postgres_engine
------------------------------------------+-----------+-----------------------+-----------------+-----------------
 supabase-postgres-17.6.1.053-auth-trgm-6 | us-east-1 | ami-038a01ff8f8f4d55c | ga              | 17
(1 row)


Updating PG17-oriole version 17.6.0.010-orioledb-auth-trgm-6 to GA...
INSERT 0 0
UPDATE 1
                      version                      |  region   |   provider_image_id   | release_channel | postgres_engine
---------------------------------------------------+-----------+-----------------------+-----------------+-----------------
 supabase-postgres-17.6.0.010-orioledb-auth-trgm-6 | us-east-1 | ami-07d9963e51a987401 | ga              | 17-oriole
(1 row)


All versions updated to GA status

----------------------------------------
Step 4: Checking upgrade eligibility
----------------------------------------
{
  "eligible": true,
  "current_app_version": "supabase-postgres-17.6.1.061-ami-3",
  "current_app_version_release_channel": "ga",
  "latest_app_version": "supabase-postgres-17.6.1.053-auth-trgm-6",
  "target_upgrade_versions": [
    {
      "postgres_version": "17",
      "release_channel": "ga",
      "app_version": "supabase-postgres-17.6.1.053-auth-trgm-6"
    },
    {
      "postgres_version": "17",
      "release_channel": "internal",
      "app_version": "supabase-postgres-17.6.1.062"
    }
  ],
  "duration_estimate_hours": 1,
  "legacy_auth_custom_roles": [],
  "objects_to_be_dropped": [],
  "unsupported_extensions": [],
  "user_defined_objects_in_internal_schemas": []
}

----------------------------------------
Step 5: Upgrading PG17 to latest PG17 (GA channel)
----------------------------------------
Upgrade status is not yet available, waiting...
Upgrade status is not yet available, waiting...
Upgrade status is currently 1_started, waiting...
Upgrade status is currently 1_started, waiting...
Upgrade status is currently 1_started, waiting...
Upgrade status is currently 1_started, waiting...
Upgrade status is currently 1_started, waiting...
Upgrade status is currently 1_started, waiting...
Upgrade status is currently 1_started, waiting...
Upgrade status is currently 1_started, waiting...
Upgrade status is currently 1_started, waiting...
Upgrade status is currently 1_started, waiting...
Upgrade status is currently 2_launched_upgraded_instance, waiting...
Upgrade status is currently 4_attached_volume_to_original_instance, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 5_initiated_data_upgrade, waiting...
Upgrade status is currently 6_completed_data_upgrade, waiting...
Upgrade status is currently 8_attached_volume_to_upgraded_instance, waiting...
Upgrade status is currently 8_attached_volume_to_upgraded_instance, waiting...
Upgrade status is now 9_completed_upgrade
Project upgraded successfully to latest PG17

----------------------------------------
Step 6: Deleting project
----------------------------------------
Project deleted
Project deleted successfully

========================================
Scenario 4: PASSED
========================================

LGUG2Z avatar Dec 11 '25 02:12 LGUG2Z

closing for now, and will revisit when we have a way to backport

samrose avatar Dec 17 '25 18:12 samrose