Commit fcb3386b authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'enable-lfs-over-ssf-by-default' into 'master'

Enable LFS object replication feature flag by default

See merge request gitlab-org/gitlab!61406
parents 421d10b7 e3689cc4
...@@ -8608,7 +8608,7 @@ four standard [pagination arguments](#connection-pagination-arguments): ...@@ -8608,7 +8608,7 @@ four standard [pagination arguments](#connection-pagination-arguments):
##### `GeoNode.lfsObjectRegistries` ##### `GeoNode.lfsObjectRegistries`
Find LFS object registries on this Geo node. Available only when feature flag `geo_lfs_object_replication` is enabled. Find LFS object registries on this Geo node.
Returns [`LfsObjectRegistryConnection`](#lfsobjectregistryconnection). Returns [`LfsObjectRegistryConnection`](#lfsobjectregistryconnection).
......
...@@ -45,8 +45,7 @@ module Types ...@@ -45,8 +45,7 @@ module Types
field :lfs_object_registries, ::Types::Geo::LfsObjectRegistryType.connection_type, field :lfs_object_registries, ::Types::Geo::LfsObjectRegistryType.connection_type,
null: true, null: true,
resolver: ::Resolvers::Geo::LfsObjectRegistriesResolver, resolver: ::Resolvers::Geo::LfsObjectRegistriesResolver,
description: 'Find LFS object registries on this Geo node.', description: 'Find LFS object registries on this Geo node.'
feature_flag: :geo_lfs_object_replication
field :pipeline_artifact_registries, ::Types::Geo::PipelineArtifactRegistryType.connection_type, field :pipeline_artifact_registries, ::Types::Geo::PipelineArtifactRegistryType.connection_type,
null: true, null: true,
resolver: ::Resolvers::Geo::PipelineArtifactRegistriesResolver, resolver: ::Resolvers::Geo::PipelineArtifactRegistriesResolver,
......
...@@ -208,7 +208,7 @@ module EE ...@@ -208,7 +208,7 @@ module EE
} }
] ]
if ::Feature.disabled?(:geo_lfs_object_replication) if ::Feature.disabled?(:geo_lfs_object_replication, default_enabled: :yaml)
replicable_types.insert(2, { replicable_types.insert(2, {
data_type: 'blob', data_type: 'blob',
data_type_title: _('File'), data_type_title: _('File'),
......
...@@ -39,7 +39,7 @@ module EE ...@@ -39,7 +39,7 @@ module EE
end end
def log_geo_deleted_event def log_geo_deleted_event
::Geo::LfsObjectDeletedEventStore.new(self).create! if ::Feature.disabled?(:geo_lfs_object_replication) ::Geo::LfsObjectDeletedEventStore.new(self).create! if ::Feature.disabled?(:geo_lfs_object_replication, default_enabled: :yaml)
end end
end end
end end
...@@ -13,7 +13,7 @@ class Geo::LfsObjectRegistry < Geo::BaseRegistry ...@@ -13,7 +13,7 @@ class Geo::LfsObjectRegistry < Geo::BaseRegistry
belongs_to :lfs_object, class_name: 'LfsObject' belongs_to :lfs_object, class_name: 'LfsObject'
def self.registry_consistency_worker_enabled? def self.registry_consistency_worker_enabled?
if ::Feature.enabled?(:geo_lfs_object_replication) if ::Feature.enabled?(:geo_lfs_object_replication, default_enabled: :yaml)
replicator_class.enabled? replicator_class.enabled?
else else
true true
...@@ -21,7 +21,7 @@ class Geo::LfsObjectRegistry < Geo::BaseRegistry ...@@ -21,7 +21,7 @@ class Geo::LfsObjectRegistry < Geo::BaseRegistry
end end
def self.failed def self.failed
if Feature.enabled?(:geo_lfs_object_replication) if Feature.enabled?(:geo_lfs_object_replication, default_enabled: :yaml)
with_state(:failed) with_state(:failed)
else else
where(success: false).where.not(retry_count: nil) where(success: false).where.not(retry_count: nil)
...@@ -29,7 +29,7 @@ class Geo::LfsObjectRegistry < Geo::BaseRegistry ...@@ -29,7 +29,7 @@ class Geo::LfsObjectRegistry < Geo::BaseRegistry
end end
def self.never_attempted_sync def self.never_attempted_sync
if Feature.enabled?(:geo_lfs_object_replication) if Feature.enabled?(:geo_lfs_object_replication, default_enabled: :yaml)
pending.where(last_synced_at: nil) pending.where(last_synced_at: nil)
else else
where(success: false, retry_count: nil) where(success: false, retry_count: nil)
...@@ -37,7 +37,7 @@ class Geo::LfsObjectRegistry < Geo::BaseRegistry ...@@ -37,7 +37,7 @@ class Geo::LfsObjectRegistry < Geo::BaseRegistry
end end
def self.retry_due def self.retry_due
if Feature.enabled?(:geo_lfs_object_replication) if Feature.enabled?(:geo_lfs_object_replication, default_enabled: :yaml)
where(arel_table[:retry_at].eq(nil).or(arel_table[:retry_at].lt(Time.current))) where(arel_table[:retry_at].eq(nil).or(arel_table[:retry_at].lt(Time.current)))
else else
where('retry_at is NULL OR retry_at < ?', Time.current) where('retry_at is NULL OR retry_at < ?', Time.current)
...@@ -45,7 +45,7 @@ class Geo::LfsObjectRegistry < Geo::BaseRegistry ...@@ -45,7 +45,7 @@ class Geo::LfsObjectRegistry < Geo::BaseRegistry
end end
def self.synced def self.synced
if Feature.enabled?(:geo_lfs_object_replication) if Feature.enabled?(:geo_lfs_object_replication, default_enabled: :yaml)
with_state(:synced).or(where(success: true)) with_state(:synced).or(where(success: true))
else else
where(success: true) where(success: true)
......
...@@ -492,7 +492,7 @@ class GeoNodeStatus < ApplicationRecord ...@@ -492,7 +492,7 @@ class GeoNodeStatus < ApplicationRecord
def load_lfs_objects_data def load_lfs_objects_data
return unless lfs_objects_replication_enabled return unless lfs_objects_replication_enabled
return if Feature.enabled?(:geo_lfs_object_replication) return if Feature.enabled?(:geo_lfs_object_replication, default_enabled: :yaml)
self.lfs_objects_count = lfs_objects_finder.registry_count self.lfs_objects_count = lfs_objects_finder.registry_count
self.lfs_objects_synced_count = lfs_objects_finder.synced_count self.lfs_objects_synced_count = lfs_objects_finder.synced_count
......
...@@ -11,9 +11,5 @@ module Geo ...@@ -11,9 +11,5 @@ module Geo
def self.model def self.model
::LfsObject ::LfsObject
end end
def self.replication_enabled_by_default?
false
end
end end
end end
...@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/329697 ...@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/329697
milestone: '13.11' milestone: '13.11'
type: development type: development
group: group::geo group: group::geo
default_enabled: false default_enabled: true
...@@ -36,7 +36,7 @@ module EE ...@@ -36,7 +36,7 @@ module EE
expose :db_replication_lag_seconds expose :db_replication_lag_seconds
expose :attachments_replication_enabled expose :attachments_replication_enabled
expose :lfs_objects_replication_enabled, if: -> (*) { ::Feature.enabled?(:geo_lfs_object_replication) } expose :lfs_objects_replication_enabled, if: -> (*) { ::Feature.enabled?(:geo_lfs_object_replication, default_enabled: :yaml) }
expose :job_artifacts_replication_enabled expose :job_artifacts_replication_enabled
expose :container_repositories_replication_enabled expose :container_repositories_replication_enabled
expose :design_repositories_replication_enabled expose :design_repositories_replication_enabled
......
...@@ -256,7 +256,7 @@ module Gitlab ...@@ -256,7 +256,7 @@ module Gitlab
end end
def print_lfs_objects_status def print_lfs_objects_status
return if Feature.enabled?(:geo_lfs_object_replication) return if Feature.enabled?(:geo_lfs_object_replication, default_enabled: :yaml)
print 'LFS Objects: '.rjust(GEO_STATUS_COLUMN_WIDTH) print 'LFS Objects: '.rjust(GEO_STATUS_COLUMN_WIDTH)
show_failed_value(current_node_status.lfs_objects_failed_count) show_failed_value(current_node_status.lfs_objects_failed_count)
......
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