hasura / hasura/graphql-engine

V3 Migrations job slowness

Open
#8,873 0 comments 1 reaction 0 assignees View on GitHub
c/cli c/migrations k/bug t/product-platform
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version: hasuraci/graphql-engine-pro:v2.9.0-pro.1.cli-migrations-v3
CLI Version (for CLI related issue): v2.11.0-beta.1

### Environment

Pro (probably not specific to Pro however)

### What is the current behaviour?

`hasura migrate apply` can take up to 4 times as long for large sets of migrations between Config V2 and Config V3 (i.e., performance regresses from V2 to V3).

### What is the expected behaviour?

While some loss of migration performance is expected when migrations were split into multiple transactions, a reasonable expectation is that performance would not decrease by a factor of 4.

### How to reproduce the issue?

1. Create or acquire large metadata and especially migration sets.
2. Launch Hasura (Docker Compose is sufficient)
3. Create two project directories, one for Config V2 and one for Config V3 (e.g. `config-v2` and `config-v3`).
4. Initialize the two directories with `hasura init --endpoint http://localhost:8080 --version 2 config-v2` and `hasura init --endpoint http://localhost:8080 --version 3 config-v3`
5. Copy the metadata and migration sets into both project directories
6. Switch to the Config V2 directory
7. Apply the metadata with `hasura metadata apply`
8. Apply the migrations and gather timing information with `time hasura migrate apply`.
9. Bring down the server and make sure to remove Docker Compose volumes and orphans
10. Repeat the previous steps for the Config V3 directory.

### Any possible solutions?

Known possible workaround is to squash many migration files into fewer or just one migration using `hasura migrate squash`

### If the bug is confirmed, would you be willing to submit a PR?

No

### Keywords

cli v2 v3

Contributor guide

Open the contributing guide

Research direction

Reproduce the timing comparison using Docker Compose, large metadata and migration sets, and separate Config V2 and Config V3 directories. Run `hasura metadata apply` and `time hasura migrate apply` for each configuration; done means the V3 migration run no longer shows the reported fourfold performance regression.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker-compose
Domain
cli, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.