mirror of
https://github.com/percona/pg_stat_monitor.git
synced 2026-02-04 22:16:20 +00:00
Merge pull request #185 from darkfronza/PG-350_fix_bucket_time_range_overflow
PG-350: Fix bucket time overflow.
This commit is contained in:
@@ -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, ¤t_bucket_usec, current_usec))
|
if (pg_atomic_compare_exchange_u64(&pgss->prev_bucket_usec, ¤t_bucket_usec, current_usec))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user