Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5
Description
InnoDB appears to contain two different implementations of a random number generator: page_cur_lcg_prng() and ut_rnd_gen_next_ulint(). Both suffer from a scalability issue (and race condition) due to sharing the internal state between multiple threads.
We should investigate whether replacing the linear congruential generator with a Galois linear-feedback shift register would improve the performance, and we should attempt to use thread-local storage for the seed values.
Last but not least, the function page_cur_open_on_rnd_user_rec() is using a linear search for positioning the cursor, instead of invoking page_rec_get_nth().
Side note: It appears that pick_next() causes crashes in ./mtr --suite=innodb_gis if the sequence of random numbers is replaced with a constant.
Attachments
Issue Links
- relates to
-
MDEV-14482 Cache line contention on ut_rnd_ulint_counter()
- Closed
-
MDEV-21285 RAND()/ENCODE() lack of concurrency
- Open