正式なドキュメントは英語版であり、この日本語訳はAI支援翻訳により作成された参考用のものです。日本語訳の一部の内容は人間によるレビューがまだ行われていないため、翻訳のタイミングにより英語版との間に差異が生じることがあります。最新かつ正確な情報については、英語版をご参照ください。

Database upgrade DDL lock

一貫した開発プロセスとドキュメントを確保するため、GitLabへのすべての貢献は英語で提出する必要があります。そのため、GitLabへの貢献に関するドキュメント(https://docs.gitlab.com/development/に掲載)も英語でのみ提供されています。

以下を希望される場合:

  • コードの貢献を提出する
  • バグの報告または修正
  • 機能や改善の提案
  • ドキュメントへの貢献

これらのページの英語版のガイドラインに従ってください。

このページの英語版にアクセスしてください。

During major PostgreSQL upgrades on GitLab.com, DDL (Data Definition Language) changes are temporarily blocked to prevent conflicts with the upgrade process. GitLab.com uses logical replication for PostgreSQL upgrades, replicating data between different major versions to achieve zero-downtime upgrades. During the upgrade window, new DDL changes can break the replication.

Instead of using a hard Production Change Lock (PCL) that blocks all deployments, a targeted lock prevents only database schema changes from being merged.

This approach allows GitLab to continue releasing other changes while protecting the database upgrade process from breaking schema modifications.

How it works

The DDL lock is configured in config/database_upgrade_ddl_lock.yml and enforced by a Danger check that runs in CI/CD pipelines. The configuration includes:

  • Merge requests that modify db/structure.sql are automatically blocked by Danger.
  • A warning appears on affected merge requests several days before the lock begins.
  • The lock only affects DDL changes. Other changes can still be merged and deployed.
  • The Danger check fails during the lock period, preventing the merge request from being merged.

When a DDL lock is active

When a lock is configured and active:

  • The Danger check fails, preventing the merge request from being merged.
  • A clear error message explains the lock period and provides next steps.

What to do if your merge request is affected

If your merge request contains DDL changes and is affected by an upgrade lock:

During the warning period

You can still merge your changes. The Danger check displays a warning message indicating:

  • How many days until the lock begins
  • When the lock starts and ends
  • Details about the upgrade
  • A link to the upgrade tracking issue

Consider merging your changes before the lock begins, or plan to wait until after the lock expires.

During the lock period

You must wait until the lock expires. The Danger check fails with an error message.

After the lock ends:

  • Retry the CI/CD pipeline.
  • The Danger check passes automatically.
  • Proceed with the normal merge request process.