Prevent excessive reply times in the Query Log after restarting #1297
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By submitting this pull request, I confirm the following:
How familiar are you with the codebase?:
10
The
query->reply_time
variable serves two purposes: (1) When sending a query upstream, we store the current time in this field. (2) When the reply arrives, we compute the difference and store it in the same field. We memorize the transition from (1) to (2) by setting the flagquery->flags.response_calculated
totrue
.Currently (broken in
development
, not inmaster
), we store the reply_time field unconditionally, hence, for a few queries which are still being processed upstream at restart, we store the real time instead of the response. FTL incorrectly interprets the (homogeneous!) timestamp as difference and telly you the query needed quadrillions of milliseconds to get answered.We fix this small bug by instead storing
NULL
in theREPLY_TIME
column when the reply time is not available. FTL already handles this case well when loading from the database: the default ofquery->flags.response_calculated
isfalse
. ANULL
value in this field does not change this default.