@@ -139,10 +139,8 @@ func (r *Reaper) Reap(ctx context.Context) (err error) {
139139 if DBSizeMB < r .Sources .MinDbSizeMB {
140140 srcL .Infof ("ignored due to the --min-db-size-mb filter, current size %d MB" , DBSizeMB )
141141 hostsToShutDownDueToRoleChange [monitoredSource .Name ] = true // for the case when DB size was previosly above the threshold
142- SetUndersizedDBState (monitoredSource .Name , true )
143142 continue
144143 }
145- SetUndersizedDBState (monitoredSource .Name , false )
146144 }
147145 }
148146 ver , err := GetMonitoredDatabaseSettings (ctx , monitoredSource , false )
@@ -151,7 +149,6 @@ func (r *Reaper) Reap(ctx context.Context) (err error) {
151149 if ver .IsInRecovery && monitoredSource .OnlyIfMaster {
152150 srcL .Info ("to be removed from monitoring due to 'master only' property and status change" )
153151 hostsToShutDownDueToRoleChange [monitoredSource .Name ] = true
154- SetRecoveryIgnoredDBState (monitoredSource .Name , true )
155152 continue
156153 } else if lastKnownStatusInRecovery != ver .IsInRecovery {
157154 if ver .IsInRecovery && len (monitoredSource .MetricsStandby ) > 0 {
@@ -162,7 +159,6 @@ func (r *Reaper) Reap(ctx context.Context) (err error) {
162159 srcL .Warning ("Switching metrics collection to primary config..." )
163160 metricConfig = monitoredSource .Metrics
164161 hostLastKnownStatusInRecovery [monitoredSource .Name ] = false
165- SetRecoveryIgnoredDBState (monitoredSource .Name , false )
166162 }
167163 }
168164 }
@@ -192,7 +188,6 @@ func (r *Reaper) Reap(ctx context.Context) (err error) {
192188
193189 if metricDefOk && ! chOk { // initialize a new per db/per metric control channel
194190 if interval > 0 {
195- hostMetricIntervalMap [dbMetric ] = interval
196191 srcL .WithField ("metric" , metric ).WithField ("interval" , interval ).Info ("starting gatherer" )
197192 metricCtx , cancelFunc := context .WithCancel (ctx )
198193 cancelFuncs [dbMetric ] = cancelFunc
@@ -231,12 +226,6 @@ func (r *Reaper) Reap(ctx context.Context) (err error) {
231226 srcL .WithField ("metric" , metric ).Warning ("metric definition not found" )
232227 lastSQLFetchError .Store (metric , time .Now ().Unix ())
233228 }
234- } else {
235- // check if interval has changed
236- if hostMetricIntervalMap [dbMetric ] != interval {
237- srcL .WithField ("metric" , metric ).Info ("updating interval..." )
238- hostMetricIntervalMap [dbMetric ] = interval
239- }
240229 }
241230 }
242231 }
0 commit comments