Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,765
    • Issues 44,765
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,329
    • Merge requests 1,329
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #241267
Closed
Open
Issue created Aug 25, 2020 by Patrick Bair@pbair🔴Contributor

Swap base audit_events table with partitioned copy

As a final step to the partitioning migration of audit_events, the current non-partitioned table and the partitioned copy will need to be swapped. There may be some complexities to this, since the schema varies slightly between the two tables. The largest difference that may prove to be an issue is the composite primary key of (id, created_at) in the partitioned table.

As part of this issue:

  1. Develop a plan to swap tables with minimal application impact
  2. Implement any changes to the application (AuditEvent model) required to support the partitioned schema
  3. Implement migration logic to be able to swap the tables in the production environment, including:
    1. recreating secondary indexes on the partitioned table
    2. move the sequence used for id generation from the original table to the partitioned table (also be sure to update the sequence owner to the new column)
Edited Aug 28, 2020 by Patrick Bair
Assignee
Assign to
Time tracking