File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -4386,15 +4386,19 @@ static void
43864386pgstat_recv_inquiry (PgStat_MsgInquiry * msg , int len )
43874387{
43884388 slist_iter iter ;
4389- bool found = false;
43904389 DBWriteRequest * newreq ;
43914390 PgStat_StatDBEntry * dbentry ;
43924391
43934392 elog (DEBUG2 , "received inquiry for %d" , msg -> databaseid );
43944393
43954394 /*
4396- * Find the last write request for this DB (found=true in that case).
4397- * Plain linear search, not really worth doing any magic here (probably).
4395+ * Find the last write request for this DB. If it's older than the
4396+ * request's cutoff time, update it; otherwise there's nothing to do.
4397+ *
4398+ * Note that if a request is found, we return early and skip the below
4399+ * check for clock skew. This is okay, since the only way for a DB request
4400+ * to be present in the list is that we have been here since the last write
4401+ * round.
43984402 */
43994403 slist_foreach (iter , & last_statrequests )
44004404 {
@@ -4405,7 +4409,6 @@ pgstat_recv_inquiry(PgStat_MsgInquiry *msg, int len)
44054409
44064410 if (msg -> cutoff_time > req -> request_time )
44074411 req -> request_time = msg -> cutoff_time ;
4408- found = true;
44094412 return ;
44104413 }
44114414
You can’t perform that action at this time.
0 commit comments