Skip to content
Snippets Groups Projects

Swap todos.note_id to bigint for self-managed instances

Merged Krasimir Angelov requested to merge 417402/todos/swap into master
All threads resolved!

What does this MR do and why?

This MR swaps thetodos.note_id and todos.note_id_convert_to_bigint columns for self-managed instances. This was already done for GitLab.com with Swap todos.note_id to bigint (!118123 - merged). The process is outlined here.

The timeline for GitLab.com was the following:

Since we made the decision to commit schema changes to structure.sql for the above MRs, we now need to take into account the state of the schema from which the self-managed instance was created.

We have the following cases:

  • Instances created from 15.8 and prior - swap the columns
  • Instances created from 15.9, 15.10, and 15.11 - swap the columns
  • Instances created from 16.0 - do not swap as the columns are already swapped
  • Instances created from 16.1 - do not swap as the columns are already swapped, and the clean up is done (no more temp column and trigger)

Related to Swap integer and bigint columns for notes and d... (#417402 - closed).

How to set up and validate locally

I have done the following manual testing:

  1. Create new instance from each of 15.8.0, 15.9.0, 16.0.0, and 16.1.0
  2. Upgrade all instances to 16.1.2
  3. Execute the migrations from this MR
  4. Verify migrations execute successfully and todos table has the expected schema.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Krasimir Angelov

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • mentioned in issue #417402 (closed)

  • Krasimir Angelov requested review from @stomlinson

    requested review from @stomlinson

  • added workflowin review label and removed workflowin dev label

  • Krasimir Angelov changed the description

    changed the description

  • mentioned in issue #389344 (closed)

  • Simon Tomlinson
  • Simon Tomlinson
  • Simon Tomlinson
  • Simon Tomlinson
  • Simon Tomlinson approved this merge request

    approved this merge request

  • added databaseapproved label and removed databaseactive label

  • :wave: @stomlinson, thanks for approving this merge request.

    This is the first time the merge request is approved. To ensure full test coverage, a new pipeline will be started shortly.

    For more info, please refer to the following links:

  • Simon Tomlinson resolved all threads

    resolved all threads

  • Krasimir Angelov mentioned in commit d660776a

    mentioned in commit d660776a

  • Krasimir Angelov added 1392 commits

    added 1392 commits

    Compare with previous version

  • requested review from @dfrazao-gitlab

  • Krasimir Angelov marked this merge request as ready

    marked this merge request as ready

  • Krasimir Angelov mentioned in merge request !126763 (merged)

    mentioned in merge request !126763 (merged)

  • Krasimir Angelov mentioned in commit b879ee53

    mentioned in commit b879ee53

  • added 1 commit

    • b879ee53 - Convert todos.note_id to bigint for self-managed

    Compare with previous version

  • Krasimir Angelov mentioned in commit e001b86a

    mentioned in commit e001b86a

  • Krasimir Angelov added 318 commits

    added 318 commits

    Compare with previous version

  • Diogo Frazão
  • Diogo Frazão
  • Diogo Frazão resolved all threads

    resolved all threads

  • Contributor

    Database migrations (on the main database)

    Migrations included in this change have been executed on gitlab.com data for testing purposes. For details, please see the migration testing pipeline (limited access).

    Migration Type Total runtime Result DB size change
    20230710024518 - EnsureTodosBigintBackfillCompletedForSelfManaged Post deploy 2.4 s :white_check_mark: +0.00 B
    20230710024903 - SwapTodosNoteIdToBigintForSelfManaged Post deploy 1.8 s :white_check_mark: +0.00 B
    Runtime Histogram for all migrations
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 4
    0.1 seconds - 1 second 0
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Migration: 20230710024518 - EnsureTodosBigintBackfillCompletedForSelfManaged

    • Type: Post deploy
    • Duration: 2.4 s
    • Database size change: +0.00 B
    Calls Total Time Max Time Mean Time Rows Query
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    Histogram for EnsureTodosBigintBackfillCompletedForSelfManaged
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 2
    0.1 seconds - 1 second 0
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Migration: 20230710024903 - SwapTodosNoteIdToBigintForSelfManaged

    • Type: Post deploy
    • Duration: 1.8 s
    • Database size change: +0.00 B
    Calls Total Time Max Time Mean Time Rows Query
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    Histogram for SwapTodosNoteIdToBigintForSelfManaged
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 2
    0.1 seconds - 1 second 0
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Other information

    No other migrations pending on GitLab.com

    Clone details
    Clone ID Clone Created At Clone Data Timestamp Expected Removal Time
    database-testing-2132548-10649370-main 2023-07-20T10:31:17Z 2023-07-20T07:05:16Z 2023-07-20 22:35:37 +0000
    database-testing-2132548-10649370-ci 2023-07-20T10:31:17Z 2023-07-20T08:45:50Z 2023-07-20 22:35:37 +0000

    Job artifacts

    Database migrations (on the ci database)

    Migrations included in this change have been executed on gitlab.com data for testing purposes. For details, please see the migration testing pipeline (limited access).

    Migration Type Total runtime Result DB size change
    20230710024518 - EnsureTodosBigintBackfillCompletedForSelfManaged Post deploy 3.1 s :white_check_mark: +0.00 B
    20230710024903 - SwapTodosNoteIdToBigintForSelfManaged Post deploy 2.6 s :white_check_mark: +0.00 B
    Runtime Histogram for all migrations
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 4
    0.1 seconds - 1 second 0
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Migration: 20230710024518 - EnsureTodosBigintBackfillCompletedForSelfManaged

    • Type: Post deploy
    • Duration: 3.1 s
    • Database size change: +0.00 B
    Calls Total Time Max Time Mean Time Rows Query
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    Histogram for EnsureTodosBigintBackfillCompletedForSelfManaged
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 2
    0.1 seconds - 1 second 0
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Migration: 20230710024903 - SwapTodosNoteIdToBigintForSelfManaged

    • Type: Post deploy
    • Duration: 2.6 s
    • Database size change: +0.00 B
    Calls Total Time Max Time Mean Time Rows Query
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    Histogram for SwapTodosNoteIdToBigintForSelfManaged
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 2
    0.1 seconds - 1 second 0
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Other information

    No other migrations pending on GitLab.com

    Clone details
    Clone ID Clone Created At Clone Data Timestamp Expected Removal Time
    database-testing-2132548-10649370-main 2023-07-20T10:31:17Z 2023-07-20T07:05:16Z 2023-07-20 22:35:37 +0000
    database-testing-2132548-10649370-ci 2023-07-20T10:31:17Z 2023-07-20T08:45:50Z 2023-07-20 22:35:37 +0000

    Job artifacts


    Brought to you by gitlab-org/database-team/gitlab-com-database-testing. Epic

  • Diogo Frazão approved this merge request

    approved this merge request

  • Diogo Frazão enabled an automatic merge when the pipeline for e0fd984d succeeds

    enabled an automatic merge when the pipeline for e0fd984d succeeds

  • :rocket: MWPS set :rocket:

  • merged

  • Diogo Frazão mentioned in commit ef5271b7

    mentioned in commit ef5271b7

  • added workflowstaging label and removed workflowcanary label

  • mentioned in issue #419486 (closed)

  • Leonardo da Rosa mentioned in merge request !129117 (merged)

    mentioned in merge request !129117 (merged)

  • Leonardo da Rosa mentioned in merge request !128934 (merged)

    mentioned in merge request !128934 (merged)

  • Diogo Frazão mentioned in merge request !132928 (merged)

    mentioned in merge request !132928 (merged)

  • mentioned in issue #438124 (closed)

  • Please register or sign in to reply
    Loading