Commit 555e78ed authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge remote-tracking branch 'ee/master' into ce-to-ee-2017-08-18

* ee/master:
  Geo - Remove unnecessary param from Geo::BaseSyncService#update_registry
  [ci skip] Geo: add documentation on what selective replication support
  Update multi_project_pipeline_graphs.md
  Drop unnecessary timestamp columns in Geo event tables
parents 5a3e826c 5d31330d
......@@ -65,7 +65,7 @@ module Geo
Gitlab::ExclusiveLease.cancel(lease_key, repository_lease)
end
def update_registry(type, started_at: nil, finished_at: nil)
def update_registry(started_at: nil, finished_at: nil)
return unless started_at || finished_at
log_info("Updating #{type} sync information")
......
......@@ -11,17 +11,17 @@ module Geo
def fetch_project_repository
log_info('Fetching project repository')
update_registry(:repository, started_at: DateTime.now)
update_registry(started_at: DateTime.now)
begin
project.ensure_repository
project.repository.fetch_geo_mirror(ssh_url_to_repo)
update_registry(:repository, finished_at: DateTime.now)
update_registry(finished_at: DateTime.now)
rescue Gitlab::Shell::Error, Geo::EmptyCloneUrlPrefixError => e
log_error("Error syncing repository", e)
log_error('Error syncing repository', e)
rescue Gitlab::Git::Repository::NoRepository => e
log_error("Invalid repository", e)
log_error('Invalid repository', e)
log_info('Expiring caches')
project.repository.after_create
end
......
......@@ -10,18 +10,18 @@ module Geo
def fetch_wiki_repository
log_info('Fetching wiki repository')
update_registry(:wiki, started_at: DateTime.now)
update_registry(started_at: DateTime.now)
begin
project.wiki.ensure_repository
project.wiki.repository.fetch_geo_mirror(ssh_url_to_wiki)
update_registry(:wiki, finished_at: DateTime.now)
update_registry(finished_at: DateTime.now)
rescue Gitlab::Git::Repository::NoRepository,
Gitlab::Shell::Error,
ProjectWiki::CouldNotCreateWikiError,
Geo::EmptyCloneUrlPrefixError => e
log_error("Error syncing wiki repository", e)
log_error('Error syncing wiki repository', e)
end
end
......
class DropUnnecessaryTimestampColumnsInGeoEventTables < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
remove_column :geo_repository_deleted_events, :created_at
remove_column :geo_repository_deleted_events, :updated_at
remove_column :geo_repository_updated_events, :created_at
end
def down
add_column :geo_repository_deleted_events, :created_at, :datetime_with_timezone
add_column :geo_repository_deleted_events, :updated_at, :datetime_with_timezone
add_column :geo_repository_updated_events, :created_at, :datetime_with_timezone
end
end
......@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170815060945) do
ActiveRecord::Schema.define(version: 20170818174141) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
......@@ -705,8 +705,6 @@ ActiveRecord::Schema.define(version: 20170815060945) do
t.text "deleted_path", null: false
t.text "deleted_wiki_path"
t.text "deleted_project_name", null: false
t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
end
add_index "geo_repository_deleted_events", ["project_id"], name: "index_geo_repository_deleted_events_on_project_id", using: :btree
......@@ -726,7 +724,6 @@ ActiveRecord::Schema.define(version: 20170815060945) do
add_index "geo_repository_renamed_events", ["project_id"], name: "index_geo_repository_renamed_events_on_project_id", using: :btree
create_table "geo_repository_updated_events", id: :bigserial, force: :cascade do |t|
t.datetime "created_at", null: false
t.integer "branches_affected", null: false
t.integer "tags_affected", null: false
t.integer "project_id", null: false
......
......@@ -15,8 +15,8 @@ of your [jobs](pipelines.md#jobs) on a chart called [pipeline graph](pipelines.m
![Multi-project pipeline graph](img/multi_project_pipeline_graph.png)
For areas where the pipeline mini-graph is present, when hovering or clicking
(mobile) they will expand and be shown next to each other.
In the Merge Request Widget, multi-project pipeline mini-graps are displayed,
and when hovering or clicking (mobile) they will expand and be shown next to each other.
![Multi-project mini graph](img/multi_pipeline_mini_graph.gif)
......
......@@ -164,6 +164,7 @@ New users and SSH keys updated after this step, will be replicated automatically
in your browser.
1. Add the secondary node by providing its full URL and the public SSH key
you created previously. **Do NOT** check the box 'This is a primary node'.
1. Added in GitLab 9.5: Choose which namespaces should be replicated by the secondary node. Leave blank to replicate all. Read more in [selective replication](#selective-replication).
1. Click the **Add node** button.
---
......@@ -250,6 +251,21 @@ If your installation isn't working properly, check the
Point your users to the [after setup steps](after_setup.md).
## Selective replication
With GitLab **9.5**, GitLab Geo now supports the first iteration of selective
replication, which allows admins to choose which namespaces should be
replicated by secondary nodes.
It is important to notice that selective replication:
1. Does not restrict permissions from secondary nodes.
1. Does not hide projects metadata from secondary nodes. Since Geo currently
relies on PostgreSQL replication, all project metadata gets replicated to
secondary nodes, but repositories that have not been selected will be empty.
1. Secondary nodes won't pull repositories that do not belong to the selected
namespaces to be replicated.
## Adding another secondary Geo node
To add another Geo node in an already Geo configured infrastructure, just follow
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment