filodb / FiloDB

Distributed Prometheus time series database
Apache License 2.0
1.43k stars 225 forks source link

fix(core) send the right promql to remote in HighAvailabilityPlanner. #1822

Closed yu-shipit closed 2 months ago

yu-shipit commented 2 months ago

Pull Request checklist

**Current behavior : For queries such as 1 - sum(foo), when local shards are unhealthy, the HighAvailabilityPlanner will create a remote plan 1 - sum(foo) that runs in its healthy buddy cluster. This, however, cause that the query behaves equivalent to 1 - Remote(1 - sum(foo)).

New behavior : The same query will be materialized something like1 - Remote(sum(foo)) to produce the correct result.

BREAKING CHANGES

If this PR contains a breaking change, please describe the impact and migration path for existing applications. If not please remove this section.

Breaking changes may include:

Other information: