Update consuming freshness field in query resp to be backed by the server reported ingestion delay timestamp#13207
Conversation
…mestamp of the ingestion delay metric
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #13207 +/- ##
=============================================
- Coverage 61.75% 35.18% -26.58%
+ Complexity 207 6 -201
=============================================
Files 2436 2458 +22
Lines 133233 135136 +1903
Branches 20636 20943 +307
=============================================
- Hits 82274 47541 -34733
- Misses 44911 84091 +39180
+ Partials 6048 3504 -2544
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Jackie-Jiang
left a comment
There was a problem hiding this comment.
The solution looks good in general.
One behavior I want to discuss: when the consuming segment is not queried (or pruned), we won't return freshness time. Is this behavior desired?
| // Not protected as this will only be invoked when metric is installed which happens after server ready | ||
| IngestionTimestamps currentMeasure = _partitionToIngestionTimestampsMap.get(partitionGroupId); | ||
| if (currentMeasure == null) { // Guard just in case we read the metric without initializing it | ||
| return 0; |
There was a problem hiding this comment.
Suggest returning Long.MIN_VALUE by default to be aligned with the segment metadata
I dont think its ideal, but Im not sure I have better way to introduce it at the moment since it requires consuming segments to be queried. But if you have suggestion regarding this let me know I'm thinking a follow up related to a broker api that fills the gap (and possibly brokers periodically polling servers) and using that info to augment queries that didn't end up querying consuming segments |
…rver reported ingestion delay timestamp (apache#13207)
This updates the
minConsumingFreshnessTimestampMsquery response metadata field to be backed by theREALTIME_INGESTION_DELAY_MS metric's timestamp(backed by the IngestionDelayTracker class).The current implementation can cause false positives because low volume partitions, even on a high-volume table could make it seem like there is lag where this is not in reality. This makes it hard to reliably trust/use this metric to make any decisions
Previous behaviour:
New behaviour:
Unchanged:
This is prone to the issue described in #11448, which we should prioritize fixing but I do think the benefits still outweigh that con in terms of this PR
Testing:
getPartitionIngestionTimeMsbut turned out to be no diff