Commit aef65e4e authored by Valery Sizov's avatar Valery Sizov

Geo: Remove counts for geo_event_log

We don't really need this data too much, at the same time it's hard
to calculate. So let's just get rid of this data.
parent 966505d0
...@@ -14,6 +14,7 @@ class GeoNodeStatus < ApplicationRecord ...@@ -14,6 +14,7 @@ class GeoNodeStatus < ApplicationRecord
attr_accessor :repository_verification_enabled attr_accessor :repository_verification_enabled
# Prometheus metrics, no need to store them in the database # Prometheus metrics, no need to store them in the database
# :event_log_count is deprecated and will be removed in 12.0
attr_accessor :event_log_count, :event_log_max_id, attr_accessor :event_log_count, :event_log_max_id,
:repository_created_max_id, :repository_updated_max_id, :repository_created_max_id, :repository_updated_max_id,
:repository_deleted_max_id, :repository_renamed_max_id, :repositories_changed_max_id, :repository_deleted_max_id, :repository_renamed_max_id, :repositories_changed_max_id,
...@@ -70,7 +71,6 @@ class GeoNodeStatus < ApplicationRecord ...@@ -70,7 +71,6 @@ class GeoNodeStatus < ApplicationRecord
cursor_last_event_timestamp: 'Time of the event log processed by the secondary', cursor_last_event_timestamp: 'Time of the event log processed by the secondary',
last_successful_status_check_timestamp: 'Time when Geo node status was updated internally', last_successful_status_check_timestamp: 'Time when Geo node status was updated internally',
status_message: 'Summary of health status', status_message: 'Summary of health status',
event_log_count: 'Number of entries in the Geo event log',
event_log_max_id: 'Highest ID present in the Geo event log', event_log_max_id: 'Highest ID present in the Geo event log',
repository_created_max_id: 'Highest ID present in repositories created', repository_created_max_id: 'Highest ID present in repositories created',
repository_updated_max_id: 'Highest ID present in repositories updated', repository_updated_max_id: 'Highest ID present in repositories updated',
...@@ -166,7 +166,6 @@ class GeoNodeStatus < ApplicationRecord ...@@ -166,7 +166,6 @@ class GeoNodeStatus < ApplicationRecord
self.version = Gitlab::VERSION self.version = Gitlab::VERSION
self.revision = Gitlab.revision self.revision = Gitlab.revision
self.event_log_count = Geo::EventLog.count
# Geo::PruneEventLogWorker might remove old events, so log maximum id # Geo::PruneEventLogWorker might remove old events, so log maximum id
self.event_log_max_id = Geo::EventLog.maximum(:id) self.event_log_max_id = Geo::EventLog.maximum(:id)
self.repository_created_max_id = Geo::RepositoryCreatedEvent.maximum(:id) self.repository_created_max_id = Geo::RepositoryCreatedEvent.maximum(:id)
......
---
title: 'Geo: Remove counts over geo_event_log table'
merge_request: 12146
author:
type: fixed
...@@ -273,7 +273,6 @@ describe API::Geo do ...@@ -273,7 +273,6 @@ describe API::Geo do
last_event_date: Time.now.utc, last_event_date: Time.now.utc,
cursor_last_event_id: 1, cursor_last_event_id: 1,
cursor_last_event_date: Time.now.utc, cursor_last_event_date: Time.now.utc,
event_log_count: 55,
event_log_max_id: 555, event_log_max_id: 555,
repository_created_max_id: 43, repository_created_max_id: 43,
repository_updated_max_id: 132, repository_updated_max_id: 132,
......
...@@ -36,7 +36,6 @@ describe Geo::MetricsUpdateService, :geo, :prometheus do ...@@ -36,7 +36,6 @@ describe Geo::MetricsUpdateService, :geo, :prometheus do
last_event_date: event_date, last_event_date: event_date,
cursor_last_event_id: 1, cursor_last_event_id: 1,
cursor_last_event_date: event_date, cursor_last_event_date: event_date,
event_log_count: 55,
event_log_max_id: 555, event_log_max_id: 555,
repository_created_max_id: 43, repository_created_max_id: 43,
repository_updated_max_id: 132, repository_updated_max_id: 132,
...@@ -60,7 +59,6 @@ describe Geo::MetricsUpdateService, :geo, :prometheus do ...@@ -60,7 +59,6 @@ describe Geo::MetricsUpdateService, :geo, :prometheus do
attachments_count: 30, attachments_count: 30,
last_event_id: 2, last_event_id: 2,
last_event_date: event_date, last_event_date: event_date,
event_log_count: 55,
event_log_max_id: 555 event_log_max_id: 555
} }
end end
...@@ -176,7 +174,6 @@ describe Geo::MetricsUpdateService, :geo, :prometheus do ...@@ -176,7 +174,6 @@ describe Geo::MetricsUpdateService, :geo, :prometheus do
expect(metric_value(:geo_cursor_last_event_id)).to eq(1) expect(metric_value(:geo_cursor_last_event_id)).to eq(1)
expect(metric_value(:geo_cursor_last_event_timestamp)).to eq(event_date.to_i) expect(metric_value(:geo_cursor_last_event_timestamp)).to eq(event_date.to_i)
expect(metric_value(:geo_last_successful_status_check_timestamp)).to be_truthy expect(metric_value(:geo_last_successful_status_check_timestamp)).to be_truthy
expect(metric_value(:geo_event_log)).to eq(55)
expect(metric_value(:geo_event_log_max_id)).to eq(555) expect(metric_value(:geo_event_log_max_id)).to eq(555)
expect(metric_value(:geo_repository_created_max_id)).to eq(43) expect(metric_value(:geo_repository_created_max_id)).to eq(43)
expect(metric_value(:geo_repository_updated_max_id)).to eq(132) expect(metric_value(:geo_repository_updated_max_id)).to eq(132)
......
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