Commit 226f3b2d authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Merge branch 'mk/update-geo-framework-verification-docs' into 'master'

Update verification section in Geo framework doc

See merge request gitlab-org/gitlab!51776
parents 177aea65 c26a6d23
......@@ -279,17 +279,32 @@ For example, to add support for files referenced by a `Widget` model with a
unless table_exists?(:widget_registry)
ActiveRecord::Base.transaction do
create_table :widget_registry, id: :bigserial, force: :cascade do |t|
t.integer :widget_id, null: false
t.bigint :widget_id, null: false
t.datetime_with_timezone :created_at, null: false
t.datetime_with_timezone :last_synced_at
t.datetime_with_timezone :retry_at
t.datetime_with_timezone :verified_at
t.datetime_with_timezone :verification_started_at
t.datetime_with_timezone :verification_retry_at
t.integer :state, default: 0, null: false, limit: 2
t.integer :verification_state, default: 0, null: false, limit: 2
t.integer :retry_count, default: 0, limit: 2
t.datetime_with_timezone :retry_at
t.datetime_with_timezone :last_synced_at
t.datetime_with_timezone :created_at, null: false
t.integer :verification_retry_count, default: 0, limit: 2
t.boolean :checksum_mismatch
t.binary :verification_checksum
t.binary :verification_checksum_mismatched
t.string :verification_failure, limit: 255
t.text :last_sync_failure
t.index :widget_id, name: :index_widget_registry_on_widget_id, unique: true
t.index :retry_at
t.index :state
# To optimize performance of WidgetRegistry.verification_failed_batch
t.index :verification_retry_at, name: :widget_registry_failed_verification, order: "NULLS FIRST", where: "((state = 2) AND (verification_state = 3))"
# To optimize performance of WidgetRegistry.needs_verification_count
t.index :verification_state, name: :widget_registry_needs_verification, where: "((state = 2) AND (verification_state = ANY (ARRAY[0, 3])))"
# To optimize performance of WidgetRegistry.verification_pending_batch
t.index :verified_at, name: :widget_registry_pending_verification, order: "NULLS FIRST", where: "((state = 2) AND (verification_state = 0))"
end
end
end
......@@ -310,6 +325,10 @@ For example, to add support for files referenced by a `Widget` model with a
class Geo::WidgetRegistry < Geo::BaseRegistry
include Geo::ReplicableRegistry
# TODO: Include VerificationState in VerifiableRegistry
# https://gitlab.com/gitlab-org/gitlab/-/issues/298811
include ::Gitlab::Geo::VerificationState
include ::Geo::VerifiableRegistry
MODEL_CLASS = ::Widget
MODEL_FOREIGN_KEY = :widget_id
......@@ -366,6 +385,7 @@ For example, to add support for files referenced by a `Widget` model with a
end
include_examples 'a Geo framework registry'
include_examples 'a Geo verifiable registry'
describe '.find_registry_differences' do
... # To be implemented
......
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