Aggregate Geo uploads status from the upload partitions
What does this MR do and why?
When the legacy Geo::UploadReplicator is not replication-enabled, the uploads_* Geo node status fields now report the sum over the enabled upload partition replicators. These fields feed the Geo sites status API, Service Ping, geo:status, and the geo_uploads_* Prometheus gauges. The legacy replicator is disabled by default in 19.6 (#628308 (closed)), and without this change the fields would freeze at their last legacy values.
- Counts are sums.
uploads_oldest_unsynced_timeis the minimum over partitions, ignoring the-1sentinel for partitions with nothing unsynced. - On the primary, the legacy values stay while the legacy replicator still checksums. That happens when
geo_upload_force_primary_checksummingis enabled withgeo_upload_replicationdisabled. - Only enabled partitions are summed, because the saved status row still holds stale values for disabled ones. No field is written when no partition has a value, so an empty sum never reports
0. geo:statusprints an aggregate "Uploads" row after the partition rows, in both the replication and verification sections.- The field names stay as they are. They are derived from
REPLICATOR_CLASSES, which keeps the legacy class until #628552 removes it and hardcodes the names.
References
Resolves #628546 (closed)
Screenshots or screen recordings
Not applicable: this MR has no UI change.
How to set up and validate locally
You need a Geo primary and secondary with upload partition replication running.
-
On the primary, in the Rails console, disable the legacy replicator and its primary checksumming:
Feature.disable(:geo_upload_replication) Feature.disable(:geo_upload_force_primary_checksumming) -
On the secondary, in the Rails console, compare the aggregate with the per-partition values:
status = GeoNodeStatus.current_node_status partitions = Gitlab::Geo.replication_enabled_replicator_classes.select { |r| r.replicable_group == 'uploads' } status.uploads_synced_count partitions.sum { |r| status["#{r.replicable_name_plural}_synced_count"].to_i }Both values should match.
-
On the secondary, run
bin/rake gitlab:geo:status. The "Uploads replicated" and "Uploads verified" rows appear after the per-type upload rows. -
On the primary, run
Feature.enable(:geo_upload_replication)andFeature.enable(:geo_upload_force_primary_checksumming)to restore the legacy values. The aggregate rows disappear fromgeo:status.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.