Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f744779e
Commit
f744779e
authored
Nov 24, 2021
by
Aakriti Gupta
Committed by
Douglas Barbosa Alexandre
Nov 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add multiple improvements to Geo development docs
parent
a78c66cd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
76 deletions
+70
-76
.gitlab/issue_templates/Geo Replicate a new Git repository type.md
...ssue_templates/Geo Replicate a new Git repository type.md
+21
-23
.gitlab/issue_templates/Geo Replicate a new blob type.md
.gitlab/issue_templates/Geo Replicate a new blob type.md
+49
-53
No files found.
.gitlab/issue_templates/Geo Replicate a new Git repository type.md
View file @
f744779e
...
...
@@ -56,9 +56,7 @@ Geo secondary sites have a [Geo tracking database](https://gitlab.com/gitlab-org
```
ruby
# frozen_string_literal: true
class
CreateCoolWidgetRegistry
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
class
CreateCoolWidgetRegistry
<
Gitlab
::
Database
::
Migration
[
1.0
]
disable_ddl_transaction!
def
up
...
...
@@ -126,9 +124,7 @@ The Geo primary site needs to checksum every replicable so secondaries can verif
```
ruby
# frozen_string_literal: true
class
CreateCoolWidgetStates
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
class
CreateCoolWidgetStates
<
Gitlab
::
Database
::
Migration
[
1.0
]
VERIFICATION_STATE_INDEX_NAME
=
"index_cool_widget_states_on_verification_state"
PENDING_VERIFICATION_INDEX_NAME
=
"index_cool_widget_states_pending_verification"
FAILED_VERIFICATION_INDEX_NAME
=
"index_cool_widget_states_failed_verification"
...
...
@@ -137,7 +133,6 @@ The Geo primary site needs to checksum every replicable so secondaries can verif
disable_ddl_transaction!
def
up
unless
table_exists?
(
:cool_widget_states
)
with_lock_retries
do
create_table
:cool_widget_states
,
id:
false
do
|
t
|
t
.
references
:cool_widget
,
primary_key:
true
,
null:
false
,
foreign_key:
{
on_delete: :cascade
}
...
...
@@ -155,7 +150,6 @@ The Geo primary site needs to checksum every replicable so secondaries can verif
t
.
index
:verification_state
,
where:
"(verification_state = 0 OR verification_state = 3)"
,
name:
NEEDS_VERIFICATION_INDEX_NAME
end
end
end
add_text_limit
:cool_widget_states
,
:verification_failure
,
255
end
...
...
@@ -209,6 +203,8 @@ That's all of the required database changes.
has_one
:cool_widget_state
,
autosave:
false
,
inverse_of: :cool_widget
,
class_name:
'Geo::CoolWidgetState'
after_save
:save_verification_details
delegate
:verification_retry_at
,
:verification_retry_at
=
,
:verified_at
,
:verified_at
=
,
:verification_checksum
,
:verification_checksum
=
,
...
...
@@ -223,6 +219,8 @@ That's all of the required database changes.
scope
:checksummed
,
->
{
joins
(
:cool_widget_state
).
where
.
not
(
cool_widget_states:
{
verification_checksum:
nil
}
)
}
scope
:not_checksummed
,
->
{
joins
(
:cool_widget_state
).
where
(
cool_widget_states:
{
verification_checksum:
nil
}
)
}
scope
:available_verifiables
,
->
{
joins
(
:cool_widget_state
)
}
# Override the `all` default if not all records can be replicated. For an
# example of an existing Model that needs to do this, see
# `EE::MergeRequestDiff`.
...
...
.gitlab/issue_templates/Geo Replicate a new blob type.md
View file @
f744779e
...
...
@@ -58,13 +58,10 @@ Geo secondary sites have a [Geo tracking database](https://gitlab.com/gitlab-org
```
ruby
# frozen_string_literal: true
class
CreateCoolWidgetRegistry
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
class
CreateCoolWidgetRegistry
<
Gitlab
::
Database
::
Migration
[
1.0
]
disable_ddl_transaction!
def
up
unless
table_exists?
(
:cool_widget_registry
)
ActiveRecord
::
Base
.
transaction
do
create_table
:cool_widget_registry
,
id: :bigserial
,
force: :cascade
do
|
t
|
t
.
bigint
:cool_widget_id
,
null:
false
...
...
@@ -96,7 +93,6 @@ Geo secondary sites have a [Geo tracking database](https://gitlab.com/gitlab-org
end
end
end
end
def
down
drop_table
:cool_widget_registry
...
...
@@ -130,9 +126,7 @@ The Geo primary site needs to checksum every replicable so secondaries can verif
```
ruby
# frozen_string_literal: true
class
CreateCoolWidgetStates
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
class
CreateCoolWidgetStates
<
Gitlab
::
Database
::
Migration
[
1.0
]
VERIFICATION_STATE_INDEX_NAME
=
"index_cool_widget_states_on_verification_state"
PENDING_VERIFICATION_INDEX_NAME
=
"index_cool_widget_states_pending_verification"
FAILED_VERIFICATION_INDEX_NAME
=
"index_cool_widget_states_failed_verification"
...
...
@@ -141,7 +135,6 @@ The Geo primary site needs to checksum every replicable so secondaries can verif
disable_ddl_transaction!
def
up
unless
table_exists?
(
:cool_widget_states
)
with_lock_retries
do
create_table
:cool_widget_states
,
id:
false
do
|
t
|
t
.
references
:cool_widget
,
primary_key:
true
,
null:
false
,
foreign_key:
{
on_delete: :cascade
}
...
...
@@ -159,7 +152,6 @@ The Geo primary site needs to checksum every replicable so secondaries can verif
t
.
index
:verification_state
,
where:
"(verification_state = 0 OR verification_state = 3)"
,
name:
NEEDS_VERIFICATION_INDEX_NAME
end
end
end
add_text_limit
:cool_widget_states
,
:verification_failure
,
255
end
...
...
@@ -213,6 +205,8 @@ That's all of the required database changes.
has_one
:cool_widget_state
,
autosave:
false
,
inverse_of: :cool_widget
,
class_name:
'Geo::CoolWidgetState'
after_save
:save_verification_details
delegate
:verification_retry_at
,
:verification_retry_at
=
,
:verified_at
,
:verified_at
=
,
:verification_checksum
,
:verification_checksum
=
,
...
...
@@ -227,6 +221,8 @@ That's all of the required database changes.
scope
:checksummed
,
->
{
joins
(
:cool_widget_state
).
where
.
not
(
cool_widget_states:
{
verification_checksum:
nil
}
)
}
scope
:not_checksummed
,
->
{
joins
(
:cool_widget_state
).
where
(
cool_widget_states:
{
verification_checksum:
nil
}
)
}
scope
:available_verifiables
,
->
{
joins
(
:cool_widget_state
)
}
# Override the `all` default if not all records can be replicated. For an
# example of an existing Model that needs to do this, see
# `EE::MergeRequestDiff`.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment