diff options
| author | Tatsuo Ishii | 2025-06-05 09:59:25 +0000 |
|---|---|---|
| committer | Tatsuo Ishii | 2025-06-06 10:53:03 +0000 |
| commit | 1a68c6eb0b2afb470485a4d8ed5b7cb494e2e442 (patch) | |
| tree | f92418ca6e52ccca7c5f887437fa815e8afc5e5d /doc/src | |
| parent | f0d0abb4c596c821fb81d8f47e12da75a89cb3fe (diff) | |
Replace random() with pg_prng random function.
Previously we used random() for choosing load balancing node. However
PostgreSQL has better random number generator: pg_prng.c. This commit
imports the file and use pg_prng_double() to generate random number in
range [0.0, 1.0). The seed is generated using pg_strong_random().
Other notes regarding the port:
- Some of functions in the file were not ported because they require
additional library: pg_bitutils.c. In the future we may revisit and
import pg_bitutils.c.
- All conditional compiling regarding "sun" or "_sun" are removed. It
seems the platform is not used for running pgpool anymore.
- Since srandom() is not necessary any more, related code are removed
from pgpool_main.c, child.c and pcp_worker.c.
Author: Martijn van Duren <pgpool@list.imperialat.at>, Tatsuo Ishii <ishii@postgresql.org>
Discussion: [pgpool-hackers: 4588] Shuffle random functions and use better random numbers
https://www.pgpool.net/pipermail/pgpool-hackers/2025-May/004589.html
Diffstat (limited to 'doc/src')
0 files changed, 0 insertions, 0 deletions
