[Hawkular-commits] [hawkular/hawkular-metrics] 468955: [HWKMETRICS-780] fix temp tables not getting dropp...

John Sanda jsanda at redhat.com
Fri Apr 20 15:34:12 EDT 2018


  Branch: refs/heads/release/0.29.0
  Home:   https://github.com/hawkular/hawkular-metrics
  Commit: 4689551c878e6ea83df78f2d813f6b26d7bb5d3e
      https://github.com/hawkular/hawkular-metrics/commit/4689551c878e6ea83df78f2d813f6b26d7bb5d3e
  Author: John Sanda <jsanda at redhat.com>
  Date:   2018-04-20 (Fri, 20 Apr 2018)

  Changed paths:
    M api/metrics-api-jaxrs/src/main/java/org/hawkular/metrics/api/jaxrs/MetricsServiceLifecycle.java
    M core/metrics-core-service/src/main/java/org/hawkular/metrics/core/jobs/JobsServiceImpl.java
    A core/metrics-core-service/src/main/java/org/hawkular/metrics/core/service/TempTablesCleaner.java
    R job-scheduler/src/main/java/org/hawkular/metrics/scheduler/api/RetryPolicy.java
    M job-scheduler/src/main/java/org/hawkular/metrics/scheduler/api/Scheduler.java
    M job-scheduler/src/main/java/org/hawkular/metrics/scheduler/impl/SchedulerImpl.java
    M job-scheduler/src/main/java/org/hawkular/metrics/scheduler/impl/TestScheduler.java
    M job-scheduler/src/test/java/org/hawkular/metrics/scheduler/impl/JobExecutionTest.java

  Log Message:
  -----------
  [HWKMETRICS-780] fix temp tables not getting dropped (#928)

* [HWKMETRICS-763] fix bug in scheduler error handling

I found the bug today which is in SchedulerImpl.java. At some point a while back
I added retry support for when jobs fails. You provide a RetryPolicy that
determines if and when a job should be retried. This was primarily intended for
non-repeating, single-execution jobs. For repeating jobs, i.e., the compression
job, the job is supposed to be executed according to its trigger. Suppose the
compression job is scheduled to run at 15:00 and repeats every two hours. If
the 15:00 execution fails, the scheduler is supposed to retry the job (for all
intensive purposes) immediately with the same trigger time of 15:00. When the
job completes normally, its trigger will get updated in the database to the
next execution time of 17:00. If it already later than 17:00, then the
scheduler will again execute the job right away.

There was a bug with the error handling such that the job wasn't getting
retried for the 15:00 execution. The trigger was getting advanced and set to
17:00. The temp table being compressed gets dropped at the end of the
compression job. Unless the failure was dropping the table, we end up with
orphaned temp tables any time the job fails.

This commit does away with the RetryPolicy since it is not used. This
means that when a job fails, regardless of whether or not it is
repeating, it will be retried with the same trigger until it completes
normally.

* [HWKMETRICS-763] add "local" job to check for expired temp tables

Due to the bug in SchedulerImpl.java which was fixed in my previous
commit, there are openshift clusters with literally hundreds of expired
temp tables. They are expired in the sense that they are older than the
data retention and therefore do not contain any live data.

This commit adds a "local" job that checks for and drops expired tables.
The job is local in the sense that it is local to the hawkular-metrics
server. It is not run via the job scheduler.

* [HWKMETRICS-763] use Observable.empty to get rid of filter call


  Commit: ea834ea2f13b787b0910e4a05db74a28fefe4cc4
      https://github.com/hawkular/hawkular-metrics/commit/ea834ea2f13b787b0910e4a05db74a28fefe4cc4
  Author: John Sanda <jsanda at redhat.com>
  Date:   2018-04-20 (Fri, 20 Apr 2018)

  Changed paths:
    M api/metrics-api-jaxrs/src/main/java/org/hawkular/metrics/api/jaxrs/MetricsServiceLifecycle.java
    M core/metrics-core-service/src/main/java/org/hawkular/metrics/core/jobs/JobsServiceImpl.java
    A core/metrics-core-service/src/main/java/org/hawkular/metrics/core/service/TempTablesCleaner.java
    R job-scheduler/src/main/java/org/hawkular/metrics/scheduler/api/RetryPolicy.java
    M job-scheduler/src/main/java/org/hawkular/metrics/scheduler/api/Scheduler.java
    M job-scheduler/src/main/java/org/hawkular/metrics/scheduler/impl/SchedulerImpl.java
    M job-scheduler/src/main/java/org/hawkular/metrics/scheduler/impl/TestScheduler.java
    M job-scheduler/src/test/java/org/hawkular/metrics/scheduler/impl/JobExecutionTest.java

  Log Message:
  -----------
  Merge pull request #953 from jsanda/hwkmetrics-780

HWKMETRICS-780


Compare: https://github.com/hawkular/hawkular-metrics/compare/087de7e996cf...ea834ea2f13b


More information about the hawkular-commits mailing list