Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
slapos slapos
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 122
    • Merge requests 122
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • slaposslapos
  • Merge requests
  • !997

Closed
Created Jun 14, 2021 by Xavier Thompson@xavier_thompsonOwner
  • Report abuse
Report abuse

ERP5: fix mariadb init

  • Overview 1
  • Commits 2
  • Changes 2

Previously the mariadb service worked on this assumption:

  • if ~/srv/mariadb exists then its contents are in a valid state
  • if it doesn't exist then it must be created and initialized

The initialization was first made in a temporary directory, and then /bin/mv was used to atomically move it to ~/srv/mariadb. This way if the initialization fails in the middle we don't end up with a miss-initialized ~/srv/mariadb directory.

However this approach had some issues: mv only works if ~/srv/mariadb is a simple directory: it fails if it's a symlink, a mount point, or a subvolume (btrfs).

Now the mariadb service works on these assumptions instead:

  • if ~/srv/mariadb/mysql exists and ~/srv/mariadb/.slapos_initializing does not exists then its in a valid state
  • else ~/srv/mariadb must be emptied (or created) and reinitialized

The initialization now starts by emptying (or creating) ~/srv/mariadb and then creating the marker file ~/srv/mariadb/.slapos_initializing. The marker file is atomically removed at the end of a successful initialization using /bin/rm.

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: erp5_fix_mariadb_init
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7