Skip to content

Conversation

@williamjallen
Copy link
Collaborator

The build2test primary key column currently uses an integer type. Bigints are recommended for primary keys in Postgres since they are effectively impossible to overflow. This PR changes the type from int to bigint to avoid a sequence overflow observed on one of our large production systems.

Copy link
Member

@josephsnyder josephsnyder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@josephsnyder josephsnyder added this pull request to the merge queue Aug 18, 2025
Merged via the queue into Kitware:master with commit 09b6623 Aug 18, 2025
14 checks passed
@williamjallen williamjallen deleted the test-id-type branch August 18, 2025 13:43
github-merge-queue bot pushed a commit that referenced this pull request Aug 18, 2025
Follows #3054. For systems where
many tests have associated images, the `image` table can be close to the
size of the `build2test` table. The goal is to eventually change all ID
columns to bigints, but I'd like to let these two roll out first before
proceeding with the rest to make sure there are no lingering issues with
this change, especially for databases migrated from MySQL in the past.
github-merge-queue bot pushed a commit that referenced this pull request Oct 15, 2025
All ID columns should be bigints to avoid the potential for overflow
errors. Follows #3054 which
addressed the most urgent need.

Depending on the column ordering (which may be different between systems
due to historical migration differences), this migration may require
some or all of the affected tables to be rewritten. Some of the affected
tables can be quite large on production systems and it's likely that
table rewrites could take hours to complete depending on the total size
and speed of the underlying storage medium.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants