Merge pull request #185 from darkfronza/PG-350_fix_bucket_time_range_overflow

PG-350: Fix bucket time overflow.
This commit is contained in:
Ibrar Ahmed
2022-02-24 18:05:08 +05:00
committed by GitHub

View File

@@ -2126,7 +2126,7 @@ get_next_wbucket(pgssSharedState *pgss)
* definitely make the while condition to fail, we can stop the loop as another
* thread has already updated prev_bucket_usec.
*/
while ((current_usec - current_bucket_usec) > (PGSM_BUCKET_TIME * 1000 * 1000))
while ((current_usec - current_bucket_usec) > ((uint64)PGSM_BUCKET_TIME * 1000LU * 1000LU))
{
if (pg_atomic_compare_exchange_u64(&pgss->prev_bucket_usec, &current_bucket_usec, current_usec))
{