manbetx客户端打不开:备份耙任务是原子的吗? [英] GitLab: Is the backup rake task atomic?

查看:156
本文介绍了manbetx客户端打不开:备份耙任务是原子的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我使用进行GitLab备份gitlab:backup:create 进行rake任务,就像有人将其推送到存储库一样,备份过程会受到影响吗?

If I make a GitLab backup using the gitlab:backup:create rake task just as someone is pushing to the repositories, will the backup process be affected?

在执行备份之前是否需要关闭GitLab?

Is it necessary to shutdown GitLab before doing the backup?

推荐答案

任务 gitlab/backup.rake 本身看起来不是原子的.
它调用:

The task gitlab/backup.rake itself doesn't look atomic.
It calls:

  Rake::Task["gitlab:backup:db:create"].invoke
  Rake::Task["gitlab:backup:repo:create"].invoke

使用 宝石activerecord :

    puts "Dumping database tables ... ".blue
    ActiveRecord::Base.connection.tables.each do |tbl|
    ...

类似于ActiveRecord的其他操作(请参见此问题),它似乎不是全局原子操作.

Like other operations with ActiveRecord (see this question), it doesn't seem to be a global atomic operation.

几个小时前,GitLab的主要开发人员 randx(Dmitriy Zaporozhets)转储数据库:

Hold on, a few hours ago, randx (Dmitriy Zaporozhets), main developer for GitLab, just refactored the dumping a database:

  • commit 38d23c0e5f816937047c9326f9dd33fb10490032 shows the use of the system call mysqldump:
    system("mysqldump #{mysql_args} #{config['database']} > #{db_file_name}")
  • commit c33d5e16fe5f5dde4f270adaf7fb6fe5b9552018 add GRANT SELECT, LOCK TABLES, ...

所以转储数据库的部分现在更加原子化了;)
但是备份本身并不涉及原子备份.备份本身涉及其他步骤,其中包括备份裸仓库.

So the part dumping the database is now more atomic ;)
But the backup itself, which involves other steps including backing up the bare repos, is not atomic.

这篇关于manbetx客户端打不开:备份耙任务是原子的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆