Uploaded image for project: 'Hawkular Metrics'
  1. Hawkular Metrics
  2. HWKMETRICS-148

Failed metric creation results in inconsistent state

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 0.15.0
    • Component/s: Core
    • Labels:
      None

      Description

      MetricsService.createMetric(Metric<?> metric) does several things including,

      • Ensure there are no metric naming conflicts
        • If a metric with the same name already exists an exception is thrown
      • Add metric meta data to indexes which includes,
        • tags
        • retention settings
      • Generate and schedule rate calculation job for counter metrics

      createMetric involves a number of writes. If any of those writes fail, the onError method of the returned Observable is invoked to let any subscribers know that the operation failed.

      The problem is that we are left in an inconsistent state with respect to the metric and cannot get back to a consistent state. Unless it is the initial write to the metrics_idx table that fails, retrying the operation will result in a MetricAlreadyExistsException. There needs to be a way to get back to a consistent state such that all of the aforementioned actions are effectively carried out.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                nstefan Stefan Negrea
                Reporter:
                john.sanda John Sanda
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: