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

John Sanda jsanda at redhat.com
Mon Apr 9 11:03:44 EDT 2018


  Branch: refs/heads/release/0.30.0
  Home:   https://github.com/hawkular/hawkular-metrics
  Commit: a33e3142171053d88b7590e0ef239d532c1ba8ad
      https://github.com/hawkular/hawkular-metrics/commit/a33e3142171053d88b7590e0ef239d532c1ba8ad
  Author: John Sanda <jsanda at redhat.com>
  Date:   2018-04-09 (Mon, 09 Apr 2018)

  Changed paths:
    M api/metrics-api-jaxrs/src/main/java/org/hawkular/metrics/api/jaxrs/MetricsServiceLifecycle.java
    M api/metrics-api-jaxrs/src/main/java/org/hawkular/metrics/api/jaxrs/util/SchemaVersionChecker.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-763] 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: 3a7b8d1d2202db1f6d8b9decd398c4905ef07e50
      https://github.com/hawkular/hawkular-metrics/commit/3a7b8d1d2202db1f6d8b9decd398c4905ef07e50
  Author: John Sanda <jsanda at redhat.com>
  Date:   2018-04-09 (Mon, 09 Apr 2018)

  Changed paths:
    M api/metrics-api-jaxrs/src/main/java/org/hawkular/metrics/api/jaxrs/MetricsServiceLifecycle.java
    M api/metrics-api-jaxrs/src/main/java/org/hawkular/metrics/api/jaxrs/util/SchemaVersionChecker.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 #935 from jsanda/hwkmetrics-763-release/0.30.0

[HWKMETRICS-763] back port to release/0.30.0


Compare: https://github.com/hawkular/hawkular-metrics/compare/b469c34f0fe6...3a7b8d1d2202


More information about the hawkular-commits mailing list