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

PG-350: Fix bucket time overflow.
pull/196/head
Ibrar Ahmed 2022-02-24 18:05:08 +05:00 committed by GitHub
commit f2dd002266
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

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 * definitely make the while condition to fail, we can stop the loop as another
* thread has already updated prev_bucket_usec. * 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)) if (pg_atomic_compare_exchange_u64(&pgss->prev_bucket_usec, &current_bucket_usec, current_usec))
{ {