Skip to content

Namespace::AggregationSchedule should keep the lease until timeout

With gitlab-org/gitlab-ce!28996 we implemented Namespace::AggregationSchedule.

The schedule_root_storage_statistics methods implements ExclusiveLeaseGuard to avoid stressing the DB.

Unfortunately ExclusiveLeaseGuard.lease_release? defaults to true, therefore the lease is released immediately not protecting the DB from several expensive update queries.

Implementing a simple lease_release? in Namespace::AggregationSchedule should be enough.

class Namespace::AggregationSchedule
  def lease_release?
    false
  end
end