Hello!

The write happens inside the spinlock and shared pgss->lock:

+               /* Record the start time of this execution */
+               entry->last_execution_start = exec_start;
+
                SpinLockRelease(&entry->mutex);

And then at the read, we see:

                /*
-                * The spinlock is not required when reading these two as they 
are
+                * The spinlock is not required when reading these three as 
they are
                 * always updated when holding pgss->lock exclusively.
                 */
                stats_since = entry->stats_since;
                minmax_stats_since = entry->minmax_stats_since;
+               last_execution_start = entry->last_execution_start;

But that comment doesn't seem true, it is updated with a shared lock,
not exclusive. Shouldn't it be read together with the counters above
this?


Reply via email to