Repository marked as read only before move task is runned
Summary
Project marked as read_only right after move shard API call.
Steps to reproduce
Trigger move of big amount projects to another shard. Then right after that execute following SQL query:
SELECT COUNT(*) FROM projects WHERE repository_read_only=true;
In my case output is 863 but I have only one ProjectUpdateRepositoryStorageWorker.
Example Project
(If possible, please create an example project here on GitLab.com that exhibits the problematic behavior, and link to it here in the bug report)
(If you are using an older version of GitLab, this will also determine whether the bug is fixed in a more recent version)
What is the current bug behavior?
Project marked as read only right after move shard API call
What is the expected correct behavior?
Project should marked as read only in ProjectUpdateRepositoryStorage task right before moving actually starts. It would still block write for migration time but it would avoid write restrict for time while tasks is being waiting in queue.
Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's tough to read otherwise.)
Output of checks
(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: CentOS 7.7.1908 Current User: git Using RVM: no Ruby Version: 2.6.3p62 Gem Version: 3.0.6 Bundler Version:1.17.3 Rake Version: 12.3.3 Redis Version: unknown Git Version: 2.22.1 Sidekiq Version:5.2.7 Go Version: unknownGitLab information Version: 12.4.2 Revision: Unknown Directory: /home/git/gitlab DB Adapter: PostgreSQL DB Version: 11.5 URL: https://git.wrke.in HTTP Clone URL: https://git.wrke.in/some-group/some-project.git SSH Clone URL: git@git.wrke.in:some-group/some-project.git Using LDAP: yes Using Omniauth: no
GitLab Shell Version: 10.2.0 Repository storage paths:
- default: /home/git/gitlab
- gitaly02: /home/git/gitlab GitLab Shell path: /home/git/gitlab-shell Git: /opt/3rd/git/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)(we will only investigate if the tests are passing)
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)