-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Announce highest TSDB min time #6253
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
base: main
Are you sure you want to change the base?
Conversation
The distributed query engine queries both store and ingest components in parallel and deduplicates samples by prioritizing those coming from components with a higher max time. Different Prometheus/Receive components can apply retention independetly of each other which can cause remote aggregates to be executed on partial data. This will lead to incorrect results because these partial aggregates will be prioritized over data coming from stores. The problem is first described in thanos-io/promql-engine#187. To address this problem, this commit exposes an info field called guaranteed_min_time from all stores APIs. The field indicates what is the minimum time that the store guarantees to hold across all TSDBs. For stores holding a single TSDB (Prometheus, Ruler) this field is calculated by using the retention and min block duration parameters. The Querier/Proxy component calculate the value by taking the highest guaranteed_min_time across all TSDBs. Using this field, the distributed engine can scope the start time of remote queries to a time for which data is guaranteed to be complete. Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
2f6cd59 to
209d0b3
Compare
The retention flag in Prometheus has been renamed to `storage.tsdb.retention.time` while Thanos still uses `storage.tsdb.retention`. This leads to the guaranteed min time being calculated incorrectly for Prometheus instances. This commit fixes the issue. Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
209d0b3 to
fce6436
Compare
GiedriusS
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels a bit like a hack because it sounds to me like the core of the problem is that InfoResponse only contains one StoreInfo whereas nowadays multiple TSDBs are supported in one component. 🤔 I wonder if it would be a lot of work to instead introduce repeated StoreInfo. Also, what makes this StoreInfo special? Perhaps we would like to have repeated TargetsInfo and so on?
|
Yeah the root of the problem is that So maybe |
|
@matej-g @GiedriusS this is what this suggestion would look like: #6329 |
|
Hello 👋 Looks like there was no activity on this amazing PR for the last 30 days. |
The distributed query engine queries both store and ingest components in parallel and deduplicates samples by prioritizing those coming from components with a higher max time. Different Prometheus/Receive components can apply retention independetly of each other which can cause remote aggregates to be executed on partial data. This will lead to incorrect results because these partial aggregates will be prioritized over data coming from stores. The problem is first described in thanos-io/promql-engine#187.
To address this problem, this commit exposes an info field
called guaranteed_min_time(better names are welcome :) ) from all stores APIs. The field indicates what is the minimum time that a store API guarantees to hold across all TSDBs. For stores APIs holding a single TSDB (Prometheus, Ruler) this field is calculated by using the retention and min block duration parameters. The Querier/Proxy component calculate the value by taking the highestguaranteed_min_timeacross all TSDBs.Using this field, the distributed engine can scope the start time of remote queries to a time for which data is guaranteed to be complete.
Changes
guaranteed_min_timeinfo field.Verification