Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation does not work properly in rollup with the range across the month #2145

Closed
ghost opened this issue Jul 8, 2021 · 3 comments
Closed

Comments

@ghost
Copy link

ghost commented Jul 8, 2021

There could be a bug in validation of rollup time range.
I found that when using the rollup function with the search range across the month, I get results even if the search period is not the required length.
For example, when I set the rollup to 7d, I would get an error if the search period for the data was not longer than 7 days.
However, if the period is set to something like "6/27 0:00 - 7/1 0:00", the results can be got.

ERROR: "6/20 0:00 - 6/24 0:00"
OK: "6/27 0:00 - 7/1 0:00"
These are both 5days.

I can also get results with the period below.
5/30-6/1
It's only 3days.

I guess that something is wrong with calculating time when start and end date are different months.

@manolama manolama added the bug label Jul 14, 2021
@manolama
Copy link
Member

@git-takyano Could you also paste the JSON query from Horizon please? I think you are applying the downsample function to a query and there is a bug where it won't calculate the query range properly but I want to verify your query, thank you.

@ghost
Copy link
Author

ghost commented Jul 14, 2021

@manolama
Here is the query.
Its time range is from 6/27 0:00 to 7/1 0:00.

QUERY:
{
  "start": 1624752000000,
  "end": 1625097600000,
  "executionGraph": [
    {
      "id": "q1_m1",
      "type": "TimeSeriesDataSource",
      "metric": {
        "type": "MetricLiteral",
        "metric": "commondb.prometheus.oracledb_health_check_temp_tbs_rate"
      },
      "sourceId": null,
      "fetchLast": false,
      "filter": {
        "type": "Chain",
        "op": "AND",
        "filters": [
          {
            "type": "TagValueRegex",
            "filter": ".*",
            "tagKey": "cluster_name"
          },
          {
            "type": "TagValueRegex",
            "filter": ".*",
            "tagKey": "db_name"
          },
          {
            "type": "TagValueRegex",
            "filter": ".*",
            "tagKey": "tablespace_name"
          }
        ]
      }
    },
    {
      "id": "q1_m1_downsample",
      "type": "downsample",
      "aggregator": "min",
      "interval": "7d",
      "runAll": false,
      "fill": true,
      "minInterval": "",
      "reportingInterval": "",
      "interpolatorConfigs": [
        {
          "dataType": "numeric",
          "fillPolicy": "NAN",
          "realFillPolicy": "NONE"
        }
      ],
      "sources": [
        "q1_m1"
      ]
    },
    {
      "id": "q1_m1_groupby",
      "type": "groupby",
      "aggregator": "avg",
      "tagKeys": [
        "cluster_name",
        "db_name",
        "tablespace_name"
      ],
      "interpolatorConfigs": [
        {
          "dataType": "numeric",
          "fillPolicy": "NAN",
          "realFillPolicy": "NONE"
        }
      ],
      "sources": [
        "q1_m1_downsample"
      ]
    },
    {
      "id": "summarizer",
      "sources": [
        "q1_m1_groupby"
      ],
      "summaries": [
        "avg",
        "max",
        "min",
        "count",
        "sum",
        "first",
        "last"
      ]
    }
  ],
  "serdesConfigs": [
    {
      "id": "JsonV3QuerySerdes",
      "filter": [
        "q1_m1_groupby",
        "summarizer"
      ]
    }
  ],
  "logLevel": "ERROR",
  "cacheMode": null
}

@manolama manolama added the 3.0 label Jul 15, 2021
@manolama
Copy link
Member

Oh thanks, different issue then. Yes it looks like the HBase code path isn't validating the downsample range properly. Should be easy to fix.

manolama added a commit to manolama/opentsdb that referenced this issue Jul 23, 2021
- Fix for OpenTSDB#2145. Reworks the downsampling a little bit to catch the
  cases where we snap to the downsample beyond the query time range.
  May break some existing queries.
manolama added a commit to manolama/opentsdb that referenced this issue Jul 23, 2021
- Fix for OpenTSDB#2145. Reworks the downsampling a little bit to catch the
  cases where we snap to the downsample beyond the query time range.
  May break some existing queries.
manolama added a commit to manolama/opentsdb that referenced this issue Jul 23, 2021
- Fix for OpenTSDB#2145. Reworks the downsampling a little bit to catch the
  cases where we snap to the downsample beyond the query time range.
  May break some existing queries.
manolama added a commit that referenced this issue Jul 23, 2021
- Fix for #2145. Reworks the downsampling a little bit to catch the
  cases where we snap to the downsample beyond the query time range.
  May break some existing queries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant